下图为RTP部格式:
*****************************************************
1) V:RTP协议的版本号,占2位,当前协议版本号为2
2) P:填充标志,占1位,如果P=1,则在该报文的尾部填充一个或多个额外的八位组,它们不是有效载荷的一部分。
3) X:扩展标志,占1位,如果X=1,则在RTP报头后跟有一个扩展报头
4) CC:CSRC计数器,占4位,指示CSRC 标识符的个数(作用信源CSRC计数器)
5) M: 标记,占1位,不同的有效载荷有不同的含义,对于视频,标记一帧的结束;对于音频,标记会话的开始。(对于分组中的重要事件可用该位标识)
6) PT: 有效荷载类型,占7位,用于说明RTP报文中有效载荷的类型,如GSM音频、JPEM图像等,在流媒体中大部分是用来区分音频流和视频流的,这样便于客户端进行解析。
7) 序列号:占16位,用于标识发送者所发送的RTP报文的序列号,每发送一个报文,序列号增1。这个字段当下层的承载协议用UDP的时候,网络状况不好的时候可以用来检查丢包。同时出现网络抖动的情况可以用来对数据进行重新排序,序列号的初始值是随机的,同时音频包和视频包的sequence是分别记数的。
8) 时戳(Timestamp):占32位,必须使用90 kHz 时钟频率。时戳反映了该RTP报文的第一个八位组的采样时刻。接收者使用时戳来计算延迟和延迟抖动,并进行同步控制。
9) 同步信源(SSRC)标识符:占32位,用于标识同步信源。该标识符是随机选择的,参加同一视频会议的两个同步信源不能有相同的SSRC。
10) 特约信源(CSRC)标识符:每个CSRC标识符占32位,可以有0~15个。每个CSRC标识了包含在该RTP报文有效载荷中的所有特约信源。
注意
RFC "RTP文件的音频和视频会议与最小
控件[RFC3551]指定初始集“有效负载类型”。此列表维护并扩展该列表。
可用的格式
PT | Encoding Name | Audio/Video (A/V) | Clock Rate (Hz) | Channels | Reference |
---|---|---|---|---|---|
0 | PCMU | A | 8000 | 1 | [RFC3551] |
1 | Reserved | ||||
2 | Reserved | ||||
3 | GSM | A | 8000 | 1 | [RFC3551] |
4 | G723 | A | 8000 | 1 | [Vineet_Kumar][RFC3551] |
5 | DVI4 | A | 8000 | 1 | [RFC3551] |
6 | DVI4 | A | 16000 | 1 | [RFC3551] |
7 | LPC | A | 8000 | 1 | [RFC3551] |
8 | PCMA | A | 8000 | 1 | [RFC3551] |
9 | G722 | A | 8000 | 1 | [RFC3551] |
10 | L16 | A | 44100 | 2 | [RFC3551] |
11 | L16 | A | 44100 | 1 | [RFC3551] |
12 | QCELP | A | 8000 | 1 | [RFC3551] |
13 | CN | A | 8000 | 1 | [RFC3389] |
14 | MPA | A | 90000 | [RFC3551][RFC2250] | |
15 | G728 | A | 8000 | 1 | [RFC3551] |
16 | DVI4 | A | 11025 | 1 | [Joseph_Di_Pol] |
17 | DVI4 | A | 22050 | 1 | [Joseph_Di_Pol] |
18 | G729 | A | 8000 | 1 | [RFC3551] |
19 | Reserved | A | |||
20 | Unassigned | A | |||
21 | Unassigned | A | |||
22 | Unassigned | A | |||
23 | Unassigned | A | |||
24 | Unassigned | V | |||
25 | CelB | V | 90000 | [RFC2029] | |
26 | JPEG | V | 90000 | [RFC2435] | |
27 | Unassigned | V | |||
28 | nv | V | 90000 | [RFC3551] | |
29 | Unassigned | V | |||
30 | Unassigned | V | |||
31 | H261 | V | 90000 | [RFC4587] | |
32 | MPV | V | 90000 | [RFC2250] | |
33 | MP2T | AV | 90000 | [RFC2250] | |
34 | H263 | V | 90000 | [Chunrong_Zhu] | |
35-71 | Unassigned | ? | |||
72-76 | Reserved for RTCP conflict avoidance | [RFC3551] | |||
77-95 | Unassigned | ? | |||
96-127 | dynamic | ? | [RFC3551] |
除了RTP中列出的RTP有效载荷格式(编码)之外有效载荷类型表,还有其他有效载荷格式没有是否分配了静态RTP有效负载类型,但使用了动态有效负载型号任务。每个有效负载格式都由一个已注册的下表中列出的媒体子类型。
作为新的有效载荷格式指定后,应将其注册的媒体子类型添加到其中表。
此外,对于RTP有效负载中列出的有效负载格式在上面的Types表中,“编码名称”也被注册为媒体媒体类型“音频”或“视频”下的子类型。时钟频率和这里显示的通道数是这些有效负载的正常值具有正常值的格式。类型名和子类型名都是RFC4288中定义的不区分大小写。
注册程序和注册模板可在 [RFC4855].
除了上表中明确指定PT值的负载类型,还有些负载类型由于诞生的较晚,没有具体的PT值,只能使用动态(dynamic)PT值,即96到127,这就是为什么大家普遍指定H264的PT值为96。下表中列出了没有具体PT值的负载类型。
Media Type | Subtype | Clock Rate (Hz) | Channels (audio) | Reference |
---|---|---|---|---|
application | 1d-interleaved-parityfec | [RFC6015] | ||
application | h224 | 4800 | [RFC4573] | |
application | parityfec | [RFC3009] | ||
application | raptorfec | [RFC6682] | ||
application | rtx | [RFC4588] | ||
application | smpte336m | [RFC6597] | ||
application | ulpfec | [RFC5109] | ||
audio | 1d-interleaved-parityfec | [RFC6015] | ||
audio | 32kadpcm | 8000 | [RFC3802][RFC2421] | |
audio | ac3 | [RFC4184] | ||
audio | AMR | 8000 | [RFC4867][RFC3267] | |
audio | AMR-WB | 16000 | [RFC4867][RFC3267] | |
audio | amr-wb+ | 72000 | [RFC4352] | |
audio | ATRAC-ADVANCED-LOSSLESS | [RFC5584] | ||
audio | atrac-x | [RFC5584] | ||
audio | atrac3 | 44100 | [RFC5584] | |
audio | BV16 | 8000 | [RFC4298] | |
audio | BV32 | 16000 | [RFC4298] | |
audio | clearmode | 8000 | 1 | [RFC4040] |
audio | CN | [RFC3389] | ||
audio | DAT12 | [RFC3190] | ||
audio | dsr-es201108 | [RFC3557] | ||
audio | dsr-es202050 | 8000 | [RFC4060] | |
audio | dsr-es202211 | 8000 | [RFC4060] | |
audio | dsr-es202212 | 8000 | [RFC4060] | |
audio | DV | [RFC6469] | ||
audio | DVI4 | [RFC4856] | ||
audio | eac3 | [RFC4598] | ||
audio | EVRC | 8000 | 1 | [RFC4788] |
audio | EVRC0 | 8000 | 1 | [RFC4788] |
audio | EVRC1 | 8000 | 1 | [RFC4788] |
audio | EVRCB | 8000 | 1 | [RFC4788] |
audio | EVRCB0 | 8000 | 1 | [RFC4788] |
audio | EVRCB1 | 8000 | 1 | [RFC4788] |
audio | EVRCWB | [RFC5188] | ||
audio | EVRCWB0 | [RFC5188] | ||
audio | EVRCWB1 | [RFC5188] | ||
audio | fwdred | [RFC6354] | ||
audio | g719 | 48000 | [RFC5404] | |
audio | G722 | [RFC4856] | ||
audio | G7221 | 16000 | 1 | [RFC5577] |
audio | G723 | [RFC4856] | ||
audio | G726-16 | 8000 | 1 | [RFC3551][RFC4856] |
audio | G726-24 | 8000 | 1 | [RFC3551][RFC4856] |
audio | G726-32 | 8000 | 1 | [RFC3551][RFC4856] |
audio | G726-40 | 8000 | 1 | [RFC3551][RFC4856] |
audio | G728 | [RFC4856] | ||
audio | G729 | [RFC4856] | ||
audio | G7291 | 16000 | [RFC4749][RFC5459] | |
audio | G729D | 8000 | 1 | [RFC3551][RFC4856] |
audio | G729E | 8000 | 1 | [RFC3551][RFC4856] |
audio | GSM | [RFC4856] | ||
audio | GSM-EFR | 8000 | 1 | [RFC3551][RFC4856] |
audio | GSM-HR-08 | 8000 | [RFC5993] | |
audio | iLBC | 8000 | [RFC3952] | |
audio | ip-mr_v2.5 | 16000 | [RFC6262] | |
audio | L8 | [RFC3551][RFC4856] | ||
audio | L16 | [RFC4856] | ||
audio | L20 | [RFC3190] | ||
audio | L24 | [RFC3190] | ||
audio | LPC | [RFC4856] | ||
audio | MELP | 8000 | 1 | [RFC8130] |
audio | MELP600 | 8000 | 1 | [RFC8130] |
audio | MELP1200 | 8000 | 1 | [RFC8130] |
audio | MELP2400 | 8000 | 1 | [RFC8130] |
audio | MP4A-LATM | [RFC3016] | ||
audio | MPA | 90000 | [RFC3555] | |
audio | mpa-robust | 90000 | [RFC5219] | |
audio | mpeg4-generic | [RFC3640][RFC5691][RFC6295] | ||
audio | parityfec | [RFC5109] | ||
audio | PCMA | [RFC4856] | ||
audio | PCMA-WB | 16000 | [RFC5391] | |
audio | PCMU | [RFC4856] | ||
audio | PCMU-WB | 16000 | [RFC5391] | |
audio | QCELP | [RFC3555] | ||
audio | raptorfec | [RFC6682] | ||
audio | RED | [RFC2198][RFC3555] | ||
audio | rtp-midi | [RFC6295] | ||
audio | rtx | [RFC4588] | ||
audio | SMV | 8000 | 1 | [RFC3558] |
audio | SMV0 | 8000 | 1 | [RFC3558] |
audio | speex | [RFC5574] | ||
audio | t140c | [RFC4351] | ||
audio | t38 | [RFC4612] | ||
audio | telephone-event | [RFC4733] | ||
audio | tone | [RFC4733] | ||
audio | uemclip | [RFC5686] | ||
audio | ulpfec | [RFC5109] | ||
audio | VDVI | 1 | [RFC3551][RFC4856] | |
audio | VMR-WB | 16000 | [RFC4348][RFC4424] | |
audio | vorbis | [RFC5215] | ||
audio | vorbis-config | [RFC5215] | ||
text | 1d-interleaved-parityfec | [RFC6015] | ||
text | fwdred | [RFC6354] | ||
text | parityfec | [RFC3009] | ||
text | raptorfec | [RFC6682] | ||
text | red | 1000 | [RFC4102] | |
text | rtx | [RFC4588] | ||
text | t140 | 1000 | [RFC4103] | |
text | ulpfec | [RFC5109] | ||
video | BMPEG | 90000 | [RFC2343][RFC3555] | |
video | 1d-interleaved-parityfec | [RFC6015] | ||
video | 3gpp-tt | [RFC4396] | ||
video | BT656 | 90000 | [RFC2431][RFC3555] | |
video | celB | [RFC3555] | ||
video | DV | 90000 | [RFC6469] | |
video | H261 | [RFC4587] | ||
video | H263 | 90000 | [RFC4628] | |
video | H263-1998 | 90000 | [RFC4629] | |
video | H263-2000 | 90000 | [RFC4629] | |
video | H264 | [RFC6184] | ||
video | H264-RCDO | 90000 | [RFC6185] | |
video | H264-SVC | [RFC6190] | ||
video | JPEG | [RFC3555] | ||
video | JPEG2000 | [RFC5371] | ||
video | MP1S | 90000 | [RFC2250][RFC3555] | |
video | MP2P | 90000 | [RFC2250][RFC3555] | |
video | MP2T | [RFC3555] | ||
video | MP4V-ES | 90000 | [RFC3016] | |
video | mpeg4-generic | [RFC3640] | ||
video | MPV | [RFC3555] | ||
video | nv | [RFC4856] | ||
video | parityfec | [RFC5109] | ||
video | pointer | 90000 | [RFC2862] | |
video | raptorfec | [RFC6682] | ||
video | raw | 90000 | [RFC4175] | |
video | rtx | [RFC4588] | ||
video | SMPTE292M | [RFC3497] | ||
video | ulpfec | [RFC5109] | ||
video | vc1 | 90000 | [RFC4425] | |
video | vc2 | 90000 | [RFC8450] |
详情请参考官方文档:https://www.ietf.org/assignments/rtp-parameters/rtp-parameters.xml
标签:Type,RFC3551,90000,video,RTP,RFC4856,audio,8000,Payload From: https://blog.51cto.com/u_13267193/5986939