Identify h264 profile and level from profile-level

2019-03-20 20:48发布

In a SIP video call, the receiver of the video stream respond with the capabilities of its decoder.

The parameter which defines that is the profile-level-id. Here is an example value of the profile-level-id parameter: 428014

RFC 6184 defined that as

A base16 [7] (hexadecimal) representation of the following three bytes in the sequence parameter set NAL unit is specified in 1: 1) profile_idc, 2) a byte herein referred to as profile-iop, composed of the values of constraint_set0_flag, constraint_set1_flag, constraint_set2_flag, constraint_set3_flag, constraint_set4_flag, constraint_set5_flag, and reserved_zero_2bits in bit- significance order, starting from the most-significant bit, and 3) level_idc.

According to that, the following parameters from the example value can be identified:

  • profile_idc 42
  • profile-iop 82
  • level-idc 14

How to relate those numbers to the profiles and levels defined for h264?

标签: sip h.264 sdp
1条回答
孤傲高冷的网名
2楼-- · 2019-03-20 21:07

For such things you should read actual H.264 spec not Wikipedia. Using it you can parse your example as

  • profile_idc 0x42 == 66 so it is Baseline profile
  • profile-iop 0x80 mean constraint_set0_flag=1 (so it is Constrained Baseline profile) and others 0
  • level-idc 0x14 == 20 so it is Level 2.0

So result is Constrained Baseline profile Level 2.0

查看更多
登录 后发表回答