Skip to content

Instantly share code, notes, and snippets.

@alrocar
Last active May 26, 2018 15:13
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 alrocar/b6dcb5b91dd550b804a7a2a578b09736 to your computer and use it in GitHub Desktop.
Save alrocar/b6dcb5b91dd550b804a7a2a578b09736 to your computer and use it in GitHub Desktop.
high-quality-gif
# first create a palette of the portion of the video with more colors
ffmpeg -y -ss 20 -t 3 -i input.mp4 -vf fps=50,scale=640:-1:flags=lanczos,palettegen palette.png
# then use the palette to obtain high quality colors
ffmpeg -i input.mp4 -i palette.png -filter_complex "fps=50,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
# -ss -> start from second
# -t -> duration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment