How to record and playback an X11 session
A. get vncrec to work
download vncrec sources from http://www.sodan.org/~penny/vncrec/
- apt-get install xlibs-dev libxaw7-dev
- build vncrec; it won't make it, but it'll make it to build vncrec. Build instructions are in the README: xmkmf; make World
- copy /vncrec-0.2/vncrec/vncrec to /usr/local/bin
B. install x11vnc
- apt-get install x11vnc
- x11vnc -viewonly -localhost
C. record things
- vncrec -record /bigpartitionwithfreespace/session.vnc
- iconise the window ASAP
- vncrec -play test.vnc
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:
- I had the same problem some time ago, but I managed to solve it. What I did was:
patch transcode (see attached patch), to make its xpm input faster (by a lot), and to accept xpm files with more colours. I still have to clean up the patch and submit it upstream sometime.
- start a vncserver with the same colour depth as the one used to record. I had to do this to make vncrec produce correct xpm files.
run transcode. I used the following command line (to produce a dvd compatible mpeg2 stream). The vnc-provided X server is :2 DISPLAY=:2 transcode --use_rgb --dvd_access_delay 30 -i vncrecord.vnc -Z 720x576 -y mpeg2enc -F 8 -o mpegfile
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.
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.