Flawless screen recording on Ubuntu, headlessFlawless screen recording on Ubuntu, headless

For reasons I’m not quite ready to disclose, I’ve become interested in making the sort of screen recordings that have served Ruby on Rails so well.

Update: My project is Databinder. No screen recs yet, not quite ready for its close-up.

Update 2: Close-up accomplished.

A screen recorder is the kind of software you don’t expect to cost anything—but the people who make recorders have other ideas. The only one I’ve heard of since Lotus ScreenCam (the pioneer in this boring domain) is Snapz Pro. It’s also probably what was used for the RoR movies. It costs $70. Hmm.

Screen recorder requirements

  1. Work with a Gnome session on a headless Ubuntu box.
  2. Capture clear video that looks like the original session.
  3. Be free or cheap.

There is a simple screen recorder called Istanbul that one-click-installs through Synaptic, but you get what you work for with that one. Istanbul’s recordings, saved in Ogg video format, are smudged and unappealing. And with a headless box you don’t even get that because it depends on a framebuffer for capture. Ixxxx-nay.

Moving on, I thought, “Perhaps there’s some good capture freeware for my iMac so I can just rip the NoMachine client window?” Nope. And that method would be pretty lame anyway since it involves “capturing” the video several times over. Ideally, I could just intercept the NX stream, but there doesn’t seem to be anything like that. Of course, NX isn’t the only game in town…

It turns out there is a very good recorder for VNC, vnc2swf. The only problem here is that Ubuntu’s built in VNC server (Remote Desktop) doesn’t work headless, and I’d never pursued alternatives since freenx is so badass.

Headless VNC

For headless you need the “vncserver” package. It manages its own X sessions and broadcasts them over VNC, as many sessions as you want. Unfortunately the default install is a little broken, but it’s easy to fix. Go into /usr/X11R6/lib/X11/ and delete or move the fonts directory. Then, put a softlink to /usr/share/X11/fonts/ in its place.

[Or, run a command like vncserver -fp /usr/share/X11/fonts/X11/misc/ The target font directory should have hundreds of files in it.]

Everything happens in ~/.vnc/. Try to run vncserver and it will create that directory and set up a password. When a server is running, you’ll find a .pid file in the directory. To stop server 1, run “vncserver -kill :1”. Ok. Start a server, and note the port; it should be 5901 for screen 1. Connect to it (Chicken of the VNC rules the roost on Mac) and play… you’re almost done!

Record it

Stop your VNC server, then start it with “vncserver -alwaysshared -depth 16”. You need to share it with the recorder, and of course you’ll want 16 bit color. Install the “python-pygame” package through Synaptic, then download the python version of vnc2swf. Unless you can’t spare the CPU cycles, run it on the same server you’re recording. If an X session is available it will start up with a simple interface. Connect. Record. Rejoice.

The flash format is surprisingly apt for these recordings. I tried converting some samples to h.264 in QuickTime and they only degraded in quality and bloated in size. Still, that might be handy for Google video. Gosh, I’m so excited about this surprise project, it’s like CHRISTMAS.

Anyway, check out this pristine sample recording.


AWESOME, loved the quality and crispness of the recording, thank you for the ‘tutorial’, this will work wonders for a site i was thinkin bout running for Linux newbies (aka: co-workers and fellow students at the JC)..

Sure, glad you found it useful. This might be good too for bug reports, promoting linux, and who knows what else…

What is the Internet Explorer-like icon on the flash demo desktop?

It is Internet Explorer. I wrote about “setting that up”:/n8/articles/2005/11/05/windows-internet-explorer-on-mac-via-linux-wine too.

I find a freeware called wink, have a try? http://www.debugmode.com/wink/

wink is really good , thanks

Add a comment