Create GIF Image From Video File.

Creating GIF Image from video file is quite simple.

What we will do ?
We will use screencast application like Kazam to record the on-desktop video. Then we'll use mPlayer to capture the jpeg screenshots & then finally we gonna use Imagemagick to convert those jpeg images in GIF.

Tools Required :
- Any Screencast application (I prefer Kazam)
- mPlayer
- ImageMagick
- Linux based distro

Steps :
1) Install required tools[kazam, mplayer, Imagemagick] using apt-get (Debian/Ubuntu), zypper (Suse), pacman (Arch), yum (Fedora) ,etc..

2) Record the screencast & save it in directory (We'll use 'Videos' for simplicity)

3) Open Terminal & type :
mplayer -ao null  -vo jpeg:outdir=mygif
4) Here we have used output directory as 'mygif' so a folder named 'mygif' will be created which will contain jpeg image of each & every frame of the screencast. Now, we will use those jpegs to convert it into gif.
- Open Terminal & type :
convert /* 
Example :
convert mygif/* mygif.gif
- Have patience, it will take couple of minutes in transcoding

5) You can optimise the gif & reduce the file size using 'gifscale'
Open terminal & type :
gifscale -O  -o 
Example :
gifscale -O mygif.gif -o myoptimgif.gif
That's it 👍


  • Kaustubh Katdare
    Kaustubh Katdare
    This convert thing is inbuilt into linux or you get it with mplayer?
  • Abhishek Rawal
    Abhishek Rawal
    Kaustubh Katdare
    This convert thing is inbuilt into linux or you get it with mplayer?
    Create video using Kazam.
    mplayer converts video into jpeg screenshots of each frame.
    Imagemagick converts those jpeg into gif.

    It's done using combination of three tools which are easily available in all distribution's repo.

You are reading an archived discussion.

Related Posts

Buying New Laptop from a bouquet of available brands is always a critical decision to make. Suggest me a good laptop up to Rs.50,000...
While discussing advantages and disadvantages of Air-coolers vs. the air-conditioners; I began thinking about possibilities of having temperature control in air-coolers. Currently, there's no way to control the temperature of...
Hi friends.. Can any one tell me how to integrate single phase transformer into balanced radial distribution system??
Engineers at the University of Washington have created world's thinnest LED (light emitting diode), that's just 3 atoms thick! Though thin, the new LED is mechanically very strong and can...
Robert Barker submitted a new project: LILA - Leave it Locked, Always by QL London - LILA is a sleek & simple to use system, which gives you the reassurance...