In this tip we will see how to use ffmpeg to convert a video to a series of still pictures (JPEG format) via the command line under Ubuntu. Using ffmpeg to take screenshots of a video will help you get good image quality and perfect results as opposed to the standard way we take screenshots using the Print Screen key, which sometimes gives us dark images with low quality. Using also the Print Screen key will make you take screenshots repeatedly until you get the image you want to capture.

Let's first install FFMPEG with this command:

sudo apt-get install ffmpeg

Move on to the location of your video using the cd command and run the following:

ffmpeg -i input.avi -r 1 -f image2 image-%01d.jpg

Replace "input.avi" with your own video name and extension. To set resolution for the generated images, you can use this command:

ffmpeg -i input.avi -r 1 -s 100×100 -f image2 tmp-%01d.jpg

The images will be created in the current video location. To halt the command, press CTRL+C.


Post a Comment