Bash function for OS X to convert a .mov file into a .gif but in a reasonable quality.
wget -O /tmp/XQuartz-2.7.5.dmg http://xquartz.macosforge.org/downloads/SL/XQuartz-2.7.5.dmg
open /tmp/XQuartz-2.7.5.dmg
brew install ffmpeg
brew install gifsicle
Put the following function into your .bashrc or .zshrc:
function mov2gif {
file="$1"
if [ $1 ]; then
if [[ "$file" == *.mov || "$file" == *.MOV ]]; then
echo -n "Generating gif from movie '$1' ... "
rm "$1".gif &> /dev/null
ffmpeg -i "$1" -r 10 -f image2pipe -vcodec ppm - 2>/dev/null | convert -verbose +dither -layers Optimize -resize 600x600\> - gif:- 2>/dev/null | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - 2>/dev/null > "$1".gif
echo -n "done\nMoving gif to '$1.gif' ... done\n"
else
echo -n "Error: '$1' is not a .mov file!\n"
fi
else
echo -n "Error: no argument"
fi
}