<p>The basic template is</p>
<pre><code>ffmpeg -i inVideo.mp4
  -vf &quot;select='between(t,30,30.5)+between(t,45,45.5)+between(t,73,73.5)'&quot;
  -s 320x240 -vsync 0 out%d.png
</code></pre>
<p>The select filter expression selects all frames in each of the three ranges. I've chosen an endpoint 0.5 seconds greater than the start point under the assumption that the video is 30 frames per second. Adjust accordingly.</p>
<p>Frame sizing is an output option so it has to appear <em>before</em> the output it is meant for.</p>

CC BY-SA 4.0
2018-11-13T16:26:55.937Z
2021-04-26T11:59:00.370Z
2021-04-26T11:59:00.370Z
Gyan
<p>I'm new to using ffmpeg, but I want to extract 15 consecutive frames (resized to 320x240) at specific time intervals from an existing video.
What I have so far is this:</p>

<pre><code>ffmpeg -ss 30 -i inVideo.mp4 -vframes 15 out%d.png -s 320x240
</code></pre>

<p>While this does create 15 frames at the 30 second mark, they are not resized.
Also, if I have this in a loop, the output images will be overwritten. 
I want to create a total of 9 time intervals with 15 frames/images each.
Any idea of how I can accomplish that?</p>

<p>Thanks for all your help!</p>

<ffmpeg>
Use ffmpeg to extract 15 frames at specific intervals
derBrain
# Use ffmpeg to extract 15 frames at specific intervals

(Asked by: username_0 on 2018-11-13)

I'm new to using ffmpeg, but I want to extract 15 consecutive frames (resized to 320x240) at specific time intervals from an existing video.
What I have so far is this:
ffmpeg -ss 30 -i inVideo.mp4 -vframes 15 out%d.png -s 320x240

While this does create 15 frames at the 30 second mark, they are not resized.
Also, if I have this in a loop, the output images will be overwritten. 
I want to create a total of 9 time intervals with 15 frames/images each.
Any idea of how I can accomplish that?
Thanks for all your help!

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2018-11-13. Score: 3 | Accepted answer

The basic template is
ffmpeg -i inVideo.mp4
  -vf "select='between(t,30,30.5)+between(t,45,45.5)+between(t,73,73.5)'"
  -s 320x240 -vsync 0 out%d.png

The select filter expression selects all frames in each of the three ranges. I've chosen an endpoint 0.5 seconds greater than the start point under the assumption that the video is 30 frames per second. Adjust accordingly.
Frame sizing is an output option so it has to appear before the output it is meant for.


---

