After my post about capturing full page screenshots with firefox I started wondering if there was a way to do screencasts using Linux. It just so happens that you can. There are a couple different options if you want a pure movie of your desktop but I was more interested in a flash version. I found what I was looking for with this tutorial on how to record videos of your desktop that uses vnc2swf.
I tried the instructions on a fedora core 5 box and found that vnc2swf requires tkinter and pygame be installed but they are both packages that are easy to install with yum. You will also need some type of vnc server running on your box. If you want to do a screencast of your current desktop you will need to use x11vnc. It will allow you to let a vnc viewer connect to your current desktop. I found that using x11vnc didn't work that well. I'm not sure if it was the desktop I was using or what but the screencasts came out very choppy and for the most part unusable. I switched to using vncserver with a lightweight window manager and that fixed the issue. I think I like doing that better anyway because it gives me a fresh desktop to work from without all the normal extras. When you are doing a screencast it probably makes more sense to have less to look at anyway.
- Start the vnc server (here I set the size too): vncserver :1 -geometry 640×480
- Then you will want to start the viewer: vncviewer :1
- Start the recorder: python vnc2swf.py -t video -o test.swf :1
- Select a filename to save the screencast as
- Select SWF(Video) from the dropdown on the left
- Hit start and make your screencast using the viewer
Here is an example of the final product:
You may also only want to capture one window of your desktop. To do that you will need to run xwininfo in you vnc session and click on the window you want to capture. After clicking the window xwininfo will return the location of that window in absolute terms as well as the width and height of the window. With that information you add -C widthxheight+x+y to the recording command. For example the xterm in my previous example is at 11×29 on the screen and is 517 wide and 355 tall so the command would be:
python vnc2swf.py -t video -o test2.swf -C 517×355+11+29 :1
And that produces this:
There are a couple other utilities that come with the package. One is a player that you can use to play your screencast and the other is an editor. The editor lets you remove frames, change the framerate and shrink the screencast .I found that shrinking the screencast was mostly useless since it became unreadable quickly.