ffmpeg screen capture code example
Example 1: ffmpeg take screenshot
ffmpeg -i inputvideo.mp4 -ss 00:00:03 -frames:v 1 outputimage.jpeg
Example 2: ffmpeg linux capture desktop
$ ffmpeg -f x11grab -s 1280x1024 -r 25 -i :0.0+0,0 out.mp4
ffmpeg -i inputvideo.mp4 -ss 00:00:03 -frames:v 1 outputimage.jpeg
$ ffmpeg -f x11grab -s 1280x1024 -r 25 -i :0.0+0,0 out.mp4