Record your desktop audio and video

This comes handy when you were not allowed to download a video from a website but allowed to play.

Libav is the library which is going to help us in such situations.

Libav is a set of tools which contains following:

  1. Avplay - A video/audio player like VLC.
  2. Avconv - A multimedia converter plus a video & audio recorder from different sources.
  3. Avprobe - A tool that connects to the multimedia file stream and returns many useful information and statistics about it.
  4. Libavfilter - A filtering API for different Libav tools.

Step1: Install Avconv tool


sudo apt-get update
sudo apt-get install libav-tools

Step2: Start video recording of desktop

avconv -f x11grab -r 25 -s 1366x768 -i :0.0 -vcodec libx264 -threads 4 $HOME/output.avi

Explanation of above command:

Ctrl+c will terminate the command and save the output file. open the output using VLC or avplay

Step3: Start Video and Audio recorning of your desktop

To record both audio and video we should know the hardware address of our output hardware(speaker)

arecord -l

The above command will list the available output hardware. Now start the recording using

avconv -f alsa -i hw:0 -f x11grab -r 25 -s 1366x768 -i :0.0 -vcodec libx264 -threads 4 output-file2.avi

Explanation: