I've seen animated GIF images of screen casts (like the one below) promoted a few times on this site as a way to improve answers.
What toolchain is being used to create these? Is there a program that does this automagically, or are people taking screencasts, converting them into a series of static frames, and then creating the GIF images?
Peek
Is a new application that lets you easily record GIF's from your screen.
Anyway, keep in mind that GIF's have a very limited color palette so it's not a very good idea to use them.
Since Ubuntu 18.10 you can install Peek directly.
For older versions of Ubuntu, you can install the latest versions of Peek from its PPA.
Find more information in the GitHub repo.
Byzanz
Best software I ever found to record GIF screencasts is Byzanz.
Byzanz is great because it records directly to GIF, the quality and FPS is impressive while maintaining the size of the files to a minimal.
Installation
Byzanz is now available from the universe repository:
Usage
When it is installed you can run it in a terminal.
This is a small example I did just now with
First install this:
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:
Use ImageMagick to convert the screenshots into an animated gifs.
you can optimize the screenshots this way:
byzanz
Overview
This answer contains three shell scripts:
byzanz-record-window
- To select a window for recording.byzanz-record-region
- To select a part of the screen for recording.Introduction
Thanks Bruno Pereira for introducing me to
byzanz
! It's quite useful for creating GIF animations. The colours may be off in some cases, but the file size makes up for it. Example: 40 seconds, 3.7Mb.Usage
Save one/all of the following two scripts in a folder within your
$PATH
. Here's an example on using the first script to make a screencast of a specific window.byzanz-record-window 30 -c output.gif
$DELAY
), in which you prepare for recording.beep
function),byzanz
will start.30
in step 1),byzanz
ends. A beep will be broadcast again.I included the
-c
flag inbyzanz-record-window
to illustrate that any arguments to my shell script are appended tobyzanz-record
itself. The-c
flag tellsbyzanz
to also include the cursor in the screencast.See
man byzanz-record
orbyzanz-record --help
for more details.byzanz-record-window
byzanz-record-region
Dependency:
xrectsel
from xrectsel. Clone the repository and runmake
to get the executable. (If it protests there is no makefile, run./bootstrap
and the./configure
before running `make).Gui version of
byzanz-record-window
Script with a simple GUI dialogue:
See also:
byzanz-record-region
.ffmpeg (install)
One of the best tools I use is
ffmpeg
. It can take most video from a screencast tool such askazam
and convert it to another format.Install this from software-center - it is automatically installed if you install the excellent
ubuntu-restricted-extras
package.Kazam can output in the video formats
mp4
orwebm
. Generally you get better results outputting inmp4
format.Example GIF making syntax
The basic syntax to convert video to gif is:
GIFs converted - especially those with a standard 25/29 frame-per-second can be very large. For example - a 800Kb webm 15-second video at 25fps can output to 435 MB!
You can reduce this by a number of methods:
Framerate
Use the option
-r [frame-per-second]
. For exampleSize reduced from 435 MB to 19 MB
File-size limit
Use the option
-fs [filesize]
. For exampleNote: This is an approximate output file size so the size can be slightly bigger than specified.
Size of output video
Use the option
-s [widthxheight]
. For exampleThis reduced the example 1366x768 video size down to 26 MB
Loop forever
Sometimes you might want the GIF to loop forever.
Use the option
-loop_output 0
. For exampleFurther optimise and shrink
If you use
imagemagick
convert
with a fuzz factor between 3% and 10% then you can dramatically reduce the image sizeFinally
Combine some of these options to reduce to something manageable for Ask Ubuntu.
Followed by
Example
Silentcast
Silentcast is another great gui based tool for creating animated .gif images. Its features include:
4 recording modes:
Entire screen
Inside window
Window with decoration
Custom selection
3 output formats:
.gif
.mp4
.webm
.png
(frames).mkv
No installation necessary (portable)
Custom working directory
Custom fps
Installation
If you want a regular installation and are running a supported version of Ubuntu you can install Silentcast by PPA:
If you aren't running a supported version of Ubuntu (you should really upgrade!) you will need to download the latest version from the GitHub page and manually satisfy the dependencies (you can procure yad and ffmpeg from here and here respectively) or, if you are running a slightly more recent version such as 13.10 you could try downloading the .deb directly.
If you're using Gnome you might want to install the Topicons extension to make stopping Silentcast easier.
Usage
Start Silentcast from your desktop environment's gui or run the
silentcast
command in a terminal. Pick your settings and follow the on-screen prompts. When you're done recording you will be presented with a dialog for optimizing the final output by removing a certain number of frames.For more in depth usage guidelines take a look at the README, either the online GitHub version or the local version stored in
/usr/share/doc/silentcast
with zless or your favourite editor.Notes:
Silentcast is still in the development stage and although it is quite stable you might encounter some bugs. If you do please report them on the project's GitHub issues tracker. If you have trouble installing from the PPA and are running a supported version of Ubuntu leave a comment below or contact the maintainer (me) on Launchpad.
There are all sorts of complicated and well-working (presumably) ways to do this listed here. However, I've never wanted to go through that process before nor since. So, I simply use an online converter which suits my needs the few times I need to do so. I've used this site:
http://ezgif.com/video-to-gif
It's not my site and I'm not affiliated with them in any way. They're just the one in my bookmarks and there are many more.
I created
record-gif.sh
, an improved version of Rob W'sbyzanz-record-region
:duration
;save_as
destination ;$HOME/record.again
).Install
I also created an installation script
imagemagick
mplayer
gtk-recordmydesktop
ogv2gif.sh
from https://github.com/nicolas-raoul/ogv2gif./ogv2gif.sh yourscreencast.ogv
100% inspired from maniat1k's answer.
Ok, so in order to also capture mouse clicks, the only thing I found was
key-mon
(via the README ofscreenkey
):https://code.google.com/archive/p/key-monhttps://github.com/critiqjo/key-monsudo apt-get install key-mon
Then I:
key-mon
xrectsel
to get the screen coordinates put into abyzanz
commandbyzanz
command... and it looks sort of like this:
Note that
key-mon --visible_click
would draw a circle around the mouse pointer upon mouse click - which I would prefer, but in Ubuntu 14.04.5 LTS this is somewhat broken, as this circle does not appear and disappear fast enough in order to correctly illustrate the clicks (i.e. mouse presses and releases).