Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to extract images from a video Exp01.avi, the video is 24fps and 25 minutes long. I want the images to be extracted from the video after every 1 minute interval. Please someone tell me how to do that.

I have tried these commands, but did not help:

ffmpeg -i video.avi -r 1  -t 00:01:00 -f image image%02d.png


ffmpeg -i video.avi -r 1/1440 -f image image%02d.png
share|improve this question

I would use the select filter. The following will take one image every 1440 frames, which is every 1 minute at 24 frames per second - so change this depending on the frame rate of your input video:

ffmpeg -i input.file -filter:v 'select=not(mod(n\,1440))' image%02d.png

To use time-based selection (note that this will probably include the very first frame):

ffmpeg -i input.file -filter:v 'select=isnan(prev_selected_t)+gte(t-prev_selected_t\,60),setpts=N/(24*TB)' image%02d.png

See the select and setpts filter documentation for more info.

share|improve this answer
It is not working, it says: Unrecognized option 'filter:v' Failed to set value 'select=not(mod(n\,1440))' for option 'filter:v'. and If I change -filter:v to -vf then, it starts extracting large number of images, but definitely not after 1min interval images. – parmeshwar89 Feb 26 '13 at 8:04
sorry, -vf option is I think for number of frames. – parmeshwar89 Feb 26 '13 at 8:23
@parmeshwar89 Please include your full command and the complete console output and add this new info by editing your answer (some people try to cram it all into comments). Your ffmpeg version is probably too old, or your using the fake ffmpeg from Ubuntu, but this is unknown without the complete ffmpeg console output. – LordNeckbeard Feb 26 '13 at 18:47
Thank you very much. I am just leaving this comment in order to inform that this also works pretty fine for .VOB files directly on a DVD. What I did is to cd into the DVD VIDEO_TS Folder, then use the name of the .VOB file (VTS_01_1.VOB) and declare an absolute path for the images destination. It is like avconv -i ./VTS_01_1.VOB -filter:v 'select=not(mod(n\,1440))' /home/geppettvs/Downloads/Temp/image%02d.png – Geppettvs D'Constanzo Oct 18 '13 at 18:51
Personally, the time-based selection example above gives me:[image2 @ 0000000005350680] Could not get frame filename number 2 from pattern 'image.png' (either set updatefirst or use a pattern like %03d within the filename pattern) ..... And I've tried escaping the % in many ways, since it is special to windows command line. No go. Using a 2015 ffmpeg for windows. First solution didn't work either. – ClintJCL Oct 18 '15 at 22:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .