Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@synth
Last active May 25, 2021 19:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save synth/d1045e129a5f35d87b69 to your computer and use it in GitHub Desktop.
Save synth/d1045e129a5f35d87b69 to your computer and use it in GitHub Desktop.
High quality gifs on OSX with ffmpeg
brew install ffmpeg ImageMagic mplayer gifsicle
# Option 1
# http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality
ffmpeg -y -i yourmovie.mov -vf fps=10,scale=800:-1:flags=lanczos,palettegen palette.png
ffmpeg -i yourmovie.mov -i palette.png -filter_complex "fps=10,scale=800:-1:flags=lanczos[x];[x][1:v]paletteuse" yourgif.gif
# Option 2
# https://gist.github.com/dergachev/4627207
ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment