block by mbostock 4b88b250bc4439289d94

Screen Recording to GIF

If you haven’t already:

brew install ffmpeg gifsicle

Open QuickTime Player. File > New Screen Recording. Record. Trim as needed. Save as

First compute a good color palette:

ffmpeg -i -vf 'scale=-1:-1:flags=lanczos,palettegen' foo-palette.png

Then make your GIF:

ffmpeg -i -i foo-palette.png -filter_complex 'scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse' foo.gif

To drop frames, add fps=10, to the -filter_complex argument.

To crop, add crop=width:height:x:y, to the -filter_complex argument.

See also