Skip to content

Instantly share code, notes, and snippets.

@medienbaecker
Forked from baumandm/GIF-Screencast-OSX.md
Created November 24, 2017 11:49
Show Gist options
  • Save medienbaecker/6f39e2f0cde42f6d57e0a7c564d22bb2 to your computer and use it in GitHub Desktop.
Save medienbaecker/6f39e2f0cde42f6d57e0a7c564d22bb2 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