ffmpeg - kdaisho/Blog GitHub Wiki

Take a screenshot

ffmpeg -f v4l2 -i /dev/video0 -vframes 1 snapshot.jpg
Part Explanation
ffmpeg Runs the FFmpeg command-line tool.
-f v4l2 Specifies the input format. v4l2 stands for Video4Linux2, which is the Linux API for handling video devices like webcams.
-i /dev/video0 Specifies the input device. /dev/video0 is usually the default webcam on Linux.
-vframes 1 Tells FFmpeg to capture only 1 video frame — essentially a single still image.
snapshot.jpg The output file name, saved as a JPEG image.