Skip to content

Instantly share code, notes, and snippets.

@higsch
Forked from dergachev/GIF-Screencast-OSX.md
Created June 8, 2021 06:58
Show Gist options
  • Save higsch/36727532e79318c39d007dc242bff4c2 to your computer and use it in GitHub Desktop.
Save higsch/36727532e79318c39d007dc242bff4c2 to your computer and use it in GitHub Desktop.
OS X Screencast to animated GIF

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

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:

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