Reprint address (http://www.cnblogs.com/qingquan/archive/2011/08/02/2125585.html) I. Introduction of SDP protocol
The SDP is completely a session description format-it is not a transport protocol-it uses only different appropriate transport protocols, including session Notification Protocol (SAP), Session Initiation Protocol (SIP), real-time Streaming Protocol (RTSP), MIME Extension Protocol e-mail, and Hypertext Transfer Protocol (HTTP). SDP protocol is also a text-based protocol, so that the scalability of the protocol is relatively strong, so that it has a wide range of applications. The SDP does not support negotiation of session content or media encoding, so it is used only to describe media information in streaming media. Media consultation this piece is to be implemented with RTSP.
II. SDP Protocol format
The SDP description consists of a number of lines of text, the format of the text line is < type >=< value >,< type > is a letter,< value > is a structured text string whose format depends on the < type >.
=<value>[crlf]
The common fields are:
Iii. Examples of SDP protocols:
The following is an SDP protocol in the RTSP protocol for a Helix streaming server:
V=0//SDP Version
o field defines some information for the source. The format is: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 Information
C=in IP4 0.0.0.0//connect information, respectively, describes: network protocol, the type of address, the connection address.
C=in IP4 0.0.0.0
T=0 0//time information, respectively, indicates the start time and the end time, generally in the streaming media live time to see more.
a=sdpplinversion:1610641560//Descriptive information
A=STREAMCOUNT:INTEGER;2//is used to describe the media stream, which indicates that there are two media streams. The integer represents the format of the information as an integer.
a=control:*
A=defaultlicensevalue:integer;0//license Information
a=filetype:string; " MPEG4 "////describes the media stream to indicate that the currently negotiated file is a MPEG4 formatted file
a=licensekey:string; " License. Summary.Datatypes.RealMPEG4.Enabled "
a=range:npt=0-72.080000//To indicate the length of the media stream
M=audio 0 RTP/AVP 96//As an important part of the media description information, the details of the media information are described: The audio of the session is transmitted through RTP format, and the port with the payload value of 96 is not determined.
B=as:24//audio's bitrate
b=rr:1800
b=rs:600
A=control:streamid=1//Send audio via media streaming
a=range:npt=0-72.080000//Describes the length of the media stream.
a=length:npt=72.080000
a=rtpmap:96 MPEG4-GENERIC/32000/2//rtpmap, which indicates that the audio is AAC with a sample of 32000
a=fmtp:96 profile-level-id=15;mode=aac-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1210// Config is the detailed format information for 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 "
The following is a video of the basic and audio information is relatively said, here is no longer said.
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//Length of the film
a=maxbitrate:integer;300000
a=maxpacketsize:integer;1400
a=preroll:integer;1000
a=width:integer;320//width of the film
A=opaquedata:buffer; " Azcaab8elyarabd0aast4aaek+afiaaaabdzaaabtq7gqmdpaaabaaaaasaahed6kfag8kifbgec "
a=streamname:string; " Video track "
SDP Protocol Analysis