Skip to content

Instantly share code, notes, and snippets.

@JakeCoxon
Last active August 22, 2017 17:25
Show Gist options
  • Save JakeCoxon/d8f86261af87cffe4922 to your computer and use it in GitHub Desktop.
Save JakeCoxon/d8f86261af87cffe4922 to your computer and use it in GitHub Desktop.
MOV to GIF
ffmpeg -i input.mov -filter:v "setpts=2.0*PTS" -s 187x333 -pix_fmt rgb8 -r 10 -f gif - | gifsicle --optimize=3 > out.gif
# Explanation
ffmpeg -i input.mov \ # Input file
-filter:v "setpts=2.0*PTS" \ # Scale time 2x
-s 187x333 \ # Set pixel size
-pix_fmt rgb24 \ # Pixel format
-r 10 \ # Set framerate
-f gif - | \ # Output gif format
gifsicle \ # Optimize the ffmpeg gif
--optimize=3 \ # Optimize level 3 (max)
> out.gif # Output file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment