11/10/2023 0 Comments Ffmpeg extract frames time range![]() Using an edit list, it is possible to cut at a non-keyframe with the mp4 container without re-encoding. ![]() Non-keyframes need all of the data beginning with the previous keyframe because they encode variations from other frames. You probably don’t have a keyframe at the specified second mark if you can’t cut a video at a particular moment. Here's an example Mr.In GNU/Linux tagged cut / ffmpeg / time by Tux This answer was satisfactory and exactly what he wanted to learn. In this example, we do not do anything to the input but specifically apply seeking to the same map multiple times to get screenshots are specific locations, for example: ffmpeg -i input.mp4 -map 0:v -ss 00:00:05 -frames:v 1 frame_1.png -map 0:v -ss 00:00:10 -frames:v 1 frame_2.png the use of -map is what we want to focus on. This technically works but you have to do math against the input starting at 5 seconds.īut we are heading in the right direction. Here the input is 60 seconds long we automatically start the video at 5 seconds to get the first screenshot but then another 10 seconds is seeded to get a screenshot at the 15th second of the original input. So using that logic, if we set the seeking on the input to get a screenshot out and then applied another seeking with a map the results are going to get tricky, for example: $ ffmpeg -ss 00:00:05 -i input.mp4 -frames:v 1 frame_1.png -map 0:v -ss 00:00:10 -frames:v 1 frame_2.png (for example, the video is 60 seconds long -ss 00:00:10 would jump the start point of the video at the 10-second mark making the video only 50 seconds long in total). What happens here is the input is seeking to a new timestamp for a start location for playback. First you must have an understanding how -ss works. So to clarify, the user was having issues understanding how to chain multiple seeking ( -ss) with one input to get random frames from the video. Is this possible at all? There is no interval, just "random" times from the video where I want to extract a screenshot Mr. but for multiple seek times and output names (those I guess can be generated from timestamp) with a single pass. Here was the Hey, I've got a question if something is even possible. For some reason the person pinged me to answer it so I took a stab at it. ![]() This question was asked on the FFmpeg Discord. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |