Skip to content

Instantly share code, notes, and snippets.

@gadenbuie
Last active September 18, 2019 17:25
Show Gist options
  • Save gadenbuie/ad73164c1153b1551303e42cde7b48b4 to your computer and use it in GitHub Desktop.
Save gadenbuie/ad73164c1153b1551303e42cde7b48b4 to your computer and use it in GitHub Desktop.
Convert screencast mov to gif
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=6,scale=720:-1:flags=bicubic"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
@gadenbuie
Copy link
Author

@gadenbuie
Copy link
Author

gadenbuie commented Feb 1, 2019

Usage

  • Download the script or copy and paste into a file called gifify.sh.

  • Make the script executable with chmod +x gifify.sh

  • Turn your movie into a gif:

    ./gifify.sh movie.mp4 movie.gif
    

Requires ffmpeg which can be installed via homebrew on MacOS: brew install ffmpeg

@tgerke
Copy link

tgerke commented Sep 18, 2019

homebrew install ffmpeg -> brew install ffmpeg :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment