Skip to content

Instantly share code, notes, and snippets.

@f1sherman
Created May 8, 2015 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f1sherman/2723fa4e055bf244d59f to your computer and use it in GitHub Desktop.
Save f1sherman/2723fa4e055bf244d59f to your computer and use it in GitHub Desktop.
Generating an animated gif from

From http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html#usage

brew install ffmpeg # need at least 2.6
#!/bin/sh

palette="/tmp/palette.png"

filters="fps=15,scale=320:-1:flags=lanczos"

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
./gifenc.sh video.mkv anim.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment