Skip to content

Instantly share code, notes, and snippets.

@jayair
Created October 13, 2016 20:00
Show Gist options
  • Save jayair/570a6c0afff25cec9400b533590b2ad6 to your computer and use it in GitHub Desktop.
Save jayair/570a6c0afff25cec9400b533590b2ad6 to your computer and use it in GitHub Desktop.

Generate palette from input. Scale is the width of the output, height is generated based on aspect ratio.

ffmpeg -y -t 3 -i input.mov -vf fps=25,scale=320:-1:flags=lanczos,palettegen palette.png

Generate GIF

ffmpeg -t 3 -i input.mov -i palette.png -filter_complex "fps=25,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment