Skip to content

Instantly share code, notes, and snippets.

@isao
Forked from baumandm/GIF-Screencast-OSX.md
Created April 13, 2018 20:08
Show Gist options
  • Save isao/d8b5043d0bb72d535ef4304afad60305 to your computer and use it in GitHub Desktop.
Save isao/d8b5043d0bb72d535ef4304afad60305 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/dergachev/4627207. Updated to use a palette to improve quality and skip gifsicle.

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

  • Open "Quicktime Player",
  • Go to File -> New Screen Recording
  • Selected screen portion by dragging a rectangle, recorded 13 second video.
  • Go to File -> Export -> As Movie
    • Saved the video in full quality with the filename in.mov

Create a palette image from the video:

ffmpeg -y -i in.mov -vf fps=10,palettegen palette.png

Convert into a GIF using the palette

ffmpeg -i in.mov -i palette.png -filter_complex "fps=10,paletteuse" out.gif

Installation

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

Related Ideas

  • Extend https://github.com/dergachev/copy-public-url folder action for this use case
    • it would automate the conversion before copying Dropbox public URL
    • assign the folder action to ~/Dropbox/Public/Screenshots/gif
    • consider finding a way to simplify the dependency installation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment