How to record a particular area of desktop screen on Linux

Question: I want to create a screencast of a particular area on my Linux desktop (not the entire desktop). Is there screen recorder software that allows me to do that?

When you need to demonstrate your desktop activities to someone else, using a screencast (i.e., recording of desktop screen) is far more effective than a textual tutorial or a bunch of static images. For a video tutorial, sometimes you may want to record a particular area of the desktop (e.g., one GUI window), instead of the entire desktop screen. One way to create a screencast of a particular area of the desktop is by using recordMyDesktop.

recordMyDesktop is an open-source Linux tool that can capture audio and video of a desktop screen session. It can record not only the whole desktop screen, but also a particular GUI window or any arbitrary area that you define with a mouse.

Install recordMyDesktop on Linux

recordMyDesktop is a command-line tool, but can be better used with its GUI frontend gtk-recordMyDesktop. Here is how to install them on various Linux distros.

Debian, Ubuntu or Linux Mint:

$ sudo apt-get install recordmydesktop gtk-recordmydesktop


$ sudo dnf install recordmydesktop gtk-recordmydesktop

CentOS or RHEL:

First enable EPEL repository, and then proceed with:

$ sudo yum install recordmydesktop gtk-recordmydesktop

Arch Linux:

$ sudo pacman -S recordmydesktop gtk-recordmydesktop

Record a Particular GUI Window on Desktop

To record a particular window on desktop, click on "Select Window" button on gtk-recordMyDesktop. Then move the mouse cursor to a target window that you wish to capture, and click on any area within the window.

The boundary of the chosen window will be highlighted. Note that if you move the window after this, the highlighted area will remain unchanged, so be careful.

If you want to exclude the specified window's title bar from recording, turn off "Include Window Decorations" option in "Advanced" menu.

To start recording the window, click on "Record" button on gtk-recordMyDesktop.

Once the recording gets started, gtk-recordMyDesktop's main window will disappear automatically.

If you want to stop the recording, click on the recordMyDesktop's tray icon at the top of the desktop, and choose "Stop".

The recorded screencast will be saved as .ogv file. You can play .ogv file with any video player such as mplayer or vlc. or upload it directly to YouTube without any transcoding.

Record any Arbitrary Area on Desktop

If you want to create a screencast of a particular area of desktop, click on the recordMyDesktop's tray icon. Then choose "Select Area on Screen".

This will change the mouse cursor to a cross. Now left click and drag a mouse to define an area.

Once you release a mouse, the area will be highlighted and ready for recording. Click on "Record" button to start the recording.

Here is a screencast of gtk-recordMyDesktop. 🙂

Download this article as ad-free PDF (made possible by your kind donation): 
Download PDF

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

3 thoughts on “How to record a particular area of desktop screen on Linux

  1. Or, on the command line (for us old-school users who don't like GUI tools):
    ffmpeg has an import format named "x11grab", which accepts filenames of the format $DISPLAY+x,y, where x and y denote the distance of the upper left corner of the recording area from the upper left corner of the screen. The total size of the record area can then be controlled by the -s parameter. To get smooth video, one should also set the frame rate by using the -r option.
    As an example, the following command line will grab an area of size 1678x1050 on DISPLAY 0.0 starting 7 pixels from the left, and 53 pixels from the top at 25 fps:

    ffmpeg -f x11grab -s 1678x1050 -i :0.0+7,53 -r 25

  2. SimpleScreenRecorder - I have been using it this morning. Allows you to select a screen, or a regions, or a window. Lots of settings to help get good results.

  3. Thanks for this information.
    On my job I have to use Windows (sic) and the proprietary "Camtasia Studio" for screencasts.
    Which is, by the way, a very good program in this particular usecase...

    But in private I wanted to replace ist. So I use Audacity (for audio), RecordMyDesktop or Vokoscreen ( for video and OpenShot to get things together.
    Not as seamless, easy and flawless as the mentioned Camtasia Studio, but Free as in Freedom... 😉

    Greetings from Germany
    Edgar "Fast Edi" Hoffmann

Leave a Reply to Edgar "Fast Edi" Hoffmann Cancel reply

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