Re: Identifying h264 frame types?
Stephane Cerveau via gstreamer-devel <[email protected]> Thu, 25 Jan 2024 15:48:40 +0100
| Newsgroups | gmane.comp.video.gstreamer.devel |
|---|---|
| Message-ID | <[email protected]> |
Dear Will, Could you be interested by the library ESExtractor ? https://github.com/Igalia/ESExtractor Best regards. Stephane On 25/1/24 13:25, will--- via gstreamer-devel wrote: > Hi All, > > > 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)? > > Long version: > > As I've already discussed on this list (thanks to Nicolas for his > input), I've been investigating seeking to a specific frame. > I am building a table of frame index to frame time, however that's not > as simple as it may first seem. > > Some behaviour around seeking requires knowing what type of frame is > being indexed for seeking to later (e.g. I-frame or P-frame - there are > no B-frames in my data at present). > > I can identify all key frames by using an extra "key frame > identification process". > The identification process is to repetitively seek using > 'Gst.SeekFlags.KEY_UNIT | Gst.SeekFlags.SNAP_AFTER | > Gst.SeekFlags.FLUSH', then requesting the frame and building a list of > metadata that can be used to identify the key frames. > > When iterating over all frames to build the index, I can then lookup to > confirm if this frame is an I-frame using the metadata. > > It strikes me that this may be redundant if I have missed some metadata > about the frame. > > Can anyone suggest a faster way to identify the type of the frame? > > Speeding this up with a single pass over the data would be very useful. > > Thanks! > > Will.