How to record screen on Linux from command line
Using just FFMPEG!
Often, during various kind of activities in front of a monitor, you need to record the screen.
This operation can be accomplished using various tools, most with a graphical interface.
But is also possible to record the screen from command line, using a tool usually already installed on your linux box: ffmpeg
What is FFMPEG?
FFmpeg is a suite of libraries and programs for handling video, audio, and other multimedia files and streams, published under the GNU Lesser General Public License 2.1+ (or GNU General Public License 2+ , depending on which options are enabled).
The name of the project is inspired by the MPEG video standards group, together with “FF” for “fast forward” (https://ffmpeg.org/pipermail/ffmpeg-devel/2006-February/010315.html)
If ffmpeg is not already present in your linux, you can simply install it using the package system.
For example, on Debian/Ubuntu:
sudo apt-get install ffmpeg
Let’s start recording!
Once installed ffmpeg, you are able to start screen recording with this simple command:
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -qscale 0 recording.mpg
Hit CTRL+C when you need to stop the recording (saved in recording.mpg)