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!
 
I came across a video regarding the use of AI/ML to work through complex datasets to determine complicated protein structures. It is a promising and beneficial use of AI/ML. AlphaFold - The Most Useful Thing AI Has Ever Done https://www.ebi.ac.uk/training/online/courses/alphafold/an-introductory-guide-to-its-strengths-and-limitations/what-is-alphafold/ https://en.wikipedia.org/wiki/AlphaFold https://deepmind.google/about/ Edit/update: The AlphaFold article in Nature John Jumper...
Thread 'Urgent: Physically repair - or bypass - power button on Asus laptop'
Asus Vivobook S14 flip. The power button is wrecked. Unable to turn it on AT ALL. We can get into how and why it got wrecked later, but suffice to say a kitchen knife was involved: These buttons do want to NOT come off, not like other lappies, where they can snap in and out. And they sure don't go back on. So, in the absence of a longer-term solution that might involve a replacement, is there any way I can activate the power button, like with a paperclip or wire or something? It looks...

Similar threads

Back
Top