I am trying to decide programmatically if the video needs to be transcoded or not and one of the requirements is that the keyint needs to be 40 as the video is meant to be for a specific hardware. I am using mediainfo to get most of the video and audio parameters. I could not find a way to know what that keyint size of the video is. I tried Format_Settings_GOP but that field is empty depending on the encoding application for the video. Is there a way to find keyint from mediainfo or ffmpeg?
To which my replay isDoes the max keyframe interval have to be 40 or less (variable), or does an IDR frame have to be exactly spaced every 40 frames ?
You can generate a text file with frame types (e.g. using ffmpeg or selur's framecounter), but you would still to write a parsing utility to determine the maximum IDR interval
There are a bunch of different methods here to generate frame type list
It might be better if you posted in the "programming" section
i am just defining the max keyframe internal and yes it has to be below 40 as otherwise there is a delay for displaying the video by the hardware I am using.
Results 1 to 3 of 3
There's no way to directly get the maximal gop size without scanning the whole file unless the file was encoded with x264 and the info is contained in the meta data.
So if your file was encoded with x264 you can normally get the gop size from the 'Encoding settings', if it wasn't encoded with x264, or the meta data regarding the 'Encoding settings' was removed you only option is to:
1st scan the file go get the key-frame positions
2nd calculate the maximum gop size from the key-frame positions.
Should be easily possible to do it by using one of the methods mentioned in the doom9 thread.