How to Make Gif Animations from Screencasts on Ubuntu

Last updated:
Table of Contents

TL;DR: 1) Record mp4 video with Kazam, 2) Convert video to gif using Gifify

In order to make gif animations on Ubuntu, you need to first record a screencast (using Kazam) and then using Gifify to convert the video into a gif.

There as the steps:

1) Install Kazam and Record Screencast

Use a small frame-rate to keep file size small (10 is enough)

  • Install: $ sudo apt install kazam

  • Open up Kazam and start recording a screencast

  • When finished, click the camcorder icon2 on the task bar:

    camcorder-icon Click the camcorder icon
    when you're done recording

  • Click again on Kazam and save:

    kazam-icon-on-taskbard Open up the dialog and save
    the video you just recorded.

2) Install gifsicle

Gifsicle is needed by gifify

$ git clone git@github.com:kohler/gifsicle.git
$ cd gifsicle
$ autoreconf -i
$ ./configure
$ make && sudo make install

3) Install Gifify

Install Gifify using npm1

$ sudo npm i -g gifify

I'm using version 2.4.3:

$ gifify --version
2.4.3

4) Install ffmpeg

Install the ffmpeg package:

$ sudo apt install ffmpeg

5) Convert the mp4 video into a GIF file using Gifify

This uses a lot of RAM, even for smallish video files.

Example: convert a file called video.mp4 to video.gif

There's all sorts of options to control the frame-rate and other things too.

$ gifify video.mp4 -o video.gif

meta-capturing Gifify being used to turn an MP4 screencast into a GIF file


1: NPM stands for Node Package Manager. It's used to manage dependencies for NodeJS. You can install it on Ubuntu with $ sudo apt install npm

2: You can also stop the recording typing Super + Ctrl + f. P.S.: Super is the Windows logo key.


References

Dialogue & Discussion