Skip to content

Instantly share code, notes, and snippets.

@j3j5
Created December 19, 2016 16:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save j3j5/4beb5a35c76e94e33384d5aaf8a2c4c3 to your computer and use it in GitHub Desktop.
Save j3j5/4beb5a35c76e94e33384d5aaf8a2c4c3 to your computer and use it in GitHub Desktop.
Convert from video to GIF using ffmpeg
# Replace the parameters on capital letters
ffmpeg -y -ss 30 -t 3 -i EXAMPLE.mp4 -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png
ffmpeg -ss START_TIME -t DURATION -i EXAMPLE.mp4 -i palette.png -filter_complex "fps=10,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