Last Updated: February 25, 2016
·
223
· thom_nic

Conver screencasts to animated gif

Start by screen recording (e.g. quicktime on mac.) Convert to gif using the following:

# convert screencasts to animated gif.
# Usage: screen2gif input.mov [out (default: out.gif)] [width (default: 800)]
i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality
screen2gif () {
    width=${3-800}
    out=${2-out}
    ffmpeg -i $1 -vf scale=$width:-1 -r 10 -f image2pipe -vcodec ppm - | \
        convert -delay 5 -layers Optimize -loop 0 - $out.gif
}

Requires ffmpeg and convert (imagemagick.)

Inspired by
https://gist.github.com/dergachev/4627207 and
http://superuser.com/questions/556029/how-do-