by Girish Venkatachalam
Girish Venkatachalam is a UNIX hacker with more than a decade of
networking and crypto programming experience.
His hobbies include yoga,cycling, cooking and he runs his own
business. Details here:
Creating video tutorials is a novel method of web based tutoring.
Nowadays right from product demos for marketing/sales to technical
talks, everything is found in youtube.
Videos are a powerful medium to get your idea across and your audience
can quickly understand what you are trying to convey when they see a
video. Audio is not always necessary though it helps too.
The other thing you could do is add sub titles to the video to reinforce
what you are trying to say. Or you could give you the user a subtitles
file which they can turn on and off along with the video. I am going to
talk about how we can do all this and more with open source tools.
Creating videos from Xwindow windows can be done in many ways. There are
also ways to capture text console outputs when you are not running X.
There is a program called ttyrec that helps you
achieve that. You could of course use our good old script(1) program
too. But ttyrec records in such a way that you can play back keystrokes
Moreover once you create the video, you can edit them with mencoder, the
companion program of mplayer. I have been most successful with the
screencapture mechanism offered by ffmpeg as it is painless and simple. A
simple command line
$ ffmpeg -f oss -i /dev/audio -f x11grab -y -r 60 -s sxga -i :0.0 -async
0 -vsync 0 -sameq $screencapture.avi
is all you need!
Note that this one records audio from /dev/audio which is not found
under linux. You should use /dev/dsp instead. In case you don't want to
record your voice then you can leave the -f and the -i switch
Then the command becomes
$ ffmpeg -f x11grab -y -r 60 -s sxga -i :0.0 -async
0 -vsync 0 -sameq $screencapture.avi
Then it will be a mute video showing only the keyboard,
mouse and Xwindow screens. A very simple and easy affair.
A sample video is here. It is
incredibly easy. Try it out.
At the same time, there are plenty of alternatives which I honestly did
not like or I was too impatient to get my work done. So I wanted
something that quickly worked without having to spend lot of time
debugging. Even now I have a slight A/V sync problem with the above
command line. I know it can possibly be corrected by post processing
with mencoder, but I would rather not even allow that in the first
Once the video is created, you can play it back with your favorite
multimedia application. Mine is definitely mplayer. You may prefer
ffplay, totem, vlc or any other application.
You can also watch it from a browser plugin. There are firefox plugins
the users can download and watch they will praise you!
After all a video is painless work for the reader/viewer. He does not
have to use his brain as much he would reading this article for
instance. Consequently screencasts will attract a lot of people to your
blogs or tutorial websites.
Other alternatives - could be painful to get working
I did try recordmydesktop and its gtk version too. It worked but I was
not happy with the results. Please don't get biased by my opinion. I
could well be wrong.
Then there is Istanbul and x11rec and various other alternatives. Check
the references section. There is a comprehensive list. You can also
search in delicious for finding out
what people have bookmarked. I myself have bookmarked a few.
But I am quite happy with ffmpeg. It does the job without getting in the
way of your main focus.
Other ways to show people what you are doing
When you want to show what you are doing to other people, you can also
ask them to connect to your screen program. GNU Screen is a simple text
based Window manager which supports a multi user mode.
You can connect through ssh and start screen in '-x' mode. A useful
screenrc is here:
caption always "%t(%n) %C:"
though you can get by without it as well of course.
There are alternatives to screen too. You can look at dtach and tmux
from the links I have given below.
You can edit the video with a simple command from mencoder. I will only
show you how to cut videos at various offsets. Most of the time you will
prune the beginning and end with the switches -ss and -endpos.
Here is a sample
$ mencoder input.avi -ovc copy -oac copy -ss 3 -o output.avi
This will remove the recording for the first 3 seconds. You can also
specify time in this format: hh:mm:ss which could be convenient for you.
vnc is a great way to connect to remote displays. It turns out that it
is also a great way to create screencast videos. I was very happy with
it when I tried long ago. It is very easy to use. Much easier than the
above command I gave with ffmpeg. But I did not like the concept of
having to record your local screen by connecting remotely first.
There is a lot more you could do of course. But I have covered a few
basics that will help you learn further.
References and further reading
Screencasting with Istanbul - youtube video
GNU Screen homepage
x11rec : a program with some rough edges
Got something to add? Send me email.
Increase ad revenue 50-250% with Ezoic
More Articles by Girish Venkatachalam
© 2012-07-06 Girish Venkatachalam