I am currently trying to understand the Datastructure of AMFPacket for H264 Keyframes (i-Frame). The Stream is a livestream using the baseline profile. I used <IMediaStream>.getLastKeyFrame() to get a KeyFrame AMFPacket.
When I extract bytes using <AMFPacket>.getDataBuffer() I receive the following Bytes (in Hex):
This is a Videodata packet with Frame Type 1 (Keyframe) and CodecID 7 (AVC).
The AVCPacketType is 1 (AVC NALU)
The CompositionTime is 0 (no offset)
According to spec these information are then followed by one or more AVC NALUs (with full frames). So they are not encoded as stated by ANNEX B (no 00 00 00 01 starting sequence) but following avcc. I know that I need the extradata for decoding an avc nalu (as it states the number of bytes used for encoding nalu length (I will extract this information and add it lateron)
By looking at the data, the length field has to be 4 (if smaller than the next NALU would be of length 0). So I would assume the first nalu is of length 2 Byte and contains:
09 10 which would be an AUD (Access Unit Delimiter) but I cant explain the 0x10.
Is this so far correct? I am still not sure where to find the keyframe itself.
Also the first 23 Bytes do not seem to change between keyframes which implies some kind of additional data.