How can I record my screen on Ubuntu?

The app I'm looking for has ideally all of these features:

  1. Can record in a format that can be played back easily on any platform and/or accepted by YouTube or another popular video site
  2. Can record just a window (instead of the whole screen), possibly selecting it with a mouse click
  3. Can start recording after a configurable delay (e.g., I launch the app and have time to do arrangements to my desktop/window before actual recording starts)

Solution 1:

gtk-recordmydesktop install gtk-recordmydesktop

Adds an easy to use graphical icon on the GNOME toolbar to make a pleasure use and configure the audio and video capture and screencast application recordMyDesktop.

enter image description here

As mentioned at 20.04: Can't install gtk-recordmydesktop and on the package search, the package is not available on the main repository anymore, and sudo apt install gtk-recordmydesktop fails. I'm not sure why the http://apt.ubuntu.com/p/gtk-recordmydesktop link seems to work, maybe it installs an older version. But this indicates that the software is not being actively supported.

recordmydesktop

This is the non-GUI backend of recordmydesktop, and it is still available in 20.04:

sudo apt install recordmydesktop
recordmydesktop --on-the-fly-encoding

This will record until you stop the program on the terminal e.g. with Ctrl + C.

--on-the-fly-encoding encodes the output immediately; without it you need to wait for a possibly long time at the end for the encoding to be done. I haven't seen any significant downsides to that option yet, likely it will just take a bit more of CPU resources, but it is generally worth it.

It should be able to do everything that gtk-recordmydesktop does, but it is a bit harder to learn as you have to deal with the command lines.

You can set a stop recording shortcut e.g. with:

recordmydesktop --stop-shortcut=Control+s

You can select to record a single window as shown at: How can I get the value of Window ID?

recordmydesktop --windowid `xwininfo | grep 'id: 0x' | grep -Eo '0x[a-z0-9]+'`

This will allow you to first select the window with a mouse click, and it starts recording after you click.

How to record sound output with it: https://unix.stackexchange.com/questions/3490/how-can-i-record-the-sound-output-with-gtk-recordmydesktop

xvidcap (no longer maintained, package is no longer available)

A screen capture enabling you to capture videos off your X-Window desktop for illustration or documentation purposes. It is intended to be a standards-based alternative to tools like Lotus ScreenCam.

Video can be saved in MPEG or AVI files format.

Solution 2:

I like Byzanz; it records your activity as a GIF file.

enter image description here

It's pretty light and works well, especially for putting a shorter screencast on a webpage or in an email.

You can either get it from the PPA (might have a more up-to-date package but is 'unsupported'):

sudo add-apt-repository ppa:fossfreedom/byzanz
sudo apt-get update && sudo apt-get install byzanz

Or you can get it from the official Ubuntu repositories by clicking the button below:

Install Byzanz

For further information:

How to create animated GIF images of a screencast?

Solution 3:

Kazam

It's a good application for this purpose: Home, install, or simply sudo apt install kazam

It gives you a delay before recording. Recording is done in HD and the output is in .mkv format which is accepted for YouTube so there is no need to convert and re-render.

There are some useful keyboard shortcuts too:

To start the recording: Super + Ctrl + R
To pause the recording: Super + Ctrl + P
To stop the recording: Super + Ctrl + F
To show/hide main window: Super + Ctrl + W

On Ubuntu 20.04 I met this bug with it where the video is not captured/or is all black: https://github.com/hzbd/kazam/issues/9 even though recordmydesktop video capture worked on the same machine.

Solution 4:

Simple Screen Recorder

SimpleScreenRecorder is a Linux program that I've created to record programs and games. There are programs that can do this, " but I wasn't 100% happy with any of them, so I created my own "

My original goal was to create a program that was just really simple to use, but as I was writing it I started adding more and more features, and the result is actually a fairly complex program. It's 'simple' in the sense that it's easier to use than ffmpeg/avconv or VLC :).

For Ubuntu versions 12.04 - 16.10 it is not in the standard repositories and can be installed with the following:

sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder
sudo apt-get update
sudo apt-get install simplescreenrecorder
# if you want to record 32-bit OpenGL applications on a 64-bit system:
sudo apt-get install simplescreenrecorder-lib:i386

For Ubuntu versions 17.04 - onwards it is included in the universe repository and can be installed by:

sudo apt-get update
sudo apt-get install simplescreenrecorder

Here is a UI preview:

enter image description here

Solution 5:

Recently I tried to record a screencast with audio. I tried many of the options listed here and other websites. My goal was not to write a comprehensive summary of all tools available, but to find a single one which works.

In my case (after several hours of struggling) it was VOKOSCREEN which worked, so I did not look further. My system is Linux Mint 15 Olivia, 64-bit, which is based on Ubuntu Raring.

This is my summary/log which I wrote while experimenting. Hope it will save you several hours:

  • avconv: audio and video get out of sync, audio is lagging behind. Tried all the options I could. This is the command line I used:

    avconv -f alsa -i pulse -f x11grab -r 15 -s 1024x768 -i :0.0 -vcodec wmv1 -acodec pcm_s16le -q 7 b4.avi
    
  • Byzanz: creates animated gif (not tried, since I need sound as well and longer screencast)

  • Eidete: unable to install (with 20 years of Linux experience, didn't try forever though)

  • gtk-recordmydesktop: creates ogg which is fine, but unable to convert to anything. Best converter was mencoder but is speeds up video (but not audio) so they get out of sync.

  • istanbul: freezes immediately

  • Kazam: if record area larger than ~640x480 memory starts leaking, leaving at most a few minutes before system becomes unresponsive. Many have reported similar issue, this is a known bug.

  • pyvnc2swf: Is a tool to record a VNC session. Not convenient if you want to record your own screen (not tried)

  • screenkey: advertised as a "screencast tool", but is not about recording your screen

  • tibesti: seems to be no longer maintained (since 2011), does not even install

  • vokoscreen: FINALLY!!!!
    Quality is good: both audio and video. After recording, I could compress the file to about 1:7 with mencoder without any loss of quality. I discovered that it uses the following command line:

    ffmpeg -f alsa -i pulse -f x11grab -r 15 -s 1024x768 -i :0.0+0,0 -vcodec mpeg4 -acodec libmp3lame -ar 48000 -sameq -r 15 my.avi
    
  • xvidcap: As stated above: "We've removed xvidcap from the repository now because it's no longer maintained." (not tried)

  • wink: distributed as downloadable executable not as package, (not tried)