- Record with Quicktime, no audio, save as .mov with full resolution (trim video if necessary).
- Make sure you have installed ffmpeg: brew install ffmpeg.
- 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.