Real Time Streaming Protocol
Last updated on 10 February 2017
The Real Time Streaming Protocol (RTSP) is a network control protocol designed for use in entertainment and communications systems to control streaming media servers. The protocol is used for establishing and controlling media sessions between end points. Clients of media servers issue VCR-style commands, such as play, record and pause, to facilitate real-time control of the media streaming from the server to a client (Video On Demand) or from a client to the server (Voice Recording).
The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) for media stream delivery. However, some vendors implement proprietary transport protocols. The RTSP server software from RealNetworks, for example, also used RealNetworks' proprietary Real Data Transport (RDT).
RTSP was developed by RealNetworks, Netscape and Columbia University, with the first draft submitted to IETF in 1996. It was standardized by the Multiparty Multimedia Session Control Working Group (MMUSIC WG) of the Internet Engineering Task Force (IETF) and published as RFC 2326 in 1998. RTSP 2.0 published as RFC 7826 in 2016 as a replacement of RTSP 1.0. RTSP 2.0 is based on RTSP 1.0 but is not backwards compatible other than in the basic version negotiation mechanism.
While similar in some ways to HTTP, RTSP defines control sequences useful in controlling multimedia playback. While HTTP is stateless, RTSP has state; an identifier is used when needed to track concurrent sessions. Like HTTP, RTSP uses TCP to maintain an end-to-end connection and, while most RTSP control messages are sent by the client to the server, some commands travel in the other direction (i.e. from server to client).
Presented here are the basic RTSP requests. Some typical HTTP requests, like the OPTIONS request, are also available. The default transport layer port number is 554 for both TCP and UDP, the latter being rarely used for the control requests.
- An OPTIONS request returns the request types the server will accept.
- A DESCRIBE request includes an RTSP URL (rtsp://...), and the type of reply data that can be handled. This reply includes the presentation description, typically in Session Description Protocol (SDP) format. Among other things, the presentation description lists the media streams controlled with the aggregate URL. In the typical case, there is one media stream each for audio and video.
- A SETUP request specifies how a single media stream must be transported. This must be done before a PLAY request is sent. The request contains the media stream URL and a transport specifier. This specifier typically includes a local port for receiving RTP data (audio or video), and another for RTCP data (meta information). The server reply usually confirms the chosen parameters, and fills in the missing parts, such as the server's chosen ports. Each media stream must be configured using SETUP before an aggregate play request may be sent.
- A PLAY request will cause one or all media streams to be played. Play requests can be stacked by sending multiple PLAY requests. The URL may be the aggregate URL (to play all media streams), or a single media stream URL (to play only that stream). A range can be specified. If no range is specified, the stream is played from the beginning and plays to the end, or, if the stream is paused, it is resumed at the point it was paused.
- A PAUSE request temporarily halts one or all media streams, so it can later be resumed with a PLAY request. The request contains an aggregate or media stream URL. A range parameter on a PAUSE request specifies when to pause. When the range parameter is omitted, the pause occurs immediately and indefinitely.
- This method initiates recording a range of media data according to the presentation description. The time stamp reflects start and end time(UTC). If no time range is given, use the start or end time provided in the presentation description. If the session has already started, commence recording immediately. The server decides whether to store the recorded data under the request URI or another URI. If the server does not use the request URI, the response should be 201 and contain an entity which describes the states of the request and refers to the new resource, and a Location header.
- The ANNOUNCE method serves two purposes:
- When sent from client to server, ANNOUNCE posts the description of a presentation or media object identified by the request URL to a server. When sent from server to client, ANNOUNCE updates the session description in real-time. If a new media stream is added to a presentation (e.g., during a live presentation), the whole presentation description should be sent again, rather than just the additional components, so that components can be deleted.
- A TEARDOWN request is used to terminate the session. It stops all media streams and frees all session related data on the server.
- The GET_PARAMETER request retrieves the value of a parameter of a presentation or stream specified in the URI. The content of the reply and response is left to the implementation. GET_PARAMETER with no entity body may be used to test client or server liveness ("ping").
- This method requests to set the value of a parameter for a presentation or stream specified by the URI.
- A REDIRECT request informs the client that it must connect to another server location. It contains the mandatory header Location, which indicates that the client should issue requests for that URL. It may contain the parameter Range, which indicates when the redirection takes effect. If the client wants to continue to send or receive media for this URI, the client MUST issue a TEARDOWN request for the current session and a SETUP for the new session at the designated host.
- Embedded (Interleaved) Binary Data
- Certain firewall designs and other circumstances may force a server to interleave RTSP methods and stream data. This interleaving should generally be avoided unless necessary since it complicates client and server operation and imposes additional overhead. Interleaved binary data SHOULD only be used if RTSP is carried over TCP. Stream data such as RTP packets is encapsulated by an ASCII dollar sign (24 hexadecimal), followed by a one-byte channel identifier, followed by the length of the encapsulated binary data as a binary, two-byte integer in network byte order. The stream data follows immediately afterwards, without a CRLF, but including the upper-layer protocol headers. Each $ block contains exactly one upper-layer protocol data unit, e.g., one RTP packet.
RTSP using RTP and RTCP allows for the implementation of rate adaptation.
- Darwin Streaming Server: Open-sourced version of QuickTime Streaming Server maintained by Apple.
- Erlyvideo has RTSP client and can restream video to other protocols.
- Feng: Lean and mean streaming server with focus on rfc compliance.
- FFmpeg: includes ffserver a GPL or LGPL RTSP streaming server.
- GStreamer based RTSP Server and client.
- Helix DNA Server: RealNetworks' streaming server. Comes in both open-source and proprietary flavors.
- Helix Universal Server: RealNetworks commercial streaming server for RTSP, RTMP, iOS, Silverlight and HTTP streaming media clients
- LEADTOOLS Media Streaming Server SDK from LEAD Technologies supports RTSP/RTP, RTSP/RTP (MPEG-2 Transport), RTSP/RTP over HTTP.
- LIVE555 liveMedia / openRTSP: Open source C++ server and client libraries used in well-known clients like VLC and mplayer.
- Managed Media Aggregation: .NET C# RFC compliant implementation of RTSP written in completely managed code.
- Nimble Streamer supports RTSP pull and announce input with TCP interleaved playback output.
- pvServer: Formerly called PacketVideo Streaming Server, this is Alcatel-Lucent's streaming server product.
- QuickTime Streaming Server: Apple's closed-source streaming server that ships with Mac OS X Server.
- SharpRTSP: Open sourceC# RTSP streaming server.
- ViaMotion: Integrated RTSP server for Video On Demand by Anevia
- VideoLAN: Open source media player and streaming server.
- VX30: Streaming video server and embedded Java client from Maui X-Stream.
- Windows Media Services: Microsoft streaming server previously included with Windows Server that uses RTSP modified with Windows Media extensions
- Wowza Streaming Engine: Multi-format streaming server for RTSP/RTP, RTMP, MPEG-TS, ICY, HTTP (HTTP Live Streaming, HTTP Dynamic Streaming, Smooth Streaming, MPEG-DASH), WebRTC
- Xenon Streaming Server: Mobile streaming server from Vidiator Technology (US) Inc.
- YouTube: Available streaming option when viewing site through the mobile HTTPS version on a desktop.
Content from Wikipedia