Re: Identifying h264 frame types?

Tim-Philipp Müller via gstreamer-devel <[email protected]> Thu, 25 Jan 2024 13:54:02 +0000
Newsgroups gmane.comp.video.gstreamer.devel
Message-ID <[email protected]>
Hi,

> Short version:
>    Is there a way to identify if a sample/frame provided to an
> appsink 
> has been produced from an h264 I-frame (or P-frame/B-frame)?

Encoded H.264 frames coming out of qtdemux should have the DELTA_UNIT
flag set on buffers if it's a P/B frame, and should have the DELTA_UNIT
flag cleared (not set) if it's a key/IDR frame. This will be based on
information in the container.

After a decoder you can't know if a decoded raw video frame was
generated from a keyframe or not. (If that flag happens to be set right
in some cases that would likely be an accident, not by design, and you
probably can't rely on that).

Cheers
 Tim