Skip to content

Short introduction to the set of protocols involved in libstreaming

Ioan Chera edited this page Jan 27, 2015 · 6 revisions

Table of Contents generated with DocToc

The RTSP protocol

The RTSP protocol is an application-layer protocol working over TCP and that resembles a lot to HTTP. RTSP request contains headers and a body just like HTTP requests but instead of defining methods like POST and GET, it defines ANNOUNCE, SETUP, RECORD, DESCRIBE, PLAY, STOP, etc. Those methods allow for example a RTSP client to request a certain stream to a media server. That is actually what happens when you use the Android Youtube app. A RTSP client can also announce a stream, in this case it is the client that will stream to the server. This is what happens in the example 3: the RTSP client of libstreaming will reach a Wowza Media server and announce that a stream will be sent to it. You can find out exactly what methods of the RTSP server of Wowza will be called simply by looking in the implementation of the RTSP client.

The SDP protocol

The SDP protocol is an application-layer protocol for controlling a session between some peers, a session is basically a set of media streams. SDP, among other things, carries parameters that are needed to process the streams of the session. A typical use of SDP is, for example, when a peer wants to send synchronized audio and video streams to some receiver, he will produce a description of that session using SDP and hand it to the receiver, this is what happens in the example 3.

Here are some of the things that this description would carry:

  • The protocol stack used for the audio stream, for example RTP over UDP, or RTP over TCP...
  • The destination ports of the UDP packets for the audio stream (if UDP is used)
  • How audio is encoded, and parameters that the decoder needs to initialize the decoder
  • The protocol stack used for the video stream, for example RTP over UDP, or RTP over TCP...
  • The destination ports of the UDP packets for the video stream (if UDP is used)
  • How video is encoded, and parameters that the decoder needs to initialize the decoder. For instance, an H.264 decoder needs parameters you may have heard about to decode the stream: the SPS and the PPS.

The RTSP protocol uses SDP to exchange session description between the client and the server, and also some mechanics of its own. For example, the source and destination port of a stream are negociated during the SETUP request specified in the RTSP protocol. That is why SDPs exchanged with RTSP may contain a destination port equal to 0, the RTSP protocol handles ports negociation, so there is no need to use SDP for that as well.

The RTP protocol

Coming soon !

The RTCP protocol

Coming soon !

The RTMP protocol

Coming soon !