# OS X Screencast to animated GIF The following animated gif was captured with only free (as in beer) OS X tools: Quicktime, ffmpeg, and gifsicle. This gist shows how. ![Screencapture GIF](http://dl-web.dropbox.com/u/29440342/screenshots/OBDHSF-KJDFKJS-screencapture.gif) ## Instructions The above gif was created as follows: * Open "Quicktime Player", * Go to File -> New Screen Recording * Selected screen portion by dragging a rectangle, recorded 13 second video. * Saved the video in **full quality** named in.mov (filesize: 19 megabytes) * Ran the following command that produced out.gif (filesize: 48 kilabytes) * `ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle -O3 -d3 > out.gif` * "-r 10" refers to 10 frames per second * "-s 600x400" specifies max-width and max-height ## Installation The conversion 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/xquartz/2.7.4/XQuartz.pkg # launches the XQuartz installer that cask downloaded brew install gifsicle ## Resources: * http://schneems.com/post/41104255619/use-gifs-in-your-pull-request-for-good-not-evil (primary source!) * http://www.reddit.com/r/programming/comments/16zu7d/use_gifs_in_your_pull_requests_for_good_not_evil/ * http://superuser.com/questions/436056/how-can-i-get-ffmpeg-to-convert-a-mov-to-a-gif#_=_ * http://gnuski.blogspot.ca/2012/06/creating-animate-gif-with-free-software.html