APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Creating screencast video tutorials for the web

© August 2009 Girish Venkatachalam
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 with ttyplay(1).

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 altogether.

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 place.

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 or javascript addons that do the job. But even if you give a video that 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

  1. mplayer documentation
  2. Screencasting with Istanbul - youtube video
  3. ttyrec homepage
  4. recordmydesktop homepage
  5. vnc2swf homepage
  6. tmux homepage
  7. GNU Screen homepage
  8. dtach homepage
  9. ffmpeg homepage
  10. script(1) homepage
  11. x11rec : a program with some rough edges

running cheetah
Stop spam dead in its tracks!

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> Creating Linux Video Tutorials


Inexpensive and informative Apple related e-books:

Take Control of High Sierra

Take Control of iCloud

Take Control of the Mac Command Line with Terminal, Second Edition

Take Control of OS X Server

iOS 8: A Take Control Crash Course

More Articles by © Girish Venkatachalam

Fri Jul 6 19:27:48 2012: 11183   Gallefray


can I use this command if x isn't running?

I would like to make a few videos from the terminal, but my computer is too underpowered to do a screen recording, and I prefer to stick to a CLI (I haven't the hang of this new hip 'GUI' thing that everyone's talking about :D )

is there a way of converting ttyrecord into a .avi? I can always record the audio with another computer and cut them together later.


Fri Jul 6 19:33:27 2012: 11184   TonyLawrence


Are you asking about recording a terminal session? Otherwise, I don't understand your question because the example given here IS producing an avi file.

Are you saying you want to make a movie of command line work?


Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

One in a million is next Tuesday. (Gordon Letwin)

Linux posts

Troubleshooting posts

This post tagged:




Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode