Translation(s): English - Português (Brasil)

How to record and playback an X11 session

A. get vncrec to work

  1. download vncrec sources from http://www.sodan.org/~penny/vncrec/

  2. apt-get install xlibs-dev libxaw7-dev
  3. build vncrec; it won't make it, but it'll make it to build vncrec. Build instructions are in the README: xmkmf; make World
  4. copy /vncrec-0.2/vncrec/vncrec to /usr/local/bin

B. install x11vnc

  1. apt-get install x11vnc
  2. x11vnc -viewonly -localhost

C. record things

  1. vncrec -record /bigpartitionwithfreespace/session.vnc
  2. iconise the window ASAP

D. playback

  1. vncrec -play test.vnc

E. encoding

There are two ways: one is using vncrec to generate frames as single images and then reencode them.

Note that a newer mencoder wants the files specified differently. This worked for me: mencoder "mf://*.png" -fps 10 -o output.avi -ovc divx4

In my case, however this would not work, as mogrify would complain that the XPM files had an invalid header.

Another option is to use transcode, but in my case it did not work: either transcode would quit right away, or it would get stuck.

Frank Gevaerts mailed me this solution:

F. alternative ways

One alternative way is Istambul, which I tried, but it's so resource-hungry that doesn't leave me anything left to actually do my presentation. People who've done it suggesting reducing the frame until the load gets acceptable (Marcus Bauer reported that 10 frames per second should work acceptably on an AMD 2600Mhz laptop). When Istambul works, it's good because the output is directly usable as a video file; however, p2-mate observes that OGG Theora does inter-frame compression and is thus not a good format if you need to do some post-processing.

Another way is Recording to SWF with vn2swf. I have not tried this. SWF is cute in that it can be put directly in a web page, but as a file format it's evil. It would be nice if it worked with free SWF players.

As of bullseye-backports and bookworm zoneminder 1.36+ has vnc recording capability, however installation and usage is non trivial so it is not a good solution for a quick fix. On the other hand it is useful for recording 24/7 or on a schedule, and can store a lot of recordings. This is surveillance software so it is geared towards that audience. See wiki.zoneminder.com/LibVNC

G. miscellanea

Marcus Bauer reports having seen a nice little tool which shows in a little window the mouse buttons you have pressed, which gives a nice visual feedback if you use the right button.

Another tool useful for highlighting things is gromit, and it's already part of Debian.


Enrico Zini


CategoryNetwork CategorySoftware