Skip to content

Instantly share code, notes, and snippets.

@mikeholler
Created February 10, 2014 00:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeholler/8908386 to your computer and use it in GitHub Desktop.
Save mikeholler/8908386 to your computer and use it in GitHub Desktop.
Create a screen cast GIF in Ubuntu.

First install this:

sudo apt-get install imagemagick mplayer gtk-recordmydesktop

those are the required stuff, ImageMagick, MPlayer and Desktop Recorder. Then use Desktop Recorder to capture a portion of the screen/application to use as the screencast. After the Desktop Recorder has saved the recording into an OGV video, MPlayer will be used to capture JPEG screenshots, saving them into the 'output' directory.

On a terminal:

mplayer -ao null <video file name> -vo jpeg:outdir=output

Use ImageMagick to convert the screenshots into an animated gifs.

convert output/* output.gif

you can optimize the screenshots this way:

convert output.gif -fuzz 10% -layers Optimize optimised.gif

From http://askubuntu.com/questions/107726/how-to-create-animated-gif-images-of-a-screencast/107735#107735

#!/bin/bash
in=$1
out=$2
mplayer -really-quiet -ao null $in -vo jpeg:outdir=.output 2>&1 /dev/null
convert .output/* .output-unoptimized.gif
convert .output-unoptimized.gif -fuzz 10% -layers Optimize $out
rm -rf .output/ .output-unoptimized.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment