I’ve found myself creating animated GIFs from videos enough recently to make a little shell script to use from the command line, so I don’t need to keep looking up the ffmpeg options–of which there are so many. Put this in your PATH and smoke it:

#!/bin/sh

USAGE="usage: gif video_file [gif_file]"

video_file=$1

if [ "$video_file" = "" ]; then
    echo $USAGE
    exit 1
elif [ $2 ]; then
    gif_file=$2
else
    gif_file="${video_file%.*}.gif"
fi

echo "converting ${video_file} to ${gif_file} ..."

ffmpeg -i "${video_file}" -vf "fps=5,scale=1000:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "${gif_file}" -loglevel error #ffmpeg -i "${video_file}" -vf "fps=10,scale=1000:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "${gif_file}" -loglevel error

What an insanely great tool ffmpeg is. I’d actually love to read a history of the project–has that been done already?