Originally Posted by
sohlinux
how do I ensure the screenshot is the the same size as the video? some are 640x480 and some are 720x576.
By default the outputs will be the same frame size as the input, so you don't have to do anything extra.
Originally Posted by
sohlinux
how can I to take 5 screenshots from each video? I think the current setting takes a shot every x seconds because I am getting more shots from some of the longer videos?
Probably a dozen ways to do this, but here's a method using the "select" filter. Let's assume your input frame rate is 24.98 or more accurately 24000/1001 (NTSC film) and it is 120 seconds long in duration:
- (24000/1001) frame rate * 120 duration = ~2877 total frames
- 2877 / (number of frames desired - 1) = ~719 frames between output images
Please double check my math since I've always been deficient in that area. Which results in:
Code:
ffmpeg -i input select="eq(n\,0)+eq(n\,719)+eq(n\,1438)+eq(n\,2157)+eq(n\,2876),setpts=N/((24000/1001)*TB)" output-%03d.png
You probably don't want the very first frame or the very last so you may want to add a few seconds buffer (±3 seconds in this example, or roughly 75 frames) for the first and last values:
Code:
ffmpeg -i input select="eq(n\,75)+eq(n\,719)+eq(n\,1438)+eq(n\,2157)+eq(n\,2801),setpts=N/((24000/1001)*TB)" output-%03d.png
It's kind of tricky but can be scripted.
Bookmarks