SDP Protocol parsing

Source: Internet
Author: User
Tags character set session id
SDP Protocol Introduction of SDP protocol

The SDP is completely a session description format (corresponding to the RFC2327)-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 Extended 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.

The streaming media protocol SDP information, which is attached to the describe message, is issued by the RTSP server, the main purpose of which is to inform the existence of the session and to give the information necessary to participate in the session, the SDP session is completely textual, with the UTF-8 encoded ISO 10646 character set SDP descriptor includes: the session name and destination session activation time section constitutes the session of the media that receives the information (address, port, format) that the session uses for the bandwidth information the session owner's contact information media information includes: media type (video, audio, etc.) Transfer Protocol (rtp/udp/ IP h.320, etc.) Media Format (h,264 video, MPEG video, etc.) media address and Port 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]

Type: This byte is a single byte (such as: V,o, M, etc.) is case-sensitive, and the two sides of the number are allowed to have spaces

Value: Introduction to structured text string session description format

name format: Description
Protocol version: V=0 Given the version number of the SDP, currently 0, no sub-version number
Session Source o= (user name) (session ID) (version) (Network type) (address type) (address) If the user logon name does not exist, the field flag bit "-" session is identified as a random number string version of the version of the session bulletin \ r \ n The network type is a text string, \ n "in" means the Internet address type is a text string, currently defined as "IP4" and "IP6" two addresses
Session Name: S= (Session name) Each session description must have only one session name
Session Information: I= (Session information) This field is not required and is recommended for describing the corresponding conversational textual description, with a maximum of one per session descriptive
URL:: u= (URL) This field is not required and provides a URL for describing information
Connection data: c= (Network type) (address type) (connection address)
Time DescriptionT = (session activity time) r = * (0 or more repetitions) Media Descriptionm = (media name and transport address) i = * (media title) c = * (connection information-optional if included in session layer) B = * (bandwidth information) k = * (encryption key) A = * (0 or more session property rows) m describing line:

Format: m= (Media) (port) (Transport Layer) (format list)

Media type: Audio, video, applications, data and control

PORT: Media Transport Layer Port

Transport Layer: IP4 is mostly based on the RTP/UDP (RTP/AVP) IETF RTP protocol, transmitted over UDP
Format list: corresponds to the corresponding audio load type (PT)

M=video 0 RTP/AVP a describing the line:

Format: A=rtpmap: (payload type) (encoded name)/(clock rate) "/(Encoding parameter)"

A=control: (Audio/video connection information)
A=control:rtsp://192.168.1.197/h264stream0/trackid=0

a=rtpmap:96 h264/90000 Three, SDP protocol examples

 v=0 o=streamingserver 3677033027 1437537780000 in IP4 192.168.1.44 s=\demo.mp4 u=http:///e=ad min@ c=in IP4 0.0.0.0 b=as:1398 t=0 0 a=control:* a=x-copyright:mp4/3gp File hinted with GPAC 0.5.0-rev4065 (c) 2000-2005 -Http://gpac.sourceforge.net a=range:npt=0-216.52167 m=video 0 RTP/AVP b=as:1242 a=3gpp-adaptation-support:1 a=rtpm ap:96 h264/90000 a=control:trackid=65536 a=fmtp:96 profile-level-id=42000a; packetization-mode=1; sprop-parameter-sets=z0iacpzubqhoga==,am44ga== a=framesize:96 640-480 m=audio 0 RTP/AVP b=AS:156 a= 3gpp-adaptation-support:1 a=rtpmap:97 mpeg4-generic/48000/1 a=control:trackid=65537 a=fmtp:97 profile-level-id=41; config=1188; streamtype=5; MODE=AAC-HBR; objecttype=64; constantduration=1024; sizelength=13; indexlength=3; Indexdeltalength=3 
Video "a=fmtp" field parsing reference RFC3984 8.2 section
Audio conf An IG Descriptor parsing reference RFC 3016

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.