A 4-line shell script to convert your movies into gifs. Defaults to 10fps, 700px wide.
WIDTH=420 FPS=12 togif input.mov
You'll need to have ffmpeg installed -- on mac, you can do this with brew
:
brew install ffmpeg
Assuming you have /usr/local/bin
in your path, you can install the script by copying/pasting this into your shell:
cat >> /usr/local/bin/togif <<EOL
FILENAME="\${1%.*}"
WIDTH=\${WIDTH:-700}
FPS=\${FPS:-12}
ffmpeg -i \$1 -filter_complex "[0:v] fps=\$FPS,scale=\$WIDTH:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" \$FILENAME.gif
EOL
chmod +x /usr/local/bin/togif
For details on how this works, see: