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

Screen Capture with Quicktime/FFmpeg/gifsicle

This gist explains how I created the following screencapture as an animated gif:

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

brew install ffmpeg imagemagick 
brew-cask install x-quartz #dependency for gifsicle, required for mountain-lion and above
open /usr/local/Cellar/xquartz/2.7.4/XQuartz.pkg # run the installer
brew install gifsicle

Resources:

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