Select the keyframe closest to a specific moment using FFMPEG

I have an MP4 video created by third-party software. I don't know if keyframes are regular intervals or not. I managed to get a video fragment corresponding to the 3rd minute (180 seconds * frames / s) using FFMPEG.

What I want to do is retrieve the β€œclosest” keyframe for the third minute, as it often happens that the frame that I retrieve with the help of a successful code is NOT a key framework and therefore blurry.

I know there is a way to extract all the keyframes in FFMPEG, but is there a way to extract the keyframe closest to a specific time in the video?

Thank you very much!

+4
source share
1 answer

You can use Avidemux to find keyframes, also known as I-frames .

0
source

Source: https://habr.com/ru/post/1446730/


All Articles