How to record your Linux desktop to a video file using ffmpeg.

Posted: April 6, 2017. At: 7:54 AM. This was 9 months ago. Post ID: 10402
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

To record a good quality video of your Linux desktop, there are many ways to do this. The ffmpeg utility will be a natural choice for what we need. Run the command below to start recording a video.

localhost% ffmpeg -y -video_size 1600x900 -framerate 30 -f x11grab -i $DISPLAY+0,0 -c:v libx264 -qp 0 -preset ultrafast base.mp4

Just change the command to suit your desktop resolution. Then run this command to encode the video to the webm format for upload to a website.

localhost% ffmpeg -i base2.mp4 -c:v libvpx -qmin 0 -qmax 50 -crf 10 -b:v 2M output.webm

This may then be uploaded to the web. If it is embedded in a website, then Firefox can play it easily.

Here is a sample recording of my Gnome desktop.

Here is more information on recording webm files on Linux.

http://securitronlinux.com/bejiitaswrath/lovely-webm-i-made-with-ffmpeg/.

No comments have been made. Use this form to start the conversation :)

Leave a Reply