Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to do an animated gif file. Thus I need all images and then I can build the gif file with gimp or convert.

But in order to obtain the images how can I do a set of successive screenshots ? What I would like to record is a vibration movement of a molecule or a crystal (using jmol or j-ice).

Actually, I want to do a screencast ...

share|improve this question
Why don't you use a screencast tool instead? cut the clip and that's it, far better quality than a gif. – Uri Herrera Sep 6 '12 at 20:14
In addition to @UriHerrera's comment: if you insist to make a gif from images, you can extract the proper jpg frames from the screencast by using the ffmpeg tool, as mentioned here: – Geppettvs D'Constanzo Sep 7 '12 at 2:52
Can you advice a simple tools in order to make a screencast ? please – Ger Sep 7 '12 at 6:35 should cover that. – Steve Kroon Sep 7 '12 at 7:49

How to create an animated (GIF) screenshot

(Cross-posted from my answer here.)

Added bonus with this approach is that you can post the screencast without embed tags on any forum that includes animated GIFs as embedded like this

The answers prior to mine have clearly answered how to create a video screencast. Now if you just want to show an animated screenshot, essentially an extremely short screencast in an image format (GIF, and not more than ~10 sec), it's also easy.

First create a screencast of what you want to show in the animated GIF. Then follow the instructions below...

You'll need Gimp, mplayer (WARNING! NOT mplayer2) and mencoder. Issue the following commands to install them.

sudo apt-get install gimp
sudo apt-get install mplayer
sudo apt-get install mencoder
sudo apt-get -f install

Alternatively, you can install them from the Synaptic package manager that comes with Ubuntu.

The following command breaks your screencast into a number of jpeg or png (based on which command you choose) images:

mplayer -ao null -ss 0:0:33 -endpos 2 eagles.avi -vo jpeg:outdir=Desktop/animated
mplayer -ao null -ss 0:0:33 -endpos 2 eagles.avi -vo png:z=9:outdir=Desktop/animated

Where, -ss 0:0:33 tells mplayer where you begin (0 hours, 0 minutes, 33 seconds), -endpos 2 tells mplayer where to stop (2 minutes), z=9 sets compression level for the output png images to 9, Desktop/animated is the directory (~/Desktop/animated/) where you want the images to be output to.

You can also tell mplayer where to stop, as a specific time, like so:

mplayer -ao null -ss 0:0:33 -endpos 0:1:12 eagles.avi -vo jpeg:outdir=Desktop/animated
mplayer -ao null -ss 0:0:33 -endpos 0:1:12 eagles.avi -vo png:z=9:outdir=Desktop/animated

Now you have the images, but you need to combine them into a single, animated GIF. This is really simple:

  • Start Gimp > File > Open as Layers > browse to the directory (~/Desktop/animated/), Ctrl+A to select all images, and click 'Open'.

  • Simple hit Shift+Ctrl+S or go to File > Save As... and name the image as 'animated.gif' > hit 'Save' > check 'Save as Animation' radio button > hit 'Export' > in the next window, simply hit 'Save' unless you know what you are doing.

That's it. You have your animated GIF ready!

Here's an example:

Animated GIF screenshot

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.