How to create GIFs on a Mac

This describes how to create GIF files of a screen recording using FFmpeg.

Install FFmpeg using Homebrew

  1. Run the following to install FFmpeg (Note: You must have Homebrew installed.)
$ brew install ffmpeg
  1. Check that FFmpeg is installed
$ brew list

Create a recording of the device

  1. Connect device to your computer
  2. Open Quicktime
  3. Under “File”, select “New Movie Recording”
  4. Select your external device from the drop-down menu
  5. Create your recording
  6. Save the recording

Convert the .mov file to a .png file

Run the following command

ffmpeg -i ios-sdk-starter.mov -i ios-sdk-starter.png -lavfi fps=20,paletteuse -y ios-sdk-starter.gif

Example

ffmpeg -i just-java.mov -lavfi fps=20,paletteuse -y just-java.gif

ffmpeg -i just-java.mov -pix_fmt just-java.gif

ffmpeg -i just-java.mov just-java.png

ffmpeg -y -i just-java.mov
-vf fps=10,scale=320:-1:flags=lanczos,palettegen just-java.png

ffmpeg -i just-java.mov -r 10 just-java.png