Creating training movies with VNC2SWF

Posted by Steve on Tue 11 Oct 2005 at 05:26

Shockwave flash can be used for a lot of different things, from annoying web adverts to simple games. One interesting use for it is displaying movies. Movies you can record yourself by capturing on-screen activities. This is ideal for creating simple tutorials.

Using the vnc2swf tool you can record your interactions with a desktop, or single window, and share them to other people.

(We've previously introduced VNC, the Virtual Network Computer, so I'll only discuss the absolute minimum you need to get working here.)

To create your own movie you need two things:

Optionally you'll need something that can create MP3 files to add audio to your movies. (If you wish to add audio I'd recommend you examine the audacity package)

Getting vnc2swf

vnc2swf isn't contained inside the Debian repository yet, so for the moment you must download it from the internet. You can find the current release here:

Download the python version of the software, (currently this is pyvnc2swf-0.6.4.tar.gz), and unpack it:

wget http://www.unixuser.org/~euske/vnc2swf/pyvnc2swf-0.6.4.tar.gz
tar -pzxvf pyvnc2swf-0.6.4.tar.gz
cd pyvnc2swf-0.6.4/

As the software is written in the Python scripting language there is no need to compile anything, you just need to have the relevent Python libraries installed upon your host.

To make this package work upon a Debian system you'll need to install python-tk, and python-pygame packages, which you can do with this command:

apt-get install python2.3-pygame python2.3-tk

Once that has been done you're ready to move on to the VNC server setup.

VNC Server Setup

For the VNC server I'm going to recommend you use the x11vnc package. This package allows you to create a VNC server sharing either your whole desktop, or just a single window. The latter is ideal for creating a simple training video.

Install the package with the following command, as root:

apt-get install x11vnc

If you wish to create a movie of your complete desktop you can run it as follows:

x11vnc -localhost -viewonly &

If you'd rather share a single window run:

x11vnc -localhost -viewonly -id pick &

This will allow you to click upon the window you wish to share with your mouse - after you have done so your selected window will be shared and made available.

Make Your Movie

Now that you have a running VNC server upon your local host you can create the movie. To do so execute:

./vnc2swf.py -nowindow -o myoutput.swf localhost

This will immediately connect to the VNC server you have running upon the localhost, and start recording a movie of anything that happens to that window. The output will be sent to myoutput.swf - and a HTML file will also be created called myoutput.html.

Load the output.html file into your browser and enjoy your movie!

Adding Sound

If you have an appropriate MP3 file you can add it to your movie file as follows:

./edit.py -a mymovie.mp3 -o output-with-audio.swf output.swf

Here we add the audio file mymovie.mp3 to the file we've just created (output.swf) and save the combined movie as output-with-audio.swf.

Sample Movie

This article wouldn't be complete without a sample. So here it is.

*shudder*


This article can be found online at the Debian Administration website at the following bookmarkable URL (along with associated comments):

This article is copyright 2005 Steve - please ask for permission to republish or translate.