📄 rtp_rfc3984_h264_over_rtp_cn.txt
字号:
redundant coded picture: A coded representation of a picture or a
part of a picture. The content of a redundant coded picture shall
not be used by the decoding process for a bitstream conforming to
H.264. The content of a redundant coded picture may be used by
the decoding process for a bitstream that contains errors or
losses.
VCL NAL unit: A collective term used to refer to coded slice and
coded data partition NAL units.
In addition, the following definitions apply:
decoding order number (DON): A field in the payload structure, or
a derived variable indicating NAL unit decoding order. Values of
DON are in the range of 0 to 65535, inclusive. After reaching the
maximum value, the value of DON wraps around to 0.
NAL unit decoding order: A NAL unit order that conforms to the
constraints on NAL unit order given in section 7.4.1.2 in [1].
transmission order: The order of packets in ascending RTP sequence
number order (in modulo arithmetic). Within an aggregation
packet, the NAL unit transmission order is the same as the order
of appearance of NAL units in the packet.
media aware network element (MANE): A network element, such as a
middlebox or application layer gateway that is capable of parsing
certain aspects of the RTP payload headers or the RTP payload and
reacting to the contents.
Informative note: The concept of a MANE goes beyond normal
routers or gateways in that a MANE has to be aware of the
signaling (e.g., to learn about the payload type mappings of
the media streams), and in that it has to be trusted when
working with SRTP. The advantage of using MANEs is that they
allow packets to be dropped according to the needs of the media
coding. For example, if a MANE has to drop packets due to
congestion on a certain link, it can identify those packets
whose dropping has the smallest negative impact on the user
experience and remove them in order to remove the congestion
and/or keep the delay low.
缩写
DON: 解码顺序号
DONB: 解码顺序基
DOND: 解码顺序号差
FEC: 向前纠错
FU: 分片单元
IDR: 瞬间解码刷新
IEC: 国际电子委员会
ISO: 国际标准化组织
ITU-T: 国际电联-通信标准部门
MANE: 美提感知网络元素
MTAP: 多时刻聚合包
MTAP16: 16位时戳位移的MTAP
MTAP24: 24位时戳位移的MTAP
NAL: 网络抽象层
NALU: NAL单元
SEI: 补充增强信息
STAP: 单时刻聚合包
STAP-A: STAP类型A
STAP-B: STAP类型B
TS: 时戳
VCL: 视频编码层
5. RTP 荷载格式
5.1. RTP头的使用
RTP 头的格式在RFC 3550 [4]中指定为了方便在图1又显示出来。本载荷格式使用头中域的方式和该规范一致。
当一个 NAL 单元封装在每个RTP包中, 推荐的RTP荷载格式在5.6节指定。对于聚合包/分片包的RTP荷载 (以及一些rtp头域的设置)在5.7和5.8节指定。
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P|X| CC |M| PT | sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| synchronization source (SSRC) identifier |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| contributing source (CSRC) identifiers |
| .... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
图 1. RTP 头。
根据RTP荷载格式设置的RTP头信息按如下设置:
Marker bit (M): 1 bit
对于RTP时戳指示的访问单元的最后一个包本位进行设置,符合视频格式M位的常规使用,以允许有效缓冲处理布局。对于聚合包(STAP,MTAP),RTP头中的M位必须设置成最后一个NAL单元如果被传送在单个RTP包中时M位对应的值。解码器可以使用本位作为早期最后一个包的指示,但是不可以依赖本属性。
注:运送多个NAL单元的聚合包只有一个M位相关联。因此,如果一个网关重新打包一个聚合包为几个包,它可能不会可靠设置这些包的M位。
Payload type (PT): 7 bits
本新的包格式的荷载类型的值超过本文档的范围,在此不指明。荷载类型的赋值或者通过profile或者通过动态方式。
Sequence number (SN): 16 bits
根据RFC 3550设置使用. 对于单个NALU与非交错打包方式, 序号用于对定NALU解码顺序。
Timestamp: 32 bits
RTP时戳设置为内容的采样时戳。必须使用90 kHz 时钟频率。
如果NAL单元没有他自己的时间属性(即,parameter set and SEI NAL units),RTP时戳设置成访问单元主编码图像的RTP时戳,根据[1]的7.4.1.2节。
MTAPs时戳的设置在5.7.2定义.
接收者应该忽略包含在访问单元(只有一个显示时戳)的任何图像时间SEI消息,相反,接收者应该使用RTP时戳同步显示过程。
RTP发送者你不应该传送图像时间 SEI消息对于不支持被显示成多个场的图像。
如果一个访问单元有多于一个显示时戳在图像时间SEI消息中, SEI消息中的信息应该被对待成相对于RTP时戳的,最早事件发生在RTP时戳给定的时间, 后续事件发生的时间由SEI消息中图像时间值差给定。假设tSEI1, tSEI2, ...,tSEIn 为SEI消息中运送的显示时间戳, 其中tSEI1 是所有这样时间戳的最早值。tmadjst()是一个函数,他调整SEI消息时间到90-kHz时间.TS是RTP时戳.则,和tSEI1关联的显示时间是TS. 和tSEIx[x=[2..n]]关联事件的显示时间为
TS + tmadjst (tSEIx - tSEI1).
注释: 在一个3:2折叠的操作中需要显示编码的帧作为场, 在其中组成编码帧 的电影内容使用隔行扫描显示。图像定时SEI消息使得运送相同编码图像的多个时戳, 因此3:2折叠过程正确控制。图像定时SEI消息机制是必须的,因为在RTP时戳中只可以 运送个时戳。
注释:因为H.264允许解码顺序可以和显示顺序不同, RTP时戳的值针对于RTP序 号可以不是单调非减的。而且RTCP报告中的抖动区间值可以不是网络性能问题的指示, as the calculation rules for interarrival jitter (section 6.4.1 of RFC 3550) assume that the RTP timestamp of a packet is directly proportional to its transmission time.
5.2. RTP 荷载格式的公共结构
荷载格式定义三个不同的基本荷载结构。一个接收者可以识别荷载结构通过RTP荷载的第一个字节, 他也共享为RTP荷载头,某些情况下,作为荷载的第一个字节。本字节总是结构化为NAL单元头. NAL单元类型指示目前使用那个结构. 可能的结构如下:
单个NAL单元包: 荷载中只包含一个NAL单元。NAL头类型域等于原始 NAL单元类型,即在范围1到23之间. 5.6指定
聚合包: 本类型用于聚合多个NAL单元到单个RTP荷载中。本包有四种版本,单时间聚合包类型A (STAP-A), 单时间聚合包类型B (STAP-B), 多时间聚合包类型(MTAP)16位位移(MTAP16), 多时间聚合包类型(MTAP)24位位移(MTAP24)。赋予STAP-A, STAP-B, MTAP16, MTAP24的NAL单元类型号分别是 24, 25, 26, 27。见5.7.
分片单元: 用于分片单个NAL单元到多个RTP包。现存两个版本FU-A,FU-B,用NAL单元类型 28,29标识。见5.8.
Table 1. 单元类型以及荷载结构总结
Type Packet Type name Section
---------------------------------------------------------
0 undefined -
1-23 NAL unit Single NAL unit packet per H.264 5.6
24 STAP-A Single-time aggregation packet 5.7.1
25 STAP-B Single-time aggregation packet 5.7.1
26 MTAP16 Multi-time aggregation packet 5.7.2
27 MTAP24 Multi-time aggregation packet 5.7.2
28 FU-A Fragmentation unit 5.8
29 FU-B Fragmentation unit 5.8
30-31 undefined -
注释: 本规范没有限制封装在单个NAL单元包和分片单元的大小。封装在聚合包中的 NAL单元大小为65535字节。
5.3. NAL单元字节使用
NAL单元字节的结构语义在1.3节介绍。为了方便,NAL单元类型字节的格式在下面列出:
+---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|F|NRI| Type |
+---------------+
本部分根据本规范指定F和NRI的语义。
F: 1 bit
forbidden_zero_bit. A value of 0 indicates that the NAL unit type
octet and payload should not contain bit errors or other syntax
violations. A value of 1 indicates that the NAL unit type octet
and payload may contain bit errors or other syntax violations.
MANEs SHOULD set the F bit to indicate detected bit errors in the
NAL unit. The H.264 specification requires that the F bit is
equal to 0. When the F bit is set, the decoder is advised that
bit errors or any other syntax violations may be present in the
payload or in the NAL unit type octet. The simplest decoder
reaction to a NAL unit in which the F bit is equal to 1 is to
discard such a NAL unit and to conceal the lost data in the
discarded NAL unit.
NRI: 2 bits
nal_ref_idc. 0值和非零值的语义与H.264规范保持一致。换句话,00值指示NAL单元的内容不用于重建影响图像的帧间图像预测。这样的NAL单元可以被丢弃而不用冒影响图像完整性的风险。大于00的值指示NAL单元的解码要求维护引用图像的完整性。
除了上面指定的外, 根据本RTP荷载规范, 大于00的NRI值指示相对传输优先级, 象编码器决定的一样。 MANE可以使用本信息保护更重要的NAL单元。最高的传输优先级是11, 依次是 10, 01;00 最低。
注释: 任何非零的NRI在H.264 解码器的处理是相同的。因此,接收者在传送NAL单元给解码器时不必操作NRI的值。
H.264编码器必须根据H.264规范设置NRI值(subclause 7.4.1)当nal_unit_type 范围的是1到12. 特别是, H.264规范要求对于nal_unit_type为6,9,10,11,12的NAL单元的NRI的值应该为0。
对于nal_unit_type等于7,8 (指示顺序参数集或图像参数集)的NAL单元,H.264编码器应该设置NRI为11 (二进制格式)对于nal_unit_type等于5的主编码图像的编码片NAL单元(指示编码片属于一个IDR图像), H.264编码器应设置NRI为11。
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -