Real-Time Streaming Protocol: Difference between revisions

Content deleted Content added
NW21C (talk | contribs)
Copy edits.
Citation bot (talk | contribs)
Altered author. | Use this bot. Report bugs. | Suggested by Headbomb | #UCB_toolbar
 
(One intermediate revision by one other user not shown)
Line 26:
}}
 
The '''Real-Time Streaming Protocol''' ('''RTSP''') is an [[Application layer |application-level]] network [[communications protocol |protocol]] designed for [[multiplexing]] and [[Network packet#MPEG packetized stream |packetizing]] [[multimedia]] transport streams (such as [[interactive media]], [[video]] and [[Digital audio |audio]]) over a suitable [[transport protocol]].
RTSP is used in entertainment and communications systems to control [[streaming media]] [[Web server |serverservers]]s.
The protocol is used for establishing and controlling media sessions between endpoints.
Clients of media servers issue 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]]).
 
== History ==
RTSP was developed by [[RealNetworks]], [[Netscape]]<ref name="Inc.1998">{{cite book|author=InfoWorld Media Group, Inc.|title=InfoWorld|url=https://books.google.com/books?id=DFEEAAAAMBAJ&pg=PA18|date=2 March 1998|publisher=InfoWorld Media Group, Inc.|page=18|issn=0199-6649}}</ref> and [[Columbia University]].<ref name="Osso1999">{{cite book|author=Rafael Osso|title=Handbook of Emerging Communications Technologies: The Next Decade|url=https://books.google.com/books?id=5fms2DW7mMUC&pg=PA42|year=1999|publisher=CRC Press|isbn=978-1-4200-4962-6|page=42}}</ref> The first draft was submitted to IETF in October 1996 by [[Netscape]] and [[Progressive Networks]], after which [[Henning Schulzrinne]] from [[Columbia University]] submitted "RTSP՚" ("RTSP prime") in December 1996.<ref>{{Cite news|last1=Rao|first1=Anup|last2=Lanphier|first2=Rob|title=Real Time Streaming Protocol (RTSP)|url=https://tools.ietf.org/html/draft-rao-rtsp-00.html|access-date=2021-02-23|newspaper=Ietf Datatracker|language=en}}</ref><ref>"RTSP prime" [[Henning Schulzrinne]], [[Columbia University]](http://www.cs.columbia.edu/~hgs/papers/Schu9612_RTSP.ps) December 1996</ref> The two drafts were merged for standardization by the Multiparty Multimedia Session Control Working Group (MMUSIC WG) of the [[Internet Engineering Task Force]] (IETF) and further drafts were published by the working group.<ref>{{Cite news|last1=Schulzrinne|first1=Henning|author-link=Henning Schulzrinne|last2=Rao|first2=Anup|last3=Lanphier|first3=Rob|date=1997-02-24|title=Real Time Streaming Protocol (RTSP) (draft-ietf-mmusic-rtsp-01.txt)|url=https://tools.ietf.org/html/draft-ietf-mmusic-rtsp-01.html|access-date=2021-02-23|newspaper=Ietf Datatracker|language=en}}</ref><ref>{{Cite news|last1=Schulzrinne|first1=Henning|author-link=Henning Schulzrinne|last2=Rao|first2=Anup|last3=Lanphier|first3=Rob|date=1998-01-15|title=Real Time Streaming Protocol (RTSP) (draft-ietf-mmusic-rtsp-08.txt)|url=https://tools.ietf.org/html/draft-ietf-mmusic-rtsp-08.html|access-date=2021-02-23|newspaper=Ietf Datatracker|language=en}}</ref> The [[Proposed Standard]] for RTSP was published as RFC 2326 in 1998.{{Ref RFC|2326}}
 
RTSP was developed by [[RealNetworks]], [[Netscape]] and [[Columbia University]].<ref name="Inc.1998">{{Cite book
RTSP 2.0 was 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, and remains a Proposed Standard.{{Ref RFC|7826}}
| author = InfoWorld Media Group, Inc.
| date = 2 March 1998
| issn = 0199-6649
| page = 18
| publisher = InfoWorld Media Group, Inc.
| title = InfoWorld
| url = https://books.google.com/books?id=DFEEAAAAMBAJ&pg=PA18
}}
</ref><ref name="Osso1999">
{{Cite book
| author = Rafael Osso
| isbn = 978-1-4200-4962-6
| page = 42
| publisher = CRC Press
| title = Handbook of Emerging Communications Technologies: The Next Decade
| url = https://books.google.com/books?id=5fms2DW7mMUC&pg=PA42
| year = 1999
}}
</ref>
The first draft was submitted to IETF in October 1996 by [[Netscape]] and [[Progressive Networks]], after which [[Henning Schulzrinne]] from [[Columbia University]] submitted "RTSP՚" ("RTSP prime") in December 1996.<ref>
{{Cite news
| first1 = Anup
| first2 = Rob
| language = en
| last1 = Rao
| last2 = Lanphier
| newspaper = Ietf Datatracker
| title = Real Time Streaming Protocol (RTSP)
| url = https://tools.ietf.org/html/draft-rao-rtsp-00.html|access-date=2021-02-23
}}
</ref><ref>
{{Cite web
| author = [[Henning Schulzrinne]]
| date = December 1996
| publisher = [[Columbia University]]
| title = RTSP prime
| url = http://www.cs.columbia.edu/~hgs/papers/Schu9612_RTSP.ps
}}
</ref>
The two drafts were merged for standardization by the Multiparty Multimedia Session Control Working Group (MMUSIC WG) of the [[Internet Engineering Task Force]] (IETF) and further drafts were published by the working group.<ref>
{{Cite news
| access-date = 2021-02-23
| author-link = Henning Schulzrinne
| date = 1997-02-24
| first1 = Henning
| first2 = Anup
| first3 = Rob
| language = en
| last1 = Schulzrinne
| last2 = Rao
| last3 = Lanphier
| newspaper = Ietf Datatracker
| title = Real Time Streaming Protocol (RTSP) (draft-ietf-mmusic-rtsp-01.txt)
| url = https://tools.ietf.org/html/draft-ietf-mmusic-rtsp-01.html
}}
</ref><ref>
{{Cite news
| access-date = 2021-02-23
| author-link = Henning Schulzrinne
| date = 1998-01-15
| first1 = Henning
| first2 = Anup
| first3 = Rob
| language = en
| last1 = Schulzrinne
| last2 = Rao
| last3 = Lanphier
| newspaper = Ietf Datatracker
| title = Real Time Streaming Protocol (RTSP) (draft-ietf-mmusic-rtsp-08.txt)
| url = https://tools.ietf.org/html/draft-ietf-mmusic-rtsp-08.html
}}</ref>
The [[Proposed Standard]] for RTSP was published as RFC 2326 in 1998.{{Ref RFC|2326}}
 
RTSP 2.0 was published as RFC 7826 in 2016 as a replacement of RTSP 1.0.
Version 2.0 is based on version 1.0 but is not backwards compatible other than in the basic version negotiation mechanism, and remains a Proposed Standard.{{Ref RFC|7826}}
 
{{Internet protocol suite}}
 
== RTP ==
 
{{main|Real-time Transport Protocol}}
{{Main
|Real-time Transport Protocol
}}
 
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 [[RTCP|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).
 
== Protocol directives ==
 
While similar in some ways to [[HTTP]], RTSP defines control sequences useful in controlling multimedia playback. While HTTP is [[stateless server|stateless]], RTSP has a 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).
 
Line 44 ⟶ 127:
 
=== OPTIONS ===
 
: An OPTIONS request returns the request types the server will accept.
<pre>
Line 57 ⟶ 141:
 
=== DESCRIBE ===
 
: A DESCRIBE request includes an RTSP [[URL]] <nowiki>(rtsp://...)</nowiki>, 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 streams. The media stream URLs are either obtained directly from the SDP control fields or they are obtained by appending the SDP control field to the aggregate URL.
<pre>
Line 87 ⟶ 172:
 
=== SETUP ===
 
: 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 [[Real-time Transport Protocol|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.
<pre>
Line 110 ⟶ 196:
 
=== PLAY ===
 
: 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.
<pre>
Line 124 ⟶ 211:
 
=== PAUSE ===
 
: 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.
<pre>
Line 136 ⟶ 224:
 
=== RECORD ===
 
: This method initiates recording a range of media data according to the presentation description. The timestamp reflects the 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 that describes the states of the request and refers to the new resource, and a Location header.
<pre>
Line 148 ⟶ 237:
 
=== ANNOUNCE ===
 
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.
Line 175 ⟶ 265:
 
=== TEARDOWN ===
 
: A TEARDOWN request is used to terminate the session. It stops all media streams and frees all session-related data on the server.
<pre>
Line 186 ⟶ 277:
 
=== GET_PARAMETER ===
 
: 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").
<pre>
Line 207 ⟶ 299:
 
=== SET_PARAMETER ===
 
: This method requests to set the value of a parameter for a presentation or stream specified by the URI.
<pre>
Line 225 ⟶ 318:
 
=== REDIRECT ===
 
: 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.
<pre>
Line 234 ⟶ 328:
 
=== 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.
<pre>
Line 262 ⟶ 357:
 
== RTSP over HTTP ==
 
RTSP over HTTP was defined by Apple in 1999<ref>{{Cite web |date=2013-05-01 |title=Developer - QuickTime - Letters from the Ice Floe |url=https://developer.apple.com/quicktime/icefloe/dispatch028.html |access-date=2024-09-22 |archive-url=https://web.archive.org/web/20130501053040/https://developer.apple.com/quicktime/icefloe/dispatch028.html |archive-date=2013-05-01 }}</ref> and [https://web.archive.org/web/20240215060448/https://opensource.apple.com/source/QuickTimeStreamingServer/QuickTimeStreamingServer-412.42/Documentation/RTSP_Over_HTTP.pdf]. It interleaves the RTP Video and Audio data into the RTSP Command Connection (as defined in RFC2326), and then sends the RTSP Command Connection via a pair of HTTP connections, one is a long running GET connection and the other is a long running POST connection.
 
Line 267 ⟶ 363:
 
== RTSP Encryption and RTSPS ==
 
There are several different methods for encrypting RTSP command messages and the RTP Video and Audio data.
 
Line 279 ⟶ 376:
 
==Rate adaptation==
 
RTSP using RTP and RTCP allows for the implementation of rate adaptation.<ref>{{citation |volume=40 |pages=161–168 |doi=10.1007/978-3-642-12630-7_19 |chapter = Rate Adaptation Techniques for WebTV|series = Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering|year = 2010|last1 = Santos|first1 = Hugo|last2=Cruz |first2=Rui Santos |last3=Nunes |first3=Mário Serafim |title=User Centric Media |isbn=978-3-642-12629-1 }}</ref>
 
Line 284 ⟶ 382:
 
===Server===
 
* [[Ant Media Server]]: The Community version<ref>{{Citation |title=ant-media/Ant-Media-Server |date=2024-12-12 |url=https://github.com/ant-media/Ant-Media-Server |access-date=2024-12-13 |publisher=Ant Media}}</ref> version supports pulling from RTSP/S sources and can live stream using HLS or record in MP4. [https://antmedia.io/docs/get-started/enterprise-and-community-edition/#community-edition--enterprise-edition The Enterprise version] can convert RTSP to WebRTC with approximately 200-500ms end-to-end latency.
* [[Darwin Streaming Server]]: Open-sourced version of QuickTime Streaming Server maintained by Apple.
Line 303 ⟶ 402:
 
===Client===
 
* [[Astra (software)|Astra]]
* [[cURL]] (beginning with version 7.20.0—9 February 2010<ref>[http://curl.haxx.se/changes.html cURL — Changes<!-- Bot generated title -->]</ref>)
Line 324 ⟶ 424:
 
==References==
 
{{Reflist|30em}}
 
==External links==
 
* {{cite web |url=http://www.rtsp.org |archive-url=https://web.archive.org/web/20070306002838/http://www.rtsp.org/ |archive-date=2007-03-06 |title=Real Time Streaming Protocol Information and Updates}}, a central information repository about RTSP.
* {{cite web |url=https://developer.apple.com/quicktime/icefloe/dispatch028.html |archive-url=https://web.archive.org/web/20130501053040/https://developer.apple.com/quicktime/icefloe/dispatch028.html |archive-date=2013-05-01 |title=Tunnelling RTSP and RTP through HTTP}}, A standard solution to help RTSP work through firewalls and web proxies