Record OS X screen activity to a Flash movie

Oct 01, '04 11:12:00AM

Contributed by: huskerchad

The vnc2swf program allows you to record a VNC session to a Flash animation file. If you don't know what VNC is, learn about a free Mac implementation of it at the OSXvnc website. You can use the vnc2swf program to record a VNC session on a remote computer, but you can also use it to record actions on your own local computer. You can run vnc2swf (the recorder) on Mac OS X or Linux, and you can even get it running on Windows with the cygwin environment.

Instructions for setting it all up are at the end of this message, but here is the basic usage. To record actions from your local computer, start X11 and start the vnc server with the OSXvnc program. In a Terminal, type the command vnc2swf -nowindow -startrecording output.swf localhost:0. Now just perform the actions you want to record. When done, return to the Terminal and type control-C to end. You can play the resulting Flash file in QuickTime, or in any web browser that has the Flash plugin.

Some tips:

  1. You may be wondering why X11 is necessary. It is because vnc2swf is actually an X11 viewer for vnc sessions, and even with the -nowindow option, it still requires X11 to work. You are still able to record all of your display (Aqua programs), not just X11 programs. It should be possible to modify it so that it doesn't need X11 if you don't want a window, but I haven't looked at the source.
  2. For best performance, lower your screen resolution for the purpose of recording the file.
  3. If you want to record a VNC session that is being served from a remote computer, remove the -nowindow option.

Instructions for setting it all up:
Get OSXvnc as described above. You will also need to install Apple's X11, the Developer Tools, and the X11 Developer SDK. All of these are available on the Panther CDs (or perhaps inside your /Applications -> Installers directory if Panther came pre-installed). I have not tested with OS X versions below 10.3, but I don't see why it wouldn't work. It should also work with X11 from other sources than Apple.

You need to compile the ming library, which is for creating Flash files. Download it at this location. Users who have Fink installed can save this step by running the command fink install ming. If you want to compile it yourself, do the following steps in Terminal.app:

  1. Change to the directory where you downloaded the .tgz file and type tar xzf ming-0.2a.tgz
  2. Change to the newly-unpacked directory: cd ming-0.2a
  3. You will, unfortunately, need to modify one of the files in the ming distribution. With a text editor, open the file src/ming.c. About four lines into the file, you will see this line:
    extern int SWF_gNumCharacters;
    Modify this line to read:
    int SWF_gNumCharacters;
    That is, simply remove the extern modifier from the line. Save the file.
  4. Compile the static library with make static
  5. (You need to be root or use sudo for this step):
    $ make install-static
    $ make install-common
    
    This installs the ming library that you need (the static version is used because it compiles with fewer modification on Mac OS X than the shared version).
Now go to the vnc2swf website and download the source for the program; currently the version is 0.4.2. NOTE: There has been a precompiled version available for Mac OS X, but that did not work for me (the colors were wrong). The steps to compile and install are:

  1. Change to the directory where you downloaded the file.
  2. Type tar xzf vnc2swf-0.4.2.tar.gz
  3. Type cd vnc2swf-0.4.2
  4. Type ./configure or, if you used fink to install ming, type ./configure --with-ming=/sw
  5. Compile with the command make
  6. Install with the command (as root, or with sudo): make install
That's it!

Comments (11)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040927150651484