Skip to content

Instantly share code, notes, and snippets.

@edesdan
Last active March 6, 2018 23:45
Show Gist options
  • Save edesdan/f808aacf87f78b933a47cf676704bdf0 to your computer and use it in GitHub Desktop.
Save edesdan/f808aacf87f78b933a47cf676704bdf0 to your computer and use it in GitHub Desktop.
OS X Screencast to animated GIF using quicktime + ffmpeg
  1. Record with Quicktime, no audio, save as .mov with full resolution (trim video if necessary).
  2. Make sure you have installed ffmpeg: brew install ffmpeg.
  3. Use the following script to produce the final gif:
#!/bin/sh
  
palette="/tmp/palette.png"

filters="fps=15,scale=640:-1:flags=lanczos"

ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2

like:

./mov2gif.sh in.mov out.gif

Note: the scale is set to 640 as default in the script.

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