Screen Capturing and Playback Using VNC

Brian de Alwis

This document describes how to do screen-capturing using VNC. This is a free alternative to using systems such as TechSmith's Camtasia. This method is not for the faint of heart: be aware that it requires some knowledge of VNC, Unix, and the ability to compile your own software. But the resulting files are much smaller and portable.

Ingredients

You'll need:

Procedure

The general procedure is split into two parts: the screen capturing, and the transcoding of the captured stream.

Screen Capturing

  1. Start the VNC server on the machine to be monitored. See your distribution's instructions.
  2. Then invoke vncrec to record the stream; this can be done on an entirely different machine:
    $ vncrec -record file.vnc :0
    
    vncrec will display a buffer of the monitored session -- you can minimize this, if you don't want it.
  3. If you are simulataneously video-taping the subject, I highly suggest you make a synchronization mark for later correlation. One way is to have the subject type several exclamation marks in a visible part of the screen while screaming on tape.
  4. Once finished, stop the server; vncrec will quit, leaving the file.vnc log file.

Transcoding the Captured Stream

The VNC stream can be played back using vncrec's -play option, but this doesn't allow cueing to specific locations. So we instead use transcode, a video-to-video conversion tool and which provides a vncrec import plugin, to convert it to a seekable video format.

The following invokation of transcode uses the Xvid.org codec:

$ transcode -x vnc -y xvid -i file.vnc -o file.avi -z -k

You may need to use transcode's --dvd_access_delay switch: this provides a timeout to wait for vncrec, which can sometimes take a while to start up. I've generally just used `30' for 30 seconds.

There is one small problem when transcoding on a machine with a different video depth (number of bits per pixel) from that which was used for recording. This is possibly because vncrec records the screen capture using the video mode of the capturing machine. Fortunately Xvnc can be used to set up an X server with the same depth as the original as follows:

$ Xvnc :1 -once -depth 16 -geometry 1600x1200 &
$ DISPLAY=:1 transcode -i vnc ...

Remember to kill the Xvnc server afterwards.

Be warned that the transcoding can take a while, especially when you have big videos. You can try to reduce this by using a lower framerate with transcode's -fps switch.

Playing the Videos

If you are using a Unix based system, simply install MPlayer or some other video player (Xine?).

Windows Note: All MPEG-4 encoded videos will require a separate MPEG4 codec to be installed. I had success using FFDSHOW on Windows ME with Windows Media Player. If you need to play your file on other OSs, you might want to try using other codecs. I cannot provide advice -- I haven't tried any others. You might also try other transcode-supported encodings, such as af6, dv, mov.

Advice


Last updated: 2004/10/31 (scary!)
Brian de Alwis / bsd@cs.ubc.ca