Skip to content

Instantly share code, notes, and snippets.

@miromannino
Created May 16, 2020 19:13
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miromannino/10ac1ba13476e5da15e8590544849881 to your computer and use it in GitHub Desktop.
Save miromannino/10ac1ba13476e5da15e8590544849881 to your computer and use it in GitHub Desktop.
Convert .mov or .mp4 to .gif

How to convert .mov or .mp4 to .gif using the command line

Requirements

brew install ffmpeg
brew install gifsicle

How to convert

ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif

Arguments:

-r 10 to reduce the frame rate from 25 fps to 10 fps
-s 600x400 to determine the output size.
--delay=3 to have a delay of 30ms between each gif
--optimize=3 to use the most file-size optimized algorithm
@KonradLinkowski
Copy link

This is exactly what I was looking for, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment