SDP - H.264 profile-level-id

profile-level-id define the properties of the incoming H.264 stream. It indicates the profile level the decoder must comply to in order to decode the incoming NAL unit stream.

It is a Base16 representation of 3 bytes in the SPS of NAL unit.
1 byte - profile_idc
1 byte - profile_iop
1 byte - level_idc

for example, profile-level-id=42E015 imply
profile_idc = 42 imply Baseline profile
profile_iop = E0 imply only common subset of profile is supported
level_idc = 15 imply level 2.1

In general, profile-level-id and packetization-mode identify the media format configuration for H.264

See RFC 3984 Section 8.1 for details

Comments

  1. Hello. I have FLV stream. It contain some h264 video data.
    For example, a following byte array is first video data in stream.

    17 0 0 0 0 1 42 c0 33 ff e1 0 16 67 42 c0 33 da 2 80 f6 84 0 0 3 0 4 0 0 1f 40 3c 60 ca 80 1 0 4 68 ce 3c 80

    Specification determines it how a key frame. Is it - 67 42 - start of SPS and 68 ce - start of PPS? It pair is used for generate sprop-parameter-sets, isn't it?

    How can i get profile-level-id from this stream?

    Thanks.

    ReplyDelete
  2. Your first video data

    17 0 0 0 0 1 42 c0 33 ff e1 0 16 67 42 c0 33 da 2 80 f6 84 0 0 3 0 4 0 0 1f 40 3c 60 ca 80 1 0 4 68 ce 3c 80

    does not look like a h264 frame..

    I look more like a video data in flv.

    By looking at the bytes, it is a AVC sequence header frame.

    Your AVCDecoderConfigurationRecord
    1 42 c0 33 ff e1 0 16 67 42 c0 33 da 2 80 f6 84 0 0 3 0 4 0 0 1f 40 3c 60 ca 80 1 0 4 68 ce 3c 80

    So, my guess is (assuming you know the H.264 specification)

    profile-level-id = 42 (2nd bytes)
    level indication = 33 (4th bytes)
    Num of SPS = 1 (6th bytes e1 tells you length)
    Length of SPS = 22 bytes (0016 at 7th and 8th bytes)
    SPS = 67 42 c0 33 da 2 80 f6 84 0 0 3 0 4 0 0 1f 40 3c 60 ca 80

    Then, your PPS is the remaining 1 0 4 68 ce 3c 80
    That is 1 PPS with 4 bytes
    Your PPS is 68 ce 3c 80

    ReplyDelete
  3. Thank you! It is very useful information.

    FLV video data contain some NALUs. NALUs have different headers, for example, 41 9a, 41 9b, 41 9e. They look like headers of MTAP16 and MTAP24. But i have some doubts. Are it NALUS a valid for RTP payload? Can you tell me?
    Thank you very much.

    ReplyDelete
  4. MTAP - Multi-time aggregation packet - means there are multiple different timing NAL units in this RTP packet. It could happen for P-Frames

    For your given example, 41 simply means that it is a P-Frame. 9A, 9B, 9E is already the first byte of your NAL unit.

    To see if it is a MTAP16 or MTAP24, you have to look at the first byte of RTP payload. The least 5 significant bits are the type value and MTAP16 and MTAP24 has type value 26 and 27 respectively

    See RFC 3984 (http://www.ietf.org/rfc/rfc3984.txt)
    Section 5.3. NAL Unit Octet Usage
    Section 5.7. Aggregation Packets

    ReplyDelete

Post a Comment

Popular Posts