[FFmpeg-user] Faster ffprobe-based detection of open GOP h264 ?
Nicolas Gaullier
nicolas.gaullier at cji.paris
Thu Jan 11 16:42:04 EET 2024
>De : ffmpeg-user <ffmpeg-user-bounces at ffmpeg.org> De la part de Andrew Randrianasulu
>
>But as it was said in forum post above - ffprobe a bit slow, few minutes for whole video, eating one cpu core completely.
>
>Is there faster way to get this info ?
Closed vs open gop is usually a local "keyframe" matter. It is not clear to me what is your intent : do you want to make sure 100% of the keyframes are closed gop ?
If so, you have to parse the stream, so indeed, it takes a long time. I don't think there is another option. MP4 muxer only has the global "keyframe" info. With quicktime/mpeg2 you would have gotten stss/stps = closed/open gop distinction, but it is not your use case.
Only one thing: as you noticed using MediaInfo, when encoding with libx264, there is an SEI describing the encoding parameters and you can get the "open_gop" field.
If you get a very fresh (less than 2 weeks) ffmpeg build, there is an option to display this with the showinfo filter:
ffmpeg -i xxx.mp4 -vf showinfo=udu_sei_as_ascii=1 -frames 1 -f null null
Nicolas
More information about the ffmpeg-user
mailing list