Reputation: 91
I wish to extract 10 consecutive frames every 2 seconds. (this is because I wish to choose "best one" from the "nearby offset"). I know how to extract a frame each x seconds:
ffmpeg -i /tmp/V.MP4 -vf fps=1 %02d.jpg
I know how to extract 10 frames from some starting offset:
ffmpeg -ss 20.0 -i /tmp/V.MP4 -vframes 10 %02d.jpg
I have 2 issues:
Upvotes: 2
Views: 1718
Reputation: 92928
Use
ffmpeg -i source -vf select='eq(n,0)+if(mod(trunc(t)+1,2)*(trunc(t)-trunc(prev_t)),st(1,n),lt(n,ld(1)+10))' -vsync 0 -frame_pts 1 %d.jpg
How do I find the offset for each output image?
See what frame_pts values mean, at ffmpeg output images filename with time position
this is because I wish to choose "best one" from the "nearby offset"
the thumbnail filter can sort of do this.
Upvotes: 1