How To Record Your Screen And Webcam At The Same Time On Ubuntu

There are plenty of screen recording options for Ubuntu. I use Simple Screen Recorder, but there are many others. But none of them have a built-in way of getting a little window that shows you (like from your webcam) in the video. Sometimes this is called the “picture in picture” effect. The good news is, it’s pretty easy to do once you know the trick – and the trick is MPlayer. Here’s how it works.

Here is an example of the effect I am talking about. Down in the bottom right corner there’s a little screen where you can see me narrating the screencast.

That window is a “noborder” MPlayer window. MPlayer has loads and loads of settings.  Just look at the man page for it and you’ll see all kinds of stuff. But, this one line will get you this effect.

mplayer tv:// -tv driver=v4l2:width=400:height=300 -vo xv -geometry 100%:100% -noborder

Tweaking The Settings

A couple of the settings you might want to tweak include:

width and height: In this example I’m using the old-school 4:3 aspect ratio with the width 400px and the height 300px. Feel free to change these dimensions to whatever you’d like.

-geometry: This setting puts the window all the way down in the bottom right corner of the screen. It is 100% to the right and 100% down. You can specify pixel locations and all other sorts of things as well. I found this location to be the best for staying out of the way of what’s going on in the screencast.

-noborder: This is the setting that hides the normal title bar on the window.

-title: I am not using this argument in the example command, but if you’d like to show the title bar you can set the words you want. For example, maybe you want to show your name or something. I prefer the clean, no border look so I am not using the title.

A Few More Tips

In addition to the command line arguments we just discussed, once the mplayer window is launched, there are a few things you can do to adjust the quality of the image.

contrast: pressing 1 and 2 allows you to decrease / increase the contrast.

brightness: pressing 3 and 4 will adjust the brightness

hue: pressing 5 and 6 will adjust the hue

saturation:  pressing 7 and 8 will adjust the image saturation

always on top: pressing T will keep the video window always on top of the other windows.

 

Leave a Reply

Your email address will not be published. Required fields are marked *