Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

and

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.