Using ffmpeg to extract every n frames from a given range of an m2ts video

Click For Summary
To extract every second from a specific segment of a video using FFmpeg, the command should include the -ss option to specify the start time and the -t option to define the duration. For a video titled myvideo.m2ts, to extract frames from 54 minutes to 55 minutes, the command would be: ffmpeg -ss 3240 -t 60 -i myvideo.m2ts -r 1 output_%04d.png. This effectively captures one frame per second for the desired one-minute interval.
member 428835
Hi PF!

I have a video titled myvideo.m2ts that is 2 hours long at 60 fps. I would like to extract every second from 54 min to 55 min via ffmpeg. It looks like I would execute something similar to this: ffmpeg -i myvideo.m2ts -r 1 output_%04d.png except this will run the entire video. Any help is greatly appreciated!
 
Computer science news on Phys.org
Use the -ss option before the -i option like:
Code:
ffmpeg -ss 3240 -i myvideo.m2ts -r 1 output_%04d.png
as described in the online manual: https://ffmpeg.org/ffmpeg.html#toc-Main-options

Edit: oh, you only want 1 minute: use the -t option as well:
Code:
ffmpeg -ss 3240 -t 60 -i myvideo.m2ts -r 1 output_%04d.png
 
  • Like
Likes sysprog and member 428835
Amazing, thanks so much!
 
A new phenomenon is AI-generated news videos pretending to be by well-known professors Jeffery Sachs and John Mearsheimer. The amazing thing is that they both seem very tolerant of this. Youtube will block these if they request it but this has been going on for months and such blocks never seem to happen. The other surprise is that while they may be visually ugly or even grotesque the news analysis is quite good. If given the sound alone I don't believe I could tell it from the real...

Similar threads

Replies
2
Views
667
  • · Replies 15 ·
Replies
15
Views
4K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
7K
  • · Replies 56 ·
2
Replies
56
Views
53K
  • · Replies 21 ·
Replies
21
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
6
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
71
Views
17K