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

AI Thread 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!
 
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Sorry if 'Profile Badge' is not the correct term. I have an MS 365 subscription and I've noticed on my Word documents the small circle with my initials in it is sometimes different in colour document to document (it's the circle at the top right of the doc, that, when you hover over it it tells you you're signed in; if you click on it you get a bit more info). Last night I had four docs with a red circle, one with blue. When I closed the blue and opened it again it was red. Today I have 3...

Similar threads

Back
Top