SDP, RTP, RTCP, RTSP, RTMP noun explanation

Source: Internet
Author: User

Read the entry in Wikipedia and record a little note.

Sdp

Session Description Protocol Session Description Protocol

In strict terms, the SDP is not a protocol, but a format convention that describes the parameters of the streaming media. such as negotiating media types, formats, and other related attributes. These properties and parameters are often called session profile .

SDP is widely used in RTP, RTSP, SIP and other protocols.

Session description

A session is described by a series of domain values, each row, such as

<character>=<value>
    • characteris a character, lowercase and size are different in meaning.
    • valueis a string of text, and the format depends on the property type. UTF-8 encoding.
    • =There must be no whitespace on either side of the equals sign.

There are three main parts in the SDP message: Session, time, media. Each message has multiple times and media descriptions.

An optional value is indicated in the following =* . The order is as follows:

会话描述    v=  (protocol version number, currently only 0)    o=  (originator and session identifier : username, id, version number, network address)    s=  (session name : mandatory with at least one UTF-8-encoded character)    i=* (session title or short information)    u=* (URI of description)    e=* (zero or more email address with optional name of contacts)    p=* (zero or more phone number with optional name of contacts)    c=* (connection information—not required if included in all media)    b=* (zero or more bandwidth information lines)    One or more Time descriptions ("t=" and "r=" lines; see below)    z=* (time zone adjustments)    k=* (encryption key)    a=* (zero or more session attribute lines)    Zero or more Media descriptions (each one starting by an "m=" line; see below)
时间描述(必须指定)    t=  (time the session is active)    r=* (zero or more repeat times)
媒体描述    m=  (media name and transport address)    i=* (media title or information field)    c=* (connection information — optional if included at session level)    b=* (zero or more bandwidth information lines)    k=* (encryption key)    a=* (zero or more media attribute lines — overriding the Session attribute lines)
Rtp

Real-time Transport Protocol Real-time transmission protocol.

Apply to streaming media such as phones, video telephony applications, video services, and more.

    • RTP is often used in conjunction with RTCP. RTP is responsible for transmitting streaming media (e.g. audio, video), RTCP is responsible for monitoring the quality of transmission, as well as synchronization of multiple streams.
    • RTP is the infrastructure of VoIP, and often works with another session protocol in the VoIP domain, such as the SIP protocol.
    • RTP allows the use of IP multicast technology.
    • Real-time multimedia streams require time-solid, thus allowing packet loss. For example, there is a small amount of data loss in a second in an audio application and does not affect the listening experience.
    • RTP can use TCP, but it is less used because of the strong reliability of TCP. Most RTP is built on top of UDP.
    • RTP-related protocols have many, such as SIP, jingle, RTSP, h.225, h.245 and other session control protocols, in addition, such as H. A, MPEG, H.263 and other protocols commonly used to encode data, as RTP payload.

bit field size bits Description
Version 2 RTP protocol version number, current version is 2
P 1 A Padding that indicates whether the RTP packet tail has padding bytes. The last byte of the padding byte holds the number of padding bytes (including itself)
X 1 Extension, indicating if there is an extension header between the standard header and payload data (Extension header)
Cc 4 CSRC counter, indicating the number of CSRC identifiers
M 1 Marker, tag, application layer use. Indicates whether the payload has a special meaning. For video, M=1 represents the end of a frame; For audio, marks the beginning of the session.
Pt 7 Payload type, the format that carries the data. specified by the RTP profile. Ease of application resolution.
Sequence number 16 Each RTP packet is sent with a sequence number incremented by 1. The receiver uses the serial number to check the packet loss and recover the serial number. The packet is lost and RTP is not processed by the application layer. RFC3550 specifies that the initial sequence number is a random number.
Timestamp 32 The receiving party processes the received data at the appropriate interval based on the timestamp. Each stream has a separate timestamp and cannot be used for media synchronization. The granularity of time is specified by the app.
SSRC 32 Synchronization source identifier, which is used to identify a stream. The same RTP session has a unique synchronization identifier.
Csrc Each of the bits A special source of information that identifies all the special sources included in the RTP message. can have 0~15.
Header extension Optional The first 32 bits contain a 16-bit profile-spcific identifier and a 16-bit length that indicates the length of the extension header. The extension is aligned with a.
RTCP

RTP Control Protocol

RTP control protocol, used in conjunction with RTP.

RTCP has five types of packages:

RTSP

Live Streaming protocol real time streaming Protocol

RTSP is not responsible for streaming data. Most RTSP services use RTP/RTCP for streaming data.

Similar to HTTP. RTSP uses TCP for end-to-end connections, and most of the RTCP control messages are initiated by the client to the service side.
However, HTTP is stateless and RTSP is stateful. RTSP has identifiers for tracking multiple sessions.

The default transport port is 554 and the TCP protocol is used by default.

Main command:

    • OPTIONS asks what types of requests the server accepts
C->S:  OPTIONS rtsp://example.com/media.mp4 RTSP/1.0       CSeq: 1       Require: implicit-play       Proxy-Require: gzipped-messagesS->C:  RTSP/1.0 200 OK       CSeq: 1       Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE
    • The DESCRIBE contains an RTSP URL, along with the allowed return data type. The return data is generally in the SDP format.
C->S: DESCRIBE rtsp://example.com/media.mp4 RTSP/1.0      CSeq: 2S->C: RTSP/1.0 200 OK      CSeq: 2      Content-Base: rtsp://example.com/media.mp4      Content-Type: application/sdp      Content-Length: 460      m=video 0 RTP/AVP 96      a=control:streamid=0      a=range:npt=0-7.741000      a=length:npt=7.741000      a=rtpmap:96 MP4V-ES/5544      a=mimetype:string;"video/MP4V-ES"      a=AvgBitRate:integer;304018      a=StreamName:string;"hinted video track"      m=audio 0 RTP/AVP 97      a=control:streamid=1      a=range:npt=0-7.712000      a=length:npt=7.712000      a=rtpmap:97 mpeg4-generic/32000/2      a=mimetype:string;"audio/mpeg4-generic"      a=AvgBitRate:integer;65790      a=StreamName:string;"hinted audio track"
    • SETUP describes how to transfer a stream. The SETUP package must be sent before PLAY, which contains the URL and port description of the media stream. For example, a port that is used locally to receive RTP data and RTCP data. Server replies are generally used to confirm these parameters and describe the ports selected on the server.
C->S: SETUP rtsp://example.com/media.mp4/streamid=0 RTSP/1.0      CSeq: 3      Transport: RTP/AVP;unicast;client_port=8000-8001S->C: RTSP/1.0 200 OK      CSeq: 3      Transport: RTP/AVP;unicast;client_port=8000-8001;server_port=9000-9001      Session: 12345678
    • Play requests to play or resume one or more streams. If no range is specified, the start is sown to the tail. If the middle is paused, resume playback starts at the paused position.
C->S: PLAY rtsp://example.com/media.mp4 RTSP/1.0      CSeq: 4      Range: npt=5-20      Session: 12345678S->C: RTSP/1.0 200 OK      CSeq: 4      Session: 12345678      RTP-Info: url=rtsp://example.com/media.mp4/streamid=0;seq=9810092;rtptime=3450012
    • Pause pauses one or more streams. Playback can be resumed by the play command after a pause. You can specify a range to indicate when to pause. No range is specified to pause immediately.
C->S: PAUSE rtsp://example.com/media.mp4 RTSP/1.0      CSeq: 5      Session: 12345678S->C: RTSP/1.0 200 OK      CSeq: 5      Session: 12345678记录?
    • Record records a piece of media data based on descriptive information. The timestamp specifies the start and end times. If range is not specified, the start and end times in the description information are used. If the session has already started, the record starts immediately. The server determines whether the record data is stored. If you do not use this command, you should return 201.
C->S: RECORD rtsp://example.com/media.mp4 RTSP/1.0      CSeq: 6      Session: 12345678S->C: RTSP/1.0 200 OK      CSeq: 6      Session: 12345678
    • Announce this method has two functions: the client sends to the server, and the URL of the requested media data is sent. The session is updated immediately when the server is sent to the client. If a new media stream is added, the entire descriptive information should be sent instead of the added portion.
C->S: ANNOUNCE rtsp://example.com/media.mp4 RTSP/1.0      CSeq: 7      Date: 23 Jan 1997 15:35:06 GMT      Session: 12345678      Content-Type: application/sdp      Content-Length: 332      v=0      o=mhandley 2890844526 2890845468 IN IP4 126.16.64.4      s=SDP Seminar      i=A Seminar on the session description protocol      u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps      [email protected] (Mark Handley)      c=IN IP4 224.2.17.12/127      t=2873397496 2873404696      a=recvonly      m=audio 3456 RTP/AVP 0      m=video 2232 RTP/AVP 31S->C: RTSP/1.0 200 OK      CSeq: 7
    • TEARDOWN ends a session. Stops all media streams, releasing all sessions and related data.
C->S: TEARDOWN rtsp://example.com/media.mp4 RTSP/1.0      CSeq: 8      Session: 12345678S->C: RTSP/1.0 200 OK      CSeq: 8
    • Get_parameter gets the parameter value of the URI specified stream. There is no entity available to test client and server connectivity, similar to ping packets.
S->C: GET_PARAMETER rtsp://example.com/media.mp4 RTSP/1.0      CSeq: 9      Content-Type: text/parameters      Session: 12345678      Content-Length: 15      packets_received      jitterC->S: RTSP/1.0 200 OK      CSeq: 9      Content-Length: 46      Content-Type: text/parameters      packets_received: 10      jitter: 0.3838
    • Set_parameter Setting parameters
C->S: SET_PARAMETER rtsp://example.com/media.mp4 RTSP/1.0      CSeq: 10      Content-length: 20      Content-type: text/parameters      barparam: barstuffS->C: RTSP/1.0 451 Invalid Parameter      CSeq: 10      Content-length: 10      Content-type: text/parameters      barparam
    • REDIRECT indicates that the client has to connect to another service address. which specifies the URL to which the client is going to connect. If the client still wants to connect to the current URI, the client must first send TEARDOWN and SETUP requests in the current session.
S->C: REDIRECT rtsp://example.com/media.mp4 RTSP/1.0      CSeq: 11      Location: rtsp://bigserver.com:8001      Range: clock=19960213T143205Z-
    • Embedded (interleaved) Binary Data
RTMP

Live Message Protocol Real time Messaging Protocol

A streaming media transmission protocol that transmits audio, video, and data over a network. Developed by Macromedia, after the company was acquired by Adobe. Flash Player uses the protocol.

RTMP has multiple variants.
* Original RTMP works on TCP, Port 1935 is used by default
* Rtmps is the RTMP that works on the TLS/SSL connection
* Rtmpe Adobe uses private mechanism to encrypt RTMP.
* Rtmpt uses HTTP-encapsulated RTMP, which can be used to traverse firewalls using port 80 or 443 for HTTP. Encapsulated sessions may carry several packages, such as RTMP, Rtmps, or Rtmpe.

SDP, RTP, RTCP, RTSP, RTMP noun explanation

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.