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.


13 thoughts on “How To Record Your Screen And Webcam At The Same Time On Ubuntu

  1. Moeen says:

    another simple and easy way is to use a chrome extension called loom. I tested that on my linux mint and that is working great!

    • Lee says:

      Nice! That is much easier than setting up all those audio settings in Audacity! Thanks for sharing this!

      • Moeen says:

        You are welcome. I am sorry I forget to add link, here it is:

        There are some other chrome extensions that are also great. I switched to linux from window and I made a habit whenever I didn’t found a suitable linux app for something I search on chrome store and 99.99% time I found it.

    • Lee says:

      I haven’t been able to find anything about how long the recording can be and pricing. It’s hard to believe something like this could be free forever with unlimited recording. Really cool looking service, though.

  2. any says:

    Thank you so mush
    it was very usefull

  3. murtad says:

    Good tuto.

    How to save what has been recorded using your command as a file on the computer?


  4. michael says:

    Thanks for the useful info. I’m on an Arch-based distro called Arcolinux, and I’m using SSR, so I’ll check out your suggestion.

    I just wanted to mention another screencast app that DOES offer webcam support out-of-the-box, and that’s vokoscreen. It’s a very nice app that also uses ffmpeg under the hood. It’s one of the easiest to use screencasters I’ve found for Linux, and I’ve looked at a lot of them. It’s not in the arch repos (at least I haven’t found it yet), so that’s why I’m using SSR instead.

    I can’t remember if it’s in the ubuntu repository or not. It’s definitely in the debian repository for stretch 9.6, I believe…
    Happy screencasting!

  5. César says:

    TKS so much!!! Debian-9

  6. Felipe says:

    Nice tip!

  7. Stavros Anastassiou says:

    Thanks a lot, it works really well for me! Just one question: the “on-top” feature does not work when I choose “Fullscreen” or “Presentation” in pdf. Any ideas?

  8. Jean says:

    The mouse pointer disappears in the recording.

Leave a Reply

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