Screencast and convert to Gif

Rykka at 2014/08/21


Screencast and convert to gif, under linux(Ubuntu 14.04).

The latter solution is better in gif format only. but can not get other formats and can not modify.

e.g.: A Three Minutes ScreenCast in 2.6MB

Step by step solution

Screencapture: Kazam:

sudo add-apt-repository ppa:and471/kazam-daily-builds
sudo apt-get update
sudo apt-get install kazam


sudo add-apt-repository ppa:jon-severinsson/ffmpeg


sudo apt-get install gifsicle


  1. Kazam capture and Save (with or without screenkey)

  2. Crop:

    ffmpeg -i rst_quick_start.mp4 -vf "crop=790:720:320:250"  rst_quick_crop.mp4
  3. ffmpeg convert to gif:

    # -t duration -r fps -s size -y (no ask overwrite)
    ffmpeg -y -i autotype.mp4 -t 48 -r 12 -pix_fmt rgb24 out.gif
  4. gifsicle resize gif:

    gifsicle --delay=5 --loop out.gif > anim.gif

All in one solution

This one is much better if only need gif format.

sudo add-apt-repository ppa:fossfreedom/byzanz
sudo apt-get update && sudo apt-get install byzanz




Additional Tools

Screen Key:

sudo apt-get install screenkey