SDP 协议分析
SDP 完全是一种会话描述格式 �D 它不属于传输协议 �D 它只使用不同的适当的传输协议,包括会话通知协议(SAP)、会话初始协议(SIP)、实时流协议(RTSP)、MIME 扩展协议的电子邮件以及超文本传输协议(HTTP)。SDP协议是也是基于文本的协议,这样就能保证协议的可扩展性比较强,这样就使其具有广泛的应用范围。SDP 不支持会话内容或媒体编码的协商,所以在流媒体中只用来描述媒体信息。媒体协商这一块要用RTSP来实现.
SDP描述由许多文本行组成,文本行的格式为<类型>=<值>,<类型>是一个字母,<值>是结构化的文本串,其格式依<类型>而定。
<type>=<value>[CRLF]
常见的fields有:
下面是一个helix 流媒体服务器的RTSP协议中的SDP协议:
v=0 //SDP version
// o field定义的源的一些信息。其格式为:o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>
o=- 1271659412 1271659412 IN IP4 10.56.136.37 s=<No title>
i=<No author> <No copyright> //session的信息
c=IN IP4 0.0.0.0 //connect 的信息,分别描述了:网络协议,地址的类型,连接地址。
c=IN IP4 0.0.0.0
t=0 0 //时间信息,分别表示开始的时间和结束的时间,一般在流媒体的直播的时移中见的比较多。
a=SdpplinVersion:1610641560 //描述性的信息
a=StreamCount:integer;2 //用来描述媒体流的信息,表示有两个媒体流。integer表示信息的格式为整数。
a=control:*
a=DefaultLicenseValue:integer;0 //License信息
a=FileType:string;"MPEG4" ////用来描述媒体流的信息说明当前协商的文件是mpeg4格式的文件
a=LicenseKey:string;"license.Summary.Datatypes.RealMPEG4.Enabled"
a=range:npt=0-72.080000 //用来表示媒体流的长度
m=audio 0 RTP/AVP 96 //做为媒体描述信息的重要组成部分描述了媒体信息的详细内容:表示session的audio是通过RTP来格式传送的,其payload值为96传送的端口还没有定。
b=as:24 //audio 的bitrate
b=RR:1800
b=RS:600
a=control:streamid=1 //通过媒体流1来发送音频
a=range:npt=0-72.080000 //说明媒体流的长度。
a=length:npt=72.080000
a=rtpmap:96 MPEG4-GENERIC/32000/2 //rtpmap的信息,表示音频为AAC的其sample为32000
a=fmtp:96 profile-level-id=15;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1210 //config为AAC的详细格式信息
a=mimetype:string;"audio/MPEG4-GENERIC"
a=Helix-Adaptation-Support:1
a=AvgBitRate:integer;48000
a=HasOutOfOrderTS:integer;1
a=MaxBitRate:integer;48000
a=Preroll:integer;1000
a=OpaqueData:buffer;"A4CAgCIAAAAEgICAFEAVABgAAAC7gAAAu4AFgICAAhKIBoCAgAEC"
a=StreamName:string;"Audio Track"
下面是video的信息基本和audio的信息相对称,这里就不再说了。
m=video 0 RTP/AVP 97
b=as:150
b=RR:11250
b=RS:3750
a=control:streamid=2
a=range:npt=0-72.080000
a=length:npt=72.080000
a=rtpmap:97 MP4V-ES/2500
a=fmtp:97 profile-level-id=1;
a=mimetype:string;"video/MP4V-ES"
a=Helix-Adaptation-Support:1
a=AvgBitRate:integer;300000
a=HasOutOfOrderTS:integer;1
a=Height:integer;240 //影片的长度
a=MaxBitRate:integer;300000
a=MaxPacketSize:integer;1400
a=Preroll:integer;1000
a=Width:integer;320 //影片的宽度
a=OpaqueData:buffer;"AzcAAB8ELyARAbd0AAST4AAEk+AFIAAAAbDzAAABtQ7gQMDPAAABAAAAASAAhED6KFAg8KIfBgEC"
a=StreamName:string;"Video Track"
2012-03-20 14:352270人阅读评论(0)收藏举报
audiovideotypesh.264encodingcodec
Payload type (PT) | Name | Type | No. of channels | Clock rate (Hz) | Description | References |
---|---|---|---|---|---|---|
0 | PCMU | audio | 1 | 8000 | ITU-T G.711 PCM-Law Audio 64 kbit/s | RFC 3551 |
1 | reserved (previously 1016) | audio | 1 | 8000 | reserved, previously CELP Audio 4.8 kbit/s | RFC 3551, previouslyRFC 1890 |
2 | reserved (previously G721) | audio | 1 | 8000 | reserved, previously ITU-T G.721 ADPCM Audio 32 kbit/s | RFC 3551, previouslyRFC 1890 |
3 | GSM | audio | 1 | 8000 | European GSM Full Rate Audio 13 kbit/s (GSM 06.10) | RFC 3551 |
4 | G723 | audio | 1 | 8000 | ITU-T G.723.1 | RFC 3551 |
5 | DVI4 | audio | 1 | 8000 | IMAADPCM Audio 32 kbit/s | RFC 3551 |
6 | DVI4 | audio | 1 | 16000 | IMAADPCM 64 kbit/s | RFC 3551 |
7 | LPC | audio | 1 | 8000 | Experimental Linear Predictive Coding Audio | RFC 3551 |
8 | PCMA | audio | 1 | 8000 | ITU-T G.711 PCM A-Law Audio 64 kbit/s | RFC 3551 |
9 | G722 | audio | 1 | 8000 | ITU-T G.722 Audio | RFC 3551 - Page 14 |
10 | L16 | audio | 2 | 44100 | Linear PCM 16-bit Stereo Audio 1411.2 kbit/s,[2][3][4] uncompressed | RFC 3551, Page 27 |
11 | L16 | audio | 1 | 44100 | Linear PCM 16-bit Audio 705.6 kbit/s, uncompressed | RFC 3551, Page 27 |
12 | QCELP | audio | 1 | 8000 | Qualcomm Code Excited Linear Prediction | RFC 2658,RFC 3551 |
13 | CN | audio | 1 | 8000 | Comfort noise | RFC 3389 |
14 | MPA | audio | 1 | 90000 | MPEG-1 or MPEG-2 Audio Only | RFC 3551,RFC 2250 |
15 | G728 | audio | 1 | 8000 | ITU-T G.728 Audio 16 kbit/s | RFC 3551 |
16 | DVI4 | audio | 1 | 11025 | IMAADPCM | RFC 3551 |
17 | DVI4 | audio | 1 | 22050 | IMA ADPCM | RFC 3551 |
18 | G729 | audio | 1 | 8000 | ITU-T G.729 and G.729a | RFC 3551, Page 20 |
25 | CELB | video | 1 | 90000 | Sun's CellB Video Encoding[5] | RFC 2029 |
26 | JPEG | video | 1 | 90000 | JPEG Video | RFC 2435 |
28 | NV | video | 1 | 90000 | Xerox PARC's Network Video (nv)[6] | RFC 3551, Page 32 |
31 | H261 | video | 1 | 90000 | ITU-T H.261 Video | RFC 4587 |
32 | MPV | video | 1 | 90000 | MPEG-1 and MPEG-2 Video | RFC 2250 |
33 | MP2T | audio/video | 1 | 90000 | MPEG-2 transport stream Video | RFC 2250 |
34 | H263 | video | 90000 | H.263 video, first version (1996) | RFC 3551,RFC 2190 | |
dynamic | H263-1998 | video | 90000 | H.263 video, second version (1998) | RFC 3551,RFC 4629,RFC 2190 | |
dynamic | H263-2000 | video | 90000 | H.263 video, third version (2000) | RFC 4629 | |
dynamic (or profile) | H264 | video | 90000 | H.264 video (MPEG-4 Part 10) | RFC 3984 | |
dynamic (or profile) | theora | video | 90000 | Theora video | draft-barbato-avt-rtp-theora-01 | |
dynamic | iLBC | audio | 1 | ― | Internet low Bitrate Codec 13.33 or 15.2 kbit/s | RFC 3951 |
dynamic | PCMA-WB | audio | 16000 | ITU-T G.711.1, A-law | RFC 5391 | |
dynamic | PCMU-WB | audio | 16000 | ITU-T G.711.1, -law | RFC 5391 | |
dynamic | G718 | audio | 32000 | ITU-T G.718 | draft-ietf-avt-rtp-g718-03 | |
dynamic | G719 | audio | (various) | 48000 | ITU-T G.719 | RFC 5404 |
dynamic | G7221 | audio | 16 or 32 kHz | ITU-T G.722.1 | RFC 5577 | |
dynamic | G726-16 | audio | 1 | 8000 | ITU-T G.726 audio with 16 kbit/s | RFC 3551 |
dynamic | G726-24 | audio | 1 | 8000 | ITU-T G.726 audio with 24 kbit/s | RFC 3551 |
dynamic | G726-32 | audio | 1 | 8000 | ITU-T G.726 audio with 32 kbit/s | RFC 3551 |
dynamic | G726-40 | audio | 1 | 8000 | ITU-T G.726 audio with 40 kbit/s | RFC 3551 |
dynamic | G729D | audio | 1 | 8000 | ITU-T G.729 Annex D | RFC 3551 |
dynamic | G729E | audio | 1 | 8000 | ITU-T G.729 Annex E | RFC 3551 |
dynamic | G7291 | audio | (various) | ITU-T G.729.1 | RFC 4749 | |
dynamic | GSM-EFR | audio | 1 | 8000 | ITU-T GSM-EFR (GSM 06.60) | RFC 3551 |
dynamic | GSM-HR-08 | audio | 1 | 8000 | ITU-T GSM-HR (GSM 06.20) | RFC 5993 |
dynamic (or profile) | AMR | audio | (various) | 8000 | Adaptive Multi-Rate audio | RFC 4867 |
dynamic (or profile) | AMR-WB | audio | (various) | 16000 | Adaptive Multi-Rate Wideband audio (ITU-T G.722.2) | RFC 4867 |
dynamic (or profile) | AMR-WB+ | audio | 1, 2 or omit | 72000 | Extended Adaptive Multi Rate �C WideBand audio | RFC 4352 |
dynamic (or profile) | vorbis | audio | (various) | from 8 kHz to 192 kHz | RTP Payload Format for Vorbis Encoded Audio | RFC 5215 |
dynamic (or profile) | speex | audio | 1 | 8000, 16000 or 32000 | RTP Payload Format for the Speex Codec | RFC 5574 |
dynamic (96-127) | mpa-robust | audio | 90000 | A More Loss-Tolerant RTP Payload Format for MP3 Audio | RFC 5219 | |
dynamic (or profile) | MP4A-LATM | audio | 90000 or others | RTP Payload Format for MPEG-4 Audio | RFC 3016 | |
dynamic (or profile) | MP4V-ES | video | 90000 or others | RTP Payload Format for MPEG-4 Visual | RFC 3016 | |
dynamic (or profile) | mpeg4-generic | audio/video | 90000 or other | RTP Payload Format for Transport of MPEG-4 Elementary Streams | RFC 3640 | |
dynamic | L8 | audio | (various) | (various) | Linear PCM 8-bit audio with 128 offset | RFC 3551 Section 4.5.10 and Table 5 |
dynamic | DAT12 | audio | (various) | 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000 or others | IEC 61119 12-bit nonlinear audio | RFC 3190 Section 3 |
dynamic | L16 | audio | (various) | 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000 or others | Linear PCM 16-bit audio | RFC 3551 Section 4.5.11,RFC 2586 |
dynamic | L20 | audio | (various) | 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000 or others | Linear PCM 20-bit audio | RFC 3190 Section 4 |
dynamic | L24 | audio | (various) | 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000 or others | Linear PCM 24-bit audio | RFC 3190 Section 4 |