Skip to content

Instantly share code, notes, and snippets.

@v1c77
Created August 17, 2018 07:19
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 v1c77/f7d85ef3ac90f6dffc273177b2b5c528 to your computer and use it in GitHub Desktop.
Save v1c77/f7d85ef3ac90f6dffc273177b2b5c528 to your computer and use it in GitHub Desktop.
Convert movies to gif in OS X Mac

#OS X Movie to animated GIF

ffmpeg -i movie-name.mp4 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=0 --delay=3 > movie-name.gif

##Options

  • -r 10 tells ffmpeg to reduce the frame rate from 25 fps to 10
  • -s 600x400 tells ffmpeg the max-width and max-height
  • --delay=7 tells gifsicle to delay 70ms between each gif
  • --optimize=3 requests that gifsicle use the slowest/most file-size optimization

##Installation

The conversion process requires the following command-line tools:

  • ffmpeg to process the video file
  • gifsicle to create and optimize the an animated gif

If you use homebrew and homebrew-cask software packages, just type this in:

brew install ffmpeg 
brew cask install x-quartz #dependency for gifsicle, only required for mountain-lion and above
open /usr/local/Cellar/x-quartz/2.7.4/XQuartz.pkg # runs the XQuartz installer
brew install gifsicle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment