HOWTO: Record or Capture your desktop in Linux as a video
Purpose: This blog entry will explain how to record/capture your desktop activities and store it as a video to view it later using the package recordmydesktop. This blog entry is a follow-up from my last post which explained how to record your console/shell terminal session as a typescript. There are many useful things you can do by recording your desktop activities:
1. Troubleshooting some problem so that you can refer it back later.
2. To create video tutorials – HOWTO
and many more…
Assumption: I have assumed that you are running a Debian (Lenny) or either a Debian-based distro like Ubuntu. In general you should be able to do this with any Linux distribution provided you obtain the package recordmydesktop either from your distro repositories o build it from source.
Note: If you are using current stable version of Debian i.e. Etch you won’t find this package.
Step 1:Install GNOME (or KDE)
Althought I think you can do this without GNOME or KDE but for better results it is a good idea to have either one of them. I like GNOME so I will go with it.
# apt-get install gnome xserver-xorg xfonts-base gdm
Step 2: Install my myrecorddesktop
Now we need to install the package
#apt-get install recordmydesktop
Step 3: Start recording your activity
From your home directory (mine is /root) give the following command:
debian:~# recordmydesktop
and you should be able to see output like this:
Initial recording window is set to:
X:0 Y:0 Width:1024 Height:768
Adjusted recording window is set to:
X:0 Y:0 Width:1024 Height:768
Your window manager appears to be Metacity
Initializing...
Buffer size adjusted to 4096 from 4096 frames.
Opened PCM device hw:0,0
Recording on device hw:0,0 is set to:
2 channels at 22050Hz
Capturing!
At this point of time your recording as started as suggested by the word “Capturing”. Now do whatever you want to do and record it. Once you are done just hit Ctrl-C to kill the recording and you will see something like this:
^C
*********************************************
Cached 16 MB, from 888 MB that were received.
Average cache compression ratio: 1 %
*********************************************
Saved 296 frames in a total of 296 requests
Shutting down.....
STATE:ENCODING
Encoding started!
This may take several minutes.
Pressing Ctrl-C will cancel the procedure (resuming will not be possible, but
any portion of the video, which is already encoded won't be deleted).
Please wait...
[104%]
Encoding finished!
Wait a moment please...
Done.
Written 2736469 bytes
(2448942 of which were video data and 287527 audio data)
Cleanning up cache...
Done!!!
Goodbye!
debian:~#
Step 4: Play your recorded video
Your video file will be stored in the directory from which you gave the “recordmydesktop” command. In this case it will be in the ‘/root’ directory with file name ‘out.ogv’
debian:~# ls
debian-work gen_test_info.sh Music real-time Templates
Desktop hackbench out.ogv start_load.sh Videos
debian:~#
To play the video you need a media player which supports “.ogv” file format. I like ‘VLC’ media player.
# apt-get install vlc
Next just go to Applications->Sound & Video-> VLC media player->File->Quick Open File
and browse to the video file and hit play.
Just enjoy your recorded video! :)
I have uploaded a sample video file here that I recorded while writing this blog entry.


Email Subscription









February 25th, 2009 at 1:48 pm
you shouldn’t be telling to run applications as root unless absolutely required.
Reply to this comment
TheDude Reply:
October 12th, 2012 at 3:55 pm
nikhil, Good practice is to use sudo, no doubt.
Also lunching a program while being a root, ouch.. (was an “exit” command too much to type for an editor since he took a # route?)
Reply to this comment
January 2nd, 2010 at 8:37 am
Title…
Very insightful post. I am going to link to it in my new blog….
March 8th, 2011 at 12:34 am
[...] Link LikeBe the first to like this post. [...]
May 6th, 2011 at 9:32 am
“Althought I think you can do this without GNOME or KDE but for better results it is a good idea to have either one of them. ”
Why?
You’ll get better results without the bloat. Seriously.
Reply to this comment