Skip to content

Instantly share code, notes, and snippets.

@robertoentringer
Forked from baumandm/GIF-Screencast-OSX.md
Last active July 10, 2019 23:59
Show Gist options
  • Save robertoentringer/667f995a004c05955b5c768e9e71f381 to your computer and use it in GitHub Desktop.
Save robertoentringer/667f995a004c05955b5c768e9e71f381 to your computer and use it in GitHub Desktop.
OS X Screencast to Animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime and ffmpeg.

Forked from https://gist.github.com/baumandm/1dba6a055356d183bbf7. Updated to facility the usage.

Instructions

Add the following function in your .bash_profile :

function movtogif () {
  tempfile=.mov-to-gif-$(date +"%s").png
  ffmpeg -v quiet -stats -y -i $1 -vf fps=10,palettegen $tempfile
  ffmpeg -v quiet -stats -i $1 -i $tempfile -filter_complex "fps=10,paletteuse" "${1%.mov}.gif"
  rm $tempfile
}

Usage

$ movtogif filename.mov

Dependencies

The conversion process requires the following command-line tools:

  • ffmpeg to process the video file

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

$ brew install ffmpeg 

Resources

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