• Bubble
  • Bubble
  • Line
How to easily take a screenshot from the commandline with ffmpeg
Andrei Clinciu Article AUthor
Andrei Clinciu
  • 2017-04-13T21:26:00Z
  • 1 min to read

In this post I intend to show how easy it is to take a screenshot from the CommandLine.

Why would you want to do that?
Well there are times when you simply want to take a screenshot of the screen at certain times to track your activity. Or to make a simple screencast without having to install additional tools.

FFMPEG can be downloaded and installed from the following website: https://www.ffmpeg.org/

For Linux you can also install it via the commandline

To install libav:

apt-get install libav-tools

To install ffmpeg:

apt-get install ffmpeg

To take a screenshot on Linux just type the following in your terminal

ffmpeg -f gdigrab -i desktop -vframes 1 screenshot.jpeg

Take a screenshot on  Windows

ffmpeg -f x11grab -video_size $(xdpyinfo | grep dimensions | cut -d" " -f7) -i $DISPLAY -vframes 1 screenshot.jpg


Ideas and comments

Andrei Clinciu
Andrei Clinciu

I'm a Full Stack Software Developer specializing in creating websites and applications which aid businesses to automate. Software which can help you simplify your life. Let's work together!

Building Great Software
The digital Revolution begins when you learn to automate with personalized software.

Find me on social media