How to Capture Desktop Video on Linux using ffmpeg

ffmpeg is a powerful tool and it can do the work of capturing Linux desktop video very well. ffmpeg is a very fast video and audio converter that can also grab from a live audio/video source. ffmpeg can grab X11 input and create a video file such as mp4 at specific fps with the specific resolution.

The command to capture the Linux desktop video by ‘ffmpeg’ is as follows.

$ ffmpeg -f x11grab -s 1280x1024  -r 25 -i :0.0+0,0 out.mp4

Options used here:

‘-s 1280×1024’ is the resolution of the screen. Change it to the screen resolution you use.
‘-r 25’ is the FPS rate.

For more usage of ffmpeg, please check ffmpeg manual.

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.


    1. Dude, you have exactly the same command as the post just a different resolution and framerate .. :/

Leave a Reply

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