Desktop multimedia capture with X11
From FBSD_tips
Or how to make a screencast in Xwindows
Contents |
[edit] Rationale
If a picture is worth 1000 words, a moving picture is worth a million. Motion desktop screen capture with voice over (live or dubbed) has gone from an advanced tool to a mainstream and expected feature essential to doing business on the internet. Here I will cover the steps to accomplish this on FreeBSD using Xvidcap from ports.
[edit] Setup
Install xvidcap from ports or packages, it has a rather lengthy dependancy list (X11, basically). It uses on X11 shared memory for high frame rates (but can also use X11 protocol if it is not available). Check for it like this :
> xdpyinfo | grep -i shm MIT-SHM
I found in testing that the stock shared memory level in FBSD was inadequate when capturing screen larger than a couple hudred pixels by a couple hundred pixels. To rectify this you need to increase the amount of shared memory available with either sysctl :
sysctl kern.ipc.shmall=262144
Or in the /boot/loader.conf
kern.ipc.shmall=262144
[edit] Using
When you run xvidcap from the command line you will see thins window and floating red frame appear :
The main menu is accessable by RIGHT clicking the area with the file name in it to the left of the main window, you should see this :
The preferences window i where youwill set up the parameters for the capture :
Go to the multi-Frame tab. Make sure that the name of the file matches the container file format and codec. Avi is the default format and xvidcap seems more stable with this type. Lower tyhe frame rate as much as 1) the codec will allow and 2) still maintains sufficient quality. 7.5 is the lowest I have gotten the avi codec to go, and with regards to run of the mill X apps, this is more than good enough. Make sure that audio capture is enabled if you plan to record an audio track live (as opposed to doing it afterwards, or in 'post prduction'). If you want these settings saved for subsequent runs go to the main menu again and select 'save preferences'.
The array of control buttons to the right are : 1) stop 2) pause 3) record 4) Forwrd 5) go to previous movie 6) go to next moovie 7) detatch the red selection fraome from the control window 8) Select the capture area 9) edit the current movie.
If you are recording voice over, plug in your mic and make sure that the sound system is registering level, you could use an application like audacity to check that you have levels.
To run a capture click the lock to detach the red selection frame, then click the dropper icon and clickon a window you want to capture. The red frame should be on this ne wwindow now, you are ready to record your session.
Here is a short demo :
Demo Konsole session
[edit] Discussion
When you capture, you really want to do everything you can to keep the cpu usage down, when it rises (there is a meter in the GUI) into the red, frames start getting dropped. This causes speed up on the playback and audio artifacts as well (it is likely not a multi threaded capture).
Here are some other softwares that accomplish similar feats on other platforms.
- Windows
- FRAPS specializes in high frame rate capture, e.g. for games.
- Camtasia Studio completescreencast authoring tool set.
- Camstudio A free and open source capture tool.
- OS X
Gongo 04:44, 1 January 2008 (UTC)



