As per Relevance of the word parameter, we have this rfc below:
Network Working Group H.
Request for Comments: 2326 Columbia U
Category: Standards Track A.
R.
April 1998
Real Time Streaming Protocol (RTSP
Status of this
This document specifies an Internet standards track protocol for
Internet community, and requests discussion and suggestions
improvements. Please refer to the current edition of the "
Official Protocol Standards" (STD 1) for the standardization
and status of this protocol. Distribution of this memo is unlimited
Copyright
Copyright (C) The Internet Society (1998). All Rights Reserved
The Real Time Streaming Protocol, or RTSP, is an application-
protocol for control over the delivery of data with real-
properties. RTSP provides an extensible framework to
controlled, on-demand delivery of real-time data, such as audio
video. Sources of data can include both live data feeds and
clips. This protocol is intended to control multiple data
sessions, provide a means for choosing delivery channels such as UDP
multicast UDP and TCP, and provide a means for choosing
mechanisms based upon RTP (RFC 1889).
Table of
* 1 Introduction ................................................. 5
+ 1.1 Purpose ............................................... 5
+ 1.2 Requirements .......................................... 6
+ 1.3 Terminology ........................................... 6
+ 1.4 Protocol Properties ................................... 9
+ 1.5 Extending RTSP ........................................ 11
+ 1.6 Overall Operation ..................................... 11
+ 1.7 RTSP States ........................................... 12
+ 1.8 Relationship with Other Protocols ..................... 13
* 2 Notational Conventions ....................................... 14
* 3 Protocol Parameters .......................................... 14
+ 3.1 RTSP Version .......................................... 14
Schulzrinne, et. al. Standards Track [Page 1]
RFC 2326 Real Time Streaming Protocol April 1998
+ 3.2 RTSP URL .............................................. 14
+ 3.3 Conference Identifiers ................................ 16
+ 3.4 Session Identifiers ................................... 16
+ 3.5 SMPTE Relative Timestamps ............................. 16
+ 3.6 Normal Play Time ...................................... 17
+ 3.7 Absolute Time ......................................... 18
+ 3.8 Option Tags ........................................... 18
o 3.8.1 Registering New Option Tags with IANA .......... 18
* 4 RTSP Message ................................................. 19
+ 4.1 Message Types ......................................... 19
+ 4.2 Message Headers ....................................... 19
+ 4.3 Message Body .......................................... 19
+ 4.4 Message Length ........................................ 20
* 5 General Header Fields ........................................ 20
* 6 Request ...................................................... 20
+ 6.1 Request Line .......................................... 21
+ 6.2 Request Header Fields ................................. 21
* 7 Response ..................................................... 22
+ 7.1 Status-Line ........................................... 22
o 7.1.1 Status Code and Reason Phrase .................. 22
o 7.1.2 Response Header Fields ......................... 26
* 8 Entity ....................................................... 27
+ 8.1 Entity Header Fields .................................. 27
+ 8.2 Entity Body ........................................... 28
* 9 Connections .................................................. 28
+ 9.1 Pipelining ............................................ 28
+ 9.2 Reliability and Acknowledgements ...................... 28
* 10 Method Definitions .......................................... 29
+ 10.1 OPTIONS .............................................. 30
+ 10.2 DESCRIBE ............................................. 31
+ 10.3 ANNOUNCE ............................................. 32
+ 10.4 SETUP ................................................ 33
+ 10.5 PLAY ................................................. 34
+ 10.6 PAUSE ................................................ 36
+ 10.7 TEARDOWN ............................................. 37
+ 10.8 GET_PARAMETER ........................................ 37
+ 10.9 SET_PARAMETER ........................................ 38
+ 10.10 REDIRECT ............................................ 39
+ 10.11 RECORD .............................................. 39
+ 10.12 Embedded (Interleaved) Binary Data .................. 40
* 11 Status Code Definitions ..................................... 41
+ 11.1 Success 2xx .......................................... 41
o 11.1.1 250 Low on Storage Space ...................... 41
+ 11.2 Redirection 3xx ...................................... 41
+ 11.3 Client Error 4xx ..................................... 42
o 11.3.1 405 Method Not Allowed ........................ 42
o 11.3.2 451 Parameter Not Understood .................. 42
o 11.3.3 452 Conference Not Found ...................... 42
Schulzrinne, et. al. Standards Track [Page 2]
RFC 2326 Real Time Streaming Protocol April 1998
o 11.3.4 453 Not Enough Bandwidth ...................... 42
o 11.3.5 454 Session Not Found ......................... 42
o 11.3.6 455 Method Not Valid in This State ............ 42
o 11.3.7 456 Header Field Not Valid for Resource ....... 42
o 11.3.8 457 Invalid Range ............................. 43
o 11.3.9 458 Parameter Is Read-Only .................... 43
o 11.3.10 459 Aggregate Operation Not Allowed .......... 43
o 11.3.11 460 Only Aggregate Operation Allowed ......... 43
o 11.3.12 461 Unsupported Transport .................... 43
o 11.3.13 462 Destination Unreachable .................. 43
o 11.3.14 551 Option not supported ..................... 43
* 12 Header Field Definitions .................................... 44
+ 12.1 Accept ............................................... 46
+ 12.2 Accept-Encoding ...................................... 46
+ 12.3 Accept-Language ...................................... 46
+ 12.4 Allow ................................................ 46
+ 12.5 Authorization ........................................ 46
+ 12.6 Bandwidth ............................................ 46
+ 12.7 Blocksize ............................................ 47
+ 12.8 Cache-Control ........................................ 47
+ 12.9 Conference ........................................... 49
+ 12.10 Connection .......................................... 49
+ 12.11 Content-Base ........................................ 49
+ 12.12 Content-Encoding .................................... 49
+ 12.13 Content-Language .................................... 50
+ 12.14 Content-Length ...................................... 50
+ 12.15 Content-Location .................................... 50
+ 12.16 Content-Type ........................................ 50
+ 12.17 CSeq ................................................ 50
+ 12.18 Date ................................................ 50
+ 12.19 Expires ............................................. 50
+ 12.20 From ................................................ 51
+ 12.21 Host ................................................ 51
+ 12.22 If-Match ............................................ 51
+ 12.23 If-Modified-Since ................................... 52
+ 12.24 Last-Modified........................................ 52
+ 12.25 Location ............................................ 52
+ 12.26 Proxy-Authenticate .................................. 52
+ 12.27 Proxy-Require ....................................... 52
+ 12.28 Public .............................................. 53
+ 12.29 Range ............................................... 53
+ 12.30 Referer ............................................. 54
+ 12.31 Retry-After ......................................... 54
+ 12.32 Require ............................................. 54
+ 12.33 RTP-Info ............................................ 55
+ 12.34 Scale ............................................... 56
+ 12.35 Speed ............................................... 57
+ 12.36 Server .............................................. 57
Schulzrinne, et. al. Standards Track [Page 3]
RFC 2326 Real Time Streaming Protocol April 1998
+ 12.37 Session ............................................. 57
+ 12.38 Timestamp ........................................... 58
+ 12.39 Transport ........................................... 58
+ 12.40 Unsupported ......................................... 62
+ 12.41 User-Agent .......................................... 62
+ 12.42 Vary ................................................ 62
+ 12.43 Via ................................................. 62
+ 12.44 WWW-Authenticate .................................... 62
* 13 Caching ..................................................... 62
* 14 Examples .................................................... 63
+ 14.1 Media on Demand (Unicast) ............................ 63
+ 14.2 Streaming of a Container file ........................ 65
+ 14.3 Single Stream Container Files ........................ 67
+ 14.4 Live Media Presentation Using Multicast .............. 69
+ 14.5 Playing media into an existing session ............... 70
+ 14.6 Recording ............................................ 71
* 15 Syntax ...................................................... 72
+ 15.1 Base Syntax .......................................... 72
* 16 Security Considerations ..................................... 73
* A RTSP Protocol State Machines ................................. 76
+ A.1 Client State Machine .................................. 76
+ A.2 Server State Machine .................................. 77
* B Interaction with RTP ......................................... 79
* C Use of SDP for RTSP Session Descriptions ..................... 80
+ C.1 Definitions ........................................... 80
o C.1.1 Control URL .................................... 80
o C.1.2 Media streams .................................. 81
o C.1.3 Payload type(s) ................................ 81
o C.1.4 Format-specific parameters ..................... 81
o C.1.5 Range of presentation .......................... 82
o C.1.6 Time of availability ........................... 82
o C.1.7 Connection Information ......................... 82
o C.1.8 Entity Tag ..................................... 82
+ C.2 Aggregate Control Not Available ....................... 83
+ C.3 Aggregate Control Available ........................... 83
* D Minimal RTSP implementation .................................. 85
+ D.1 Client ................................................ 85
o D.1.1 Basic Playback ................................. 86
o D.1.2 Authentication-enabled ......................... 86
+ D.2 Server ................................................ 86
o D.2.1 Basic Playback ................................. 87
o D.2.2 Authentication-enabled ......................... 87
* E Authors' Addresses ........................................... 88
* F Acknowledgements ............................................. 89
* References ..................................................... 90
* Full Copyright Statement ....................................... 92
Schulzrinne, et. al. Standards Track [Page 4]
RFC 2326 Real Time Streaming Protocol April 1998
1
1.1
The Real-Time Streaming Protocol (RTSP) establishes and
either a single or several time-synchronized streams of
media such as audio and video. It does not typically deliver
continuous streams itself, although interleaving of the
media stream with the control stream is possible (see Section 10.12).
In other words, RTSP acts as a "network remote control"
multimedia servers
The set of streams to be controlled is defined by a
description. This memorandum does not define a format for
presentation description
There is no notion of an RTSP connection; instead, a server
a session labeled by an identifier. An RTSP session is in no way
to a transport-level connection such as a TCP connection. During
RTSP session, an RTSP client may open and close many
transport connections to the server to issue RTSP requests
Alternatively, it may use a connectionless transport protocol such
UDP
The streams controlled by RTSP may use RTP [1], but the operation
RTSP does not depend on the transport mechanism used to
continuous media. The protocol is intentionally similar in
and operation to HTTP/1.1 [2] so that extension mechanisms to
can in most cases also be added to RTSP. However, RTSP differs in
number of important aspects from HTTP
* RTSP introduces a number of new methods and has a
protocol identifier
* An RTSP server needs to maintain state by default in almost
cases, as opposed to the stateless nature of HTTP
* Both an RTSP server and client can issue requests
* Data is carried out-of-band by a different protocol. (There is
exception to this.)
* RTSP is defined to use ISO 10646 (UTF-8) rather than ISO 8859-1,
consistent with current HTML internationalization efforts [3].
* The Request-URI always contains the absolute URI. Because
backward compatibility with a historical blunder, HTTP/1.1 [2]
carries only the absolute path in the request and puts the
name in a separate header field
This makes "virtual hosting" easier, where a single host with
IP address hosts several document trees
Schulzrinne, et. al. Standards Track [Page 5]
RFC 2326 Real Time Streaming Protocol April 1998
The protocol supports the following operations
Retrieval of media from media server
The client can request a presentation description via HTTP
some other method. If the presentation is being multicast,
presentation description contains the multicast addresses
ports to be used for the continuous media. If the
is to be sent only to the client via unicast, the
provides the destination for security reasons
Invitation of a media server to a conference
A media server can be "invited" to join an
conference, either to play back media into the presentation
to record all or a subset of the media in a presentation.
mode is useful for distributed teaching applications.
parties in the conference may take turns "pushing the
control buttons."
Addition of media to an existing presentation
Particularly for live presentations, it is useful if
server can tell the client about additional media
available
RTSP requests may be handled by proxies, tunnels and caches as
HTTP/1.1 [2].
1.2
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in
document are to be interpreted as described in RFC 2119 [4].
1.3
Some of the terminology has been adopted from HTTP/1.1 [2]. Terms
listed here are defined as in HTTP/1.1.
Aggregate control
The control of the multiple streams using a single timeline
the server. For audio/video feeds, this means that the
may issue a single play or pause message to control both
audio and video feeds
Conference
a multiparty, multimedia presentation, where "multi"
greater than or equal to one
Schulzrinne, et. al. Standards Track [Page 6]
RFC 2326 Real Time Streaming Protocol April 1998
Client
The client requests continuous media data from the
server
Connection
A transport layer virtual circuit established between
programs for the purpose of communication
Container file
A file which may contain multiple media streams which
comprise a presentation when played together. RTSP servers
offer aggregate control on these files, though the concept
a container file is not embedded in the protocol
Continuous media
Data where there is a timing relationship between source
sink; that is, the sink must reproduce the timing
that existed at the source. The most common examples
continuous media are audio and motion video. Continuous
can be real-time (interactive), where there is a "tight
timing relationship between source and sink, or
(playback), where the relationship is less strict
Entity
The information transferred as the payload of a request
response. An entity consists of metainformation in the form
entity-header fields and content in the form of an entity
body, as described in Section 8.
Media initialization
Datatype/codec specific initialization. This includes
things as clockrates, color tables, etc. Any transport
independent information which is required by a client
playback of a media stream occurs in the media
phase of stream setup
Media parameter
Parameter specific to a media type that may be changed
or during stream playback
Media server
The server providing playback or recording services for one
more media streams. Different media streams within
presentation may originate from different media servers.
media server may reside on the same or a different host as
web server the presentation is invoked from
Schulzrinne, et. al. Standards Track [Page 7]
RFC 2326 Real Time Streaming Protocol April 1998
Media server indirection
Redirection of a media client to a different media server
(Media) stream
A single media instance, e.g., an audio stream or a
stream as well as a single whiteboard or shared
group. When using RTP, a stream consists of all RTP and
packets created by a source within an RTP session. This
equivalent to the definition of a DSM-CC stream([5]).
Message
The basic unit of RTSP communication, consisting of
structured sequence of octets matching the syntax defined
Section 15 and transmitted via a connection or
connectionless protocol
Participant
Member of a conference. A participant may be a machine, e.g.,
a media record or playback server
Presentation
A set of one or more streams presented to the client as
complete media feed, using a presentation description
defined below. In most cases in the RTSP context, this
aggregate control of those streams, but does not have to
Presentation description
A presentation description contains information about one
more media streams within a presentation, such as the set
encodings, network addresses and information about
content. Other IETF protocols such as SDP (RFC 2327 [6])
the term "session" for a live presentation. The
description may take several different formats, including
not limited to the session description format SDP
Response
An RTSP response. If an HTTP response is meant, that
indicated explicitly
Request
An RTSP request. If an HTTP request is meant, that
indicated explicitly
RTSP session
A complete RTSP "transaction", e.g., the viewing of a movie
A session typically consists of a client setting up
transport mechanism for the continuous media stream (SETUP),
starting the stream with PLAY or RECORD, and closing
Schulzrinne, et. al. Standards Track [Page 8]
RFC 2326 Real Time Streaming Protocol April 1998
stream with TEARDOWN
Transport initialization
The negotiation of transport information (e.g., port numbers
transport protocols) between the client and the server
1.4 Protocol
RTSP has the following properties
Extendable
New methods and parameters can be easily added to RTSP
Easy to parse
RTSP can be parsed by standard HTTP or MIME parsers
Secure
RTSP re-uses web security mechanisms. All HTTP
mechanisms such as basic (RFC 2068 [2, Section 11.1])
digest authentication (RFC 2069 [8]) are directly applicable
One may also reuse transport or network layer
mechanisms
Transport-independent
RTSP may use either an unreliable datagram protocol (UDP) (
768 [9]), a reliable datagram protocol (RDP, RFC 1151,
widely used [10]) or a reliable stream protocol such as
(RFC 793 [11]) as it implements application-level reliability
Multi-server capable
Each media stream within a presentation can reside on
different server. The client automatically establishes
concurrent control sessions with the different media servers
Media synchronization is performed at the transport level
Control of recording devices
The protocol can control both recording and playback devices
as well as devices that can alternate between the two
("VCR").
Separation of stream control and conference initiation
Stream control is divorced from inviting a media server to
conference. The only requirement is that the
initiation protocol either provides or can be used to create
unique conference identifier. In particular, SIP [12] or H.323
[13] may be used to invite a server to a conference
Schulzrinne, et. al. Standards Track [Page 9]
RFC 2326 Real Time Streaming Protocol April 1998
Suitable for professional applications
RTSP supports frame-level accuracy through SMPTE time
to allow remote digital editing
Presentation description neutral
The protocol does not impose a particular
description or metafile format and can convey the type
format to be used. However, the presentation description
contain at least one RTSP URI
Proxy and firewall friendly
The protocol should be readily handled by both application
transport-layer (SOCKS [14]) firewalls. A firewall may need
understand the SETUP method to open a "hole" for the UDP
stream
HTTP-friendly
Where sensible, RTSP reuses HTTP concepts, so that
existing infrastructure can be reused. This
includes PICS (Platform for Internet Content
[15,16]) for associating labels with content. However,
does not just add methods to HTTP since the
continuous media requires server state in most cases
Appropriate server control
If a client can start a stream, it must be able to stop
stream. Servers should not start streaming to clients in
a way that clients cannot stop the stream
Transport negotiation
The client can negotiate the transport method prior
actually needing to process a continuous media stream
Capability negotiation
If basic features are disabled, there must be some
mechanism for the client to determine which methods are
going to be implemented. This allows clients to present
appropriate user interface. For example, if seeking is
allowed, the user interface must be able to disallow moving
sliding position indicator
An earlier requirement in RTSP was multi-client capability
However, it was determined that a better approach was to make
that the protocol is easily extensible to the multi-
scenario. Stream identifiers can be used by several
streams, so that "passing the remote" would be possible.
protocol would not address how several clients negotiate access
this is left to either a "social protocol" or some other
Schulzrinne, et. al. Standards Track [Page 10]
RFC 2326 Real Time Streaming Protocol April 1998
control mechanism
1.5 Extending
Since not all media servers have the same functionality,
servers by necessity will support different sets of requests.
example
* A server may only be capable of playback thus has no need
support the RECORD request
* A server may not be capable of seeking (absolute positioning)
it is to support live events only
* Some servers may not support setting stream parameters and
not support GET_PARAMETER and SET_PARAMETER
A server SHOULD implement all header fields described in Section 12.
It is up to the creators of presentation descriptions not to ask
impossible of a server. This situation is similar in HTTP/1.1 [2],
where the methods described in [H19.6] are not likely to be
across all servers
RTSP can be extended in three ways, listed here in order of
magnitude of changes supported
* Existing methods can be extended with new parameters, as long
these parameters can be safely ignored by the recipient. (This
equivalent to adding new parameters to an HTML tag.) If
client needs negative acknowledgement when a method extension
not supported, a tag corresponding to the extension may be
in the Require: field (see Section 12.32).
* New methods can be added. If the recipient of the message
not understand the request, it responds with error code 501 (
implemented) and the sender should not attempt to use this
again. A client may also use the OPTIONS method to inquire
methods supported by the server. The server SHOULD list
methods it supports using the Public response header
* A new version of the protocol can be defined, allowing almost
aspects (except the position of the protocol version number)
change
1.6 Overall
Each presentation and media stream may be identified by an RTSP URL
The overall presentation and the properties of the media
presentation is made up of are defined by a presentation
file, the format of which is outside the scope of this specification
The presentation description file may be obtained by the client
Schulzrinne, et. al. Standards Track [Page 11]
RFC 2326 Real Time Streaming Protocol April 1998
HTTP or other means such as email and may not necessarily be
on the media server
For the purposes of this specification, a presentation description
assumed to describe one or more presentations, each of
maintains a common time axis. For simplicity of exposition
without loss of generality, it is assumed that the
description contains exactly one such presentation. A
may contain several media streams
The presentation description file contains a description of the
streams making up the presentation, including their encodings
language, and other parameters that enable the client to choose
most appropriate combination of media. In this
description, each media stream that is individually controllable
RTSP is identified by an RTSP URL, which points to the media
handling that particular media stream and names the stream stored
that server. Several media streams can be located on
servers; for example, audio and video streams can be split
servers for load sharing. The description also enumerates
transport methods the server is capable of
Besides the media parameters, the network destination address
port need to be determined. Several modes of operation can
distinguished
Unicast
The media is transmitted to the source of the RTSP request
with the port number chosen by the client. Alternatively,
media is transmitted on the same reliable stream as RTSP
Multicast, server chooses address
The media server picks the multicast address and port. This
the typical case for a live or near-media-on-
transmission
Multicast, client chooses address
If the server is to participate in an existing
conference, the multicast address, port and encryption key
given by the conference description, established by
outside the scope of this specification
1.7 RTSP
RTSP controls a stream which may be sent via a separate protocol
independent of the control channel. For example, RTSP control
occur on a TCP connection while the data flows via UDP. Thus,
delivery continues even if no RTSP requests are received by the
Schulzrinne, et. al. Standards Track [Page 12]
RFC 2326 Real Time Streaming Protocol April 1998
server. Also, during its lifetime, a single media stream may
controlled by RTSP requests issued sequentially on different
connections. Therefore, the server needs to maintain "session state
to be able to correlate RTSP requests with a stream. The
transitions are described in Section A
Many methods in RTSP do not contribute to state. However,
following play a central role in defining the allocation and usage
stream resources on the server: SETUP, PLAY, RECORD, PAUSE,
TEARDOWN
SETUP
Causes the server to allocate resources for a stream and
an RTSP session
PLAY and RECORD
Starts data transmission on a stream allocated via SETUP
PAUSE
Temporarily halts a stream without freeing server resources
TEARDOWN
Frees resources associated with the stream. The RTSP
ceases to exist on the server
RTSP methods that contribute to state use the Session
field (Section 12.37) to identify the RTSP session whose
is being manipulated. The server generates session
in response to SETUP requests (Section 10.4).
1.8 Relationship with Other
RTSP has some overlap in functionality with HTTP. It also
interact with HTTP in that the initial contact with streaming
is often to be made through a web page. The current
specification aims to allow different hand-off points between a
server and the media server implementing RTSP. For example,
presentation description can be retrieved using HTTP or RTSP,
reduces roundtrips in web-browser-based scenarios, yet also
for standalone RTSP servers and clients which do not rely on HTTP
all
However, RTSP differs fundamentally from HTTP in that data
takes place out-of-band in a different protocol. HTTP is
asymmetric protocol where the client issues requests and the
responds. In RTSP, both the media client and media server can
requests. RTSP requests are also not stateless; they may
parameters and continue to control a media stream long after
Schulzrinne, et. al. Standards Track [Page 13]
RFC 2326 Real Time Streaming Protocol April 1998
request has been acknowledged
Re-using HTTP functionality has advantages in at least two areas
namely security and proxies. The requirements are very similar,
having the ability to adopt HTTP work on caches, proxies
authentication is valuable
While most real-time media will use RTP as a transport protocol,
is not tied to RTP
RTSP assumes the existence of a presentation description format
can express both static and temporal properties of a
containing several media streams
2 Notational
Since many of the definitions and syntax are identical to HTTP/1.1,
this specification only points to the section where they are
rather than copying it. For brevity, [HX.Y] is to be taken to
to Section X.Y of the current HTTP/1.1 specification (RFC 2068 [2]).
All the mechanisms specified in this document are described in
prose and an augmented Backus-Naur form (BNF) similar to that used
[H2.1]. It is described in detail in RFC 2234 [17], with
difference that this RTSP specification maintains the "1#"
for comma-separated lists
In this memo, we use indented and smaller-type paragraphs to
background and motivation. This is intended to give readers who
not involved with the formulation of the specification
understanding of why things are the way that they are in RTSP
3 Protocol
3.1 RTSP
[H3.1] applies, with HTTP replaced by RTSP
3.2 RTSP
The "rtsp" and "rtspu" schemes are used to refer to network
via the RTSP protocol. This section defines the scheme-
syntax and semantics for RTSP URLs
rtsp_URL = ( "rtsp:" | "rtspu:" )
"//" host [ ":" port ] [ abs_path ]
host = Internet host domain name of IP
(in dotted decimal form), as defined by Section 2.1
Schulzrinne, et. al. Standards Track [Page 14]
RFC 2326 Real Time Streaming Protocol April 1998
of RFC 1123 \cite{rfc1123}>
port = *
abs_path is defined in [H3.2.1].
Note that fragment and query identifiers do not have a well-
meaning at this time, with the interpretation left to the
server
The scheme rtsp requires that commands are issued via a
protocol (within the Internet, TCP), while the scheme rtspu
an unreliable protocol (within the Internet, UDP).
If the port is empty or not given, port 554 is assumed. The
are that the identified resource can be controlled by RTSP at
server listening for TCP (scheme "rtsp") connections or UDP (
"rtspu") packets on that port of host, and the Request-URI for
resource is rtsp_URL
The use of IP addresses in URLs SHOULD be avoided whenever
(see RFC 1924 [19]).
A presentation or a stream is identified by a textual
identifier, using the character set and escape conventions [H3.2]
URLs (RFC 1738 [20]). URLs may refer to a stream or an aggregate
streams, i.e., a presentation. Accordingly, requests described
Section 10 can apply to either the whole presentation or an
stream within the presentation. Note that some request methods
only be applied to streams, not presentations and vice versa
For example, the RTSP URL
rtsp://media.example.com:554/twister/
identifies the audio stream within the presentation "twister",
can be controlled via RTSP requests issued over a TCP connection
port 554 of host media.example.com
Also, the RTSP URL
rtsp://media.example.com:554/
identifies the presentation "twister", which may be composed
audio and video streams
This does not imply a standard way to reference streams in URLs
The presentation description defines the hierarchical
in the presentation and the URLs for the individual streams.
presentation description may name a stream "a.mov" and the
presentation "b.mov".
Schulzrinne, et. al. Standards Track [Page 15]
RFC 2326 Real Time Streaming Protocol April 1998
The path components of the RTSP URL are opaque to the client and
not imply any particular file system structure for the server
This decoupling also allows presentation descriptions to be
with non-RTSP media control protocols simply by replacing
scheme in the URL
3.3 Conference
Conference identifiers are opaque to RTSP and are encoded
standard URI encoding methods (i.e., LWS is escaped with %). They
contain any octet value. The conference identifier MUST be
unique. For H.323, the conferenceID value is to be used
conference-id = 1*
Conference identifiers are used to allow RTSP sessions to
parameters from multimedia conferences the media server
participating in. These conferences are created by
outside the scope of this specification, e.g., H.323 [13] or
[12]. Instead of the RTSP client explicitly providing
information, for example, it asks the media server to use
values in the conference description instead
3.4 Session
Session identifiers are opaque strings of arbitrary length.
white space must be URL-escaped. A session identifier MUST be
randomly and MUST be at least eight octets long to make guessing
more difficult. (See Section 16.)
session-id = 1*( ALPHA | DIGIT | safe )
3.5 SMPTE Relative
A SMPTE relative timestamp expresses time relative to the start
the clip. Relative timestamps are expressed as SMPTE time codes
frame-level access accuracy. The time code has the
hours:minutes:seconds:frames.subframes, with the origin at the
of the clip. The default smpte format is "SMPTE 30 drop" format,
frame rate is 29.97 frames per second. Other SMPTE codes MAY
supported (such as "SMPTE 25") through the use of alternative use
"smpte time". For the "frames" field in the time value can
the values 0 through 29. The difference between 30 and 29.97
per second is handled by dropping the first two frame indices (
00 and 01) of every minute, except every tenth minute. If the
value is zero, it may be omitted. Subframes are measured
one-hundredth of a frame
Schulzrinne, et. al. Standards Track [Page 16]
RFC 2326 Real Time Streaming Protocol April 1998
smpte-range = smpte-type "=" smpte-time "-" [ smpte-time ]
smpte-type = "smpte" | "smpte-30-drop" | "smpte-25"
; other timecodes may be
smpte-time = 1*2DIGIT ":" 1*2DIGIT ":" 1*2DIGIT [ ":" 1*2DIGIT ]
[ "." 1*2DIGIT ]
Examples
smpte=10:12:33:20-
smpte=10:07:33-
smpte=10:07:00-10:07:33:05.01
smpte-25=10:07:00-10:07:33:05.01
3.6 Normal Play
Normal play time (NPT) indicates the stream absolute
relative to the beginning of the presentation. The timestamp
of a decimal fraction. The part left of the decimal may be
in either seconds or hours, minutes, and seconds. The part right
the decimal point measures fractions of a second
The beginning of a presentation corresponds to 0.0 seconds.
values are not defined. The special constant now is defined as
current instant of a live event. It may be used only for live events
NPT is defined as in DSM-CC: "Intuitively, NPT is the clock
viewer associates with a program. It is often digitally displayed
a VCR. NPT advances normally when in normal play mode (scale = 1),
advances at a faster rate when in fast scan forward (high
scale ratio), decrements when in scan reverse (high negative
ratio) and is fixed in pause mode. NPT is (logically) equivalent
SMPTE time codes." [5]
npt-range = ( npt-time "-" [ npt-time ] ) | ( "-" npt-time )
npt-time = "now" | npt-sec | npt-
npt-sec = 1*DIGIT [ "." *DIGIT ]
npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." *DIGIT ]
npt-hh = 1*DIGIT ; any positive
npt-mm = 1*2DIGIT ; 0-59
npt-ss = 1*2DIGIT ; 0-59
Examples
npt=123.45-125
npt=12:05:35.3-
npt=now
The syntax conforms to ISO 8601. The npt-sec notation is
for automatic generation, the ntp-hhmmss notation for
by human readers. The "now" constant allows clients to request
Schulzrinne, et. al. Standards Track [Page 17]
RFC 2326 Real Time Streaming Protocol April 1998
receive the live feed rather than the stored or time-
version. This is needed since neither absolute time nor zero
are appropriate for this case
3.7 Absolute
Absolute time is expressed as ISO 8601 timestamps, using UTC (GMT).
Fractions of a second may be indicated
utc-range = "clock" "=" utc-time "-" [ utc-time ]
utc-time = utc-date "T" utc-time "Z
utc-date = 8DIGIT ; < YYYYMMDD >
utc-time = 6DIGIT [ "." fraction ] ; < HHMMSS.fraction >
Example for November 8, 1996 at 14h37 and 20 and a quarter
UTC
19961108T143720.25
3.8 Option
Option tags are unique identifiers used to designate new options
RTSP. These tags are used in Require (Section 12.32) and Proxy
Require (Section 12.27) header fields
Syntax
option-tag = 1*
The creator of a new RTSP option should either prefix the option
a reverse domain name (e.g., "com.foo.mynewfeature" is an apt
for a feature whose inventor can be reached at "foo.com"),
register the new option with the Internet Assigned Numbers
(IANA).
3.8.1 Registering New Option Tags with
When registering a new RTSP option, the following information
be provided
* Name and description of option. The name may be of any length
but SHOULD be no more than twenty characters long. The name
not contain any spaces, control characters or periods
* Indication of who has change control over the option (
example, IETF, ISO, ITU-T, other international
bodies, a consortium or a particular company or group
companies);
Schulzrinne, et. al. Standards Track [Page 18]
RFC 2326 Real Time Streaming Protocol April 1998
* A reference to a further description, if available, for
(in order of preference) an RFC, a published paper, a
filing, a technical report, documented source code or a
manual
* For proprietary options, contact information (postal and
address);
4 RTSP
RTSP is a text-based protocol and uses the ISO 10646 character set
UTF-8 encoding (RFC 2279 [21]). Lines are terminated by CRLF,
receivers should be prepared to also interpret CR and LF
themselves as line terminators
Text-based protocols make it easier to add optional parameters in
self-describing manner. Since the number of parameters and
frequency of commands is low, processing efficiency is not
concern. Text-based protocols, if done carefully, also allow
implementation of research prototypes in scripting languages
as Tcl, Visual Basic and Perl
The 10646 character set avoids tricky character set switching,
is invisible to the application as long as US-ASCII is being used
This is also the encoding used for RTCP. ISO 8859-1
directly into Unicode with a high-order octet of zero. ISO 8859-1
characters with the most-significant bit set are represented
1100001x 10xxxxxx. (See RFC 2279 [21])
RTSP messages can be carried over any lower-layer transport
that is 8-bit clean
Requests contain methods, the object the method is operating upon
parameters to further describe the method. Methods are idempotent
unless otherwise noted. Methods are also designed to require
or no state maintenance at the media server
4.1 Message
See [H4.1]
4.2 Message
See [H4.2]
4.3 Message
See [H4.3]
Schulzrinne, et. al. Standards Track [Page 19]
RFC 2326 Real Time Streaming Protocol April 1998
4.4 Message
When a message body is included with a message, the length of
body is determined by one of the following (in order of precedence):
1. Any response message which MUST NOT include a message
(such as the 1xx, 204, and 304 responses) is always
by the first empty line after the header fields, regardless
the entity-header fields present in the message. (Note:
empty line consists of only CRLF.)
2. If a Content-Length header field (section 12.14) is present
its value in bytes represents the length of the message-body
If this header field is not present, a value of zero
assumed
3. By the server closing the connection. (Closing the
cannot be used to indicate the end of a request body,
that would leave no possibility for the server to send back
response.)
Note that RTSP does not (at present) support the HTTP/1.1 "chunked
transfer coding(see [H3.6]) and requires the presence of
Content-Length header field
Given the moderate length of presentation descriptions returned
the server should always be able to determine its length, even
it is generated dynamically, making the chunked transfer
unnecessary. Even though Content-Length must be present if there
any entity body, the rules ensure reasonable behavior even if
length is not given explicitly
5 General Header
See [H4.5], except that Pragma, Transfer-Encoding and Upgrade
are not defined
general-header = Cache-Control ; Section 12.8
| Connection ; Section 12.10
| Date ; Section 12.18
| Via ; Section 12.43
6
A request message from a client to a server or vice versa includes
within the first line of that message, the method to be applied
the resource, the identifier of the resource, and the
version in use
Schulzrinne, et. al. Standards Track [Page 20]
RFC 2326 Real Time Streaming Protocol April 1998
Request = Request-Line ; Section 6.1
*( general-header ; Section 5
| request-header ; Section 6.2
| entity-header ) ; Section 8.1
[ message-body ] ; Section 4.3
6.1 Request
Request-Line = Method SP Request-URI SP RTSP-Version
Method = "DESCRIBE" ; Section 10.2
| "ANNOUNCE" ; Section 10.3
| "GET_PARAMETER" ; Section 10.8
| "OPTIONS" ; Section 10.1
| "PAUSE" ; Section 10.6
| "PLAY" ; Section 10.5
| "RECORD" ; Section 10.11
| "REDIRECT" ; Section 10.10
| "SETUP" ; Section 10.4
| "SET_PARAMETER" ; Section 10.9
| "TEARDOWN" ; Section 10.7
| extension-
extension-method =
Request-URI = "*" | absolute_
RTSP-Version = "RTSP" "/" 1*DIGIT "." 1*
6.2 Request Header
request-header = Accept ; Section 12.1
| Accept-Encoding ; Section 12.2
| Accept-Language ; Section 12.3
| Authorization ; Section 12.5
| From ; Section 12.20
| If-Modified-Since ; Section 12.23
| Range ; Section 12.29
| Referer ; Section 12.30
| User-Agent ; Section 12.41
Note that in contrast to HTTP/1.1 [2], RTSP requests always
the absolute URL (that is, including the scheme, host and port
rather than just the absolute path
Schulzrinne, et. al. Standards Track [Page 21]
RFC 2326 Real Time Streaming Protocol April 1998
HTTP/1.1 requires servers to understand the absolute URL,
clients are supposed to use the Host request header. This is
needed for backward-compatibility with HTTP/1.0 servers,
consideration that does not apply to RTSP
The asterisk "*" in the Request-URI means that the request does
apply to a particular resource, but to the server itself, and is
allowed when the method used does not necessarily apply to
resource. One example would be
OPTIONS * RTSP/1.0
7
[H6] applies except that HTTP-Version is replaced by RTSP-Version
Also, RTSP defines additional status codes and does not define
HTTP codes. The valid response codes and the methods they can be
with are defined in Table 1.
After receiving and interpreting a request message, the
responds with an RTSP response message
Response = Status-Line ; Section 7.1
*( general-header ; Section 5
| response-header ; Section 7.1.2
| entity-header ) ; Section 8.1
[ message-body ] ; Section 4.3
7.1 Status-
The first line of a Response message is the Status-Line,
of the protocol version followed by a numeric status code, and
textual phrase associated with the status code, with each
separated by SP characters. No CR or LF is allowed except in
final CRLF sequence
Status-Line = RTSP-Version SP Status-Code SP Reason-Phrase
7.1.1 Status Code and Reason
The Status-Code element is a 3-digit integer result code of
attempt to understand and satisfy the request. These codes are
defined in Section 11. The Reason-Phrase is intended to give a
textual description of the Status-Code. The Status-Code is
for use by automata and the Reason-Phrase is intended for the
user. The client is not required to examine or display the Reason
Phrase
Schulzrinne, et. al. Standards Track [Page 22]
RFC 2326 Real Time Streaming Protocol April 1998
The first digit of the Status-Code defines the class of response.
last two digits do not have any categorization role. There are 5
values for the first digit
* 1xx: Informational - Request received, continuing
* 2xx: Success - The action was successfully received, understood
and
* 3xx: Redirection - Further action must be taken in order
complete the
* 4xx: Client Error - The request contains bad syntax or cannot
* 5xx: Server Error - The server failed to fulfill an
valid
The individual values of the numeric status codes defined
RTSP/1.0, and an example set of corresponding Reason-Phrase's,
presented below. The reason phrases listed here are only
- they may be replaced by local equivalents without affecting
protocol. Note that RTSP adopts most HTTP/1.1 [2] status codes
adds RTSP-specific status codes starting at x50 to avoid
with newly defined HTTP status codes
Schulzrinne, et. al. Standards Track [Page 23]
RFC 2326 Real Time Streaming Protocol April 1998
Status-Code = "100" ;
| "200" ;
| "201" ;
| "250" ; Low on Storage
| "300" ; Multiple
| "301" ; Moved
| "302" ; Moved
| "303" ; See
| "304" ; Not
| "305" ; Use
| "400" ; Bad
| "401" ;
| "402" ; Payment
| "403" ;
| "404" ; Not
| "405" ; Method Not
| "406" ; Not
| "407" ; Proxy Authentication
| "408" ; Request Time-
| "410" ;
| "411" ; Length
| "412" ; Precondition
| "413" ; Request Entity Too
| "414" ; Request-URI Too
| "415" ; Unsupported Media
| "451" ; Parameter Not
| "452" ; Conference Not
| "453" ; Not Enough
| "454" ; Session Not
| "455" ; Method Not Valid in This
| "456" ; Header Field Not Valid for
| "457" ; Invalid
| "458" ; Parameter Is Read-
| "459" ; Aggregate operation not
| "460" ; Only aggregate operation
| "461" ; Unsupported
| "462" ; Destination
| "500" ; Internal Server
| "501" ; Not
| "502" ; Bad
| "503" ; Service
| "504" ; Gateway Time-
| "505" ; RTSP Version not
| "551" ; Option not
| extension-
Schulzrinne, et. al. Standards Track [Page 24]
RFC 2326 Real Time Streaming Protocol April 1998
extension-code = 3
Reason-Phrase = *
RTSP status codes are extensible. RTSP applications are not
to understand the meaning of all registered status codes, though
understanding is obviously desirable. However, applications
understand the class of any status code, as indicated by the
digit, and treat any unrecognized response as being equivalent to
x00 status code of that class, with the exception that
unrecognized response MUST NOT be cached. For example, if
unrecognized status code of 431 is received by the client, it
safely assume that there was something wrong with its request
treat the response as if it had received a 400 status code. In
cases, user agents SHOULD present to the user the entity
with the response, since that entity is likely to include human
readable information which will explain the unusual status
Code
100 Continue
200 OK
201 Created
250 Low on Storage Space
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
303 See Other
305 Use Proxy
Schulzrinne, et. al. Standards Track [Page 25]
RFC 2326 Real Time Streaming Protocol April 1998
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
410 Gone
411 Length Required
412 Precondition Failed DESCRIBE,
413 Request Entity Too Large
414 Request-URI Too Long
415 Unsupported Media Type
451 Invalid parameter
452 Illegal Conference Identifier
453 Not Enough Bandwidth
454 Session Not Found
455 Method Not Valid In This State
456 Header Field Not Valid
457 Invalid Range
458 Parameter Is Read-Only SET_
459 Aggregate Operation Not Allowed
460 Only Aggregate Operation Allowed
461 Unsupported Transport
462 Destination Unreachable
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 RTSP Version Not Supported
551 Option not support
Table 1: Status codes and their usage with RTSP
7.1.2 Response Header
The response-header fields allow the request recipient to
additional information about the response which cannot be placed
the Status-Line. These header fields give information about
server and about further access to the resource identified by
Request-URI
Schulzrinne, et. al. Standards Track [Page 26]
RFC 2326 Real Time Streaming Protocol April 1998
response-header = Location ; Section 12.25
| Proxy-Authenticate ; Section 12.26
| Public ; Section 12.28
| Retry-After ; Section 12.31
| Server ; Section 12.36
| Vary ; Section 12.42
| WWW-Authenticate ; Section 12.44
Response-header field names can be extended reliably only
combination with a change in the protocol version. However, new
experimental header fields MAY be given the semantics of response
header fields if all parties in the communication recognize them
be response-header fields. Unrecognized header fields are treated
entity-header fields
8
Request and Response messages MAY transfer an entity if not
restricted by the request method or response status code. An
consists of entity-header fields and an entity-body, although
responses will only include the entity-headers
In this section, both sender and recipient refer to either the
or the server, depending on who sends and who receives the entity
8.1 Entity Header
Entity-header fields define optional metainformation about
entity-body or, if no body is present, about the resource
by the request
entity-header = Allow ; Section 12.4
| Content-Base ; Section 12.11
| Content-Encoding ; Section 12.12
| Content-Language ; Section 12.13
| Content-Length ; Section 12.14
| Content-Location ; Section 12.15
| Content-Type ; Section 12.16
| Expires ; Section 12.19
| Last-Modified ; Section 12.24
| extension-
extension-header = message-
The extension-header mechanism allows additional entity-header
to be defined without changing the protocol, but these fields
be assumed to be recognizable by the recipient. Unrecognized
fields SHOULD be ignored by the recipient and forwarded by proxies
Schulzrinne, et. al. Standards Track [Page 27]
RFC 2326 Real Time Streaming Protocol April 1998
8.2 Entity
See [H7.2]
9
RTSP requests can be transmitted in several different ways
* persistent transport connections used for
request-response transactions
* one connection per request/response transaction
* connectionless mode
The type of transport connection is defined by the RTSP URI (
3.2). For the scheme "rtsp", a persistent connection is assumed
while the scheme "rtspu" calls for RTSP requests to be sent
setting up a connection
Unlike HTTP, RTSP allows the media server to send requests to
media client. However, this is only supported for
connections, as the media server otherwise has no reliable way
reaching the client. Also, this is the only way that requests
media server to client are likely to traverse firewalls
9.1
A client that supports persistent connections or connectionless
MAY "pipeline" its requests (i.e., send multiple requests
waiting for each response). A server MUST send its responses to
requests in the same order that the requests were received
9.2 Reliability and
Requests are acknowledged by the receiver unless they are sent to
multicast group. If there is no acknowledgement, the sender
resend the same message after a timeout of one round-trip time (RTT).
The round-trip time is estimated as in TCP (RFC 1123) [18], with
initial round-trip value of 500 ms. An implementation MAY cache
last RTT measurement as the initial value for future connections
If a reliable transport protocol is used to carry RTSP, requests
NOT be retransmitted; the RTSP application MUST instead rely on
underlying transport to provide reliability
If both the underlying reliable transport such as TCP and the
application retransmit requests, it is possible that each
loss results in two retransmissions. The receiver cannot
take advantage of the application-layer retransmission since
Schulzrinne, et. al. Standards Track [Page 28]
RFC 2326 Real Time Streaming Protocol April 1998
transport stack will not deliver the application-
retransmission before the first attempt has reached the receiver
If the packet loss is caused by congestion,
retransmissions at different layers will exacerbate the congestion
If RTSP is used over a small-RTT LAN, standard procedures
optimizing initial TCP round trip estimates, such as those used
T/TCP (RFC 1644) [22], can be beneficial
The Timestamp header (Section 12.38) is used to avoid
retransmission ambiguity problem [23, p. 301] and obviates the
for Karn's algorithm
Each request carries a sequence number in the CSeq header (
12.17), which is incremented by one for each distinct
transmitted. If a request is repeated because of lack
acknowledgement, the request MUST carry the original sequence
(i.e., the sequence number is not incremented).
Systems implementing RTSP MUST support carrying RTSP over TCP and
support UDP. The default port for the RTSP server is 554 for both
and TCP
A number of RTSP packets destined for the same control end point
be packed into a single lower-layer PDU or encapsulated into a
stream. RTSP data MAY be interleaved with RTP and RTCP packets
Unlike HTTP, an RTSP message MUST contain a Content-Length
whenever that message contains a payload. Otherwise, an RTSP
is terminated with an empty line immediately following the
message header
10 Method
The method token indicates the method to be performed on the
identified by the Request-URI. The method is case-sensitive.
methods may be defined in the future. Method names may not start
a $ character (decimal 24) and must be a token. Methods
summarized in Table 2.
Schulzrinne, et. al. Standards Track [Page 29]
RFC 2326 Real Time Streaming Protocol April 1998
method direction object
DESCRIBE C->S P,S
ANNOUNCE C->S, S->C P,S
GET_PARAMETER C->S, S->C P,S
OPTIONS C->S, S->C P,S
(S->C: