Skip to content

Instantly share code, notes, and snippets.

@lancebecker
Last active August 29, 2015 14:08
Show Gist options
  • Save lancebecker/347d5e90d0db3a86d083 to your computer and use it in GitHub Desktop.
Save lancebecker/347d5e90d0db3a86d083 to your computer and use it in GitHub Desktop.
Creating gifs from quicktime screencasts for use in github comments / pull requests.

Grab the dependencies first.

brew install ffmpeg

Record your screencast video with Quicktime

Example

Put this function in your .bashrc/zshrc

I like to put the converted gif into my screenshots folder, change how you see fit

makegif() {
  print "Making a $1 gif in ~/Screenshots"
  ffmpeg -i $1.mov -vf scale=640:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - ~/Screenshots/$1.gif
}

Use said function on the file, note I'm omitting .mov extension

 makegif my-screencapture-video

Result

result

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