Saving a video into a sequence of images

I wanted to create a GIF out of a part of a video sequence. But how could one extract a sequence of images from a video? After some googling FFMPEG turned out to be the savior. Here’s a sample command for taking a series of snapshots out of a video using ffmpeg:

ffmpeg -ss 23 -i kids.mp4 -f image2 -vframes 50 a%2d.jpg

23 is the position in the video to start extracting images (in seconds). kids.mp4 is the input video file. image2 says that the output would be in JPEG format. 50 is the number of frames to capture. a%2d.jpg is the format of the output file, i.e. in this case the files would be saved as a01.jpg, a02.jpg, etc.

The next step would be to convert the sequence of images to a GIF, which can be easily done using GIMP.

4 responses on “Saving a video into a sequence of images

Leave a Reply

Your email address will not be published. Required fields are marked *