How to record your Linux desktop to a mkv file with ffmpeg.

Posted: September 26, 2017. At: 12:05 PM. This was 3 months ago. Post ID: 11410
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.

Record your Linux desktop to a video file and showcase it on Youtube

To get a simple desktop recording of your Linux desktop for teaching purposes or any other use, just follow this guide. This command below. will record a high-quality video file of your Linux desktop to an MKV file. It will automatically get the desktop resolution.

ffmpeg -f x11grab -s `xdpyinfo  | grep -oP 'dimensions:\s+\K\S+'` -r 29 -i :0.0 -vcodec libx264 -threads 8 `date "+%Y-%H-%M.mkv"`

Here is a sample desktop recording made with this simple one-liner.

Sample desktop recording..

To convert the recording to a WEBM file, use this command.

ffmpeg -i 2017-07-54.mkv -c:v libvpx -crf 30 -b:v 4M -c:a libvorbis output.webm

This creates a high-quality conversion to place on a website.

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

Leave a Reply