非IDR图片NAL单位-0x21和0x61的含义 [英] Non IDR Picture NAL Units - 0x21 and 0x61 meaning
问题描述
有人知道0x21
和0x61
在h.264编码的视频流中是什么意思吗?
Does anyone know what does 0x21
and 0x61
means in h.264 encoded video stream?
我知道0x01
表示它是b-frame
,而0x41
表示它是p-frame
.我的编码视频给了我两个0x21
帧,然后是一个b-frame
.
I know that 0x01
means it's a b-frame
and 0x41
means it's a p-frame
. My encoded video gives me two 0x21
frame followed by one b-frame
.
I 21 21 B 21 21 B......
这是什么0x21
?
推荐答案
根据H.264规范:
7.3.1 NAL单元语法
7.3.1 NAL unit syntax
- forbidden_zero_bit-1位-应等于0.
-
nal_ref_idc
-2位-不等于0指定NAL单元的内容包含序列参数集[...] -
nal_unit_type
-5位-指定包含在NAL单元中的RBSP数据结构的类型[...]
- forbidden_zero_bit - 1 bit - shall be equal to 0.
nal_ref_idc
- 2 bits - not equal to 0 specifies that the content of the NAL unit contains a sequence parameter set [...]nal_unit_type
- 5 bits - specifies the type of RBSP data structure contained in the NAL unit [...]
0x21
和0x61
使其成为NAL单元类型1(非IDR图片的编码切片),且nal_ref_idc
的值不同.
0x21
and 0x61
make it NAL unit type 1 (Coded slice of a non-IDR picture) with different values for nal_ref_idc
.
UPD.没有特定位(特别是位)的一对一映射.从框架"开始处固定位置开始,即表示I/P/B框架.您将需要解析位流以按照H.264规范的7.4.3 Slice头语义读取值(在大多数情况下,该值仍然可行,因为该值实际上接近位流的开头-请查看H.264规范以了解详细信息):
UPD. There is no one to one mapping of specific bit, esp. at fixed position from the beginning of the "frame" that says it's I/P/B frame. You will need to parse out the bitstream to read values per 7.4.3 Slice header semantics of H.264 spec (it is still doable in most cases since the value is real close to the beginning of the bitstream - check H.264 spec for details):
这篇关于非IDR图片NAL单位-0x21和0x61的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!