RTSP Specification

The Real Time Streaming Protocol (RTSP) is a network 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. RTP/RTSP is a necessary protocol for multimedia content transfer.

The RTP/RTSP protocol is quite advantageous in less than ideal network conditions. The protocol provides benefits like as buffer fullness control mechanism, better control of packet pacing and fast pre-roll for providing quicker streaming transfer. The protocol is best suited for streaming transfer of live content.

Due to the unreliable nature of UDP packet delivery, the quality of the received stream will be adversely affected by packet loss. It is important to calculate the actual delay experienced in the channel. By calculating the correct value chances of receiving maximum number of packets for a particular frame would increase. As part of this implementation effort would be utilized for estimating overall play out delay experienced and making the play out operation smooth by introducing a jitter buffer implementation.

If a client cannot establish UDP communication with the server due to some network configuration, RTSP server provide an alternative approach to still stream media over to the client using RTP over TCP mechanism. This makes it imperative that RTP/RTSP client stack shall have a method of trying with TCP channel in case it fails to connect with UDP channel. All the above mentioned items have been summarized below to give the features level list.

RTSP process

Samsung provides the following RTSP specifications:

RTSP Supported Features

RTSP has 11 methods to control entire RTSP Session. The following categories are based on the current SamsungRTSP Stack.

Supported RTSP Methods

OPTIONS

Client May use the OPTIONS Method to inquire about methods supported by the Server. The Server SHOULD list the methods it supports using the public response header.

Example:

OPTIONS rtsp://107.108.89.116:554/ESPN2.ts RTSP/1.0
CSeq: 0

RTSP/1.0 200 OK
CSeq: 0
Date: Mon, Sep 12 2011 11:11:26 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER,
        SET_PARAMETER

Note: Ref RFC 2326 section 10.1

DESCRIBE

The DESCRIBE method retrieves the description of a presentation or media object identified by the request URL from a server.

Example:

DESCRIBE rtsp://107.108.89.116:554/ESPN2.ts RTSP/1.0
CSeq: 1
Accept: application/sdp

RTSP/1.0 200 OK
CSeq: 1
Date: Mon, Sep 12 2011 11:15:05 GMT
Content-Base: rtsp://107.108.89.116/ESPN2.ts/
Content-Type: application/sdp
Content-Length: 396

v=0
o=- 1315826105025616 1 IN IP4 107.108.89.116
s=MPEG Transport Stream, streamed by the LIVE555 Media Server
i=ESPN2.ts
t=0 0
a=tool:LIVE555 Streaming Media v2011.05.25
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:MPEG Transport Stream, streamed by the LIVE555 Media Server
a=x-qt-text-inf:ESPN2.ts
m=video 0 RTP/AVP 33
c=IN IP4 0.0.0.0
b=AS:5000
a=control:track1

Note: Ref RFC 2326 Section 10.2

SETUP

The SETUP request for a URI specifies the transport mechanism to be used for the streamed media. A client can issue a SETUP request for a stream that is already playing to change transport parameters, which a server MAY allow. If it does not allow this, it MUST respond with error "455 Method Not Valid In This State".

Example:

SETUP rtsp://107.108.89.116:554/ESPN2.ts/track1 RTSP/1.0
CSeq: 2
Transport: RTP/AVP/UDP;unicast;client_port=51962-51963;mode=play
RTSP/1.0 200 OK
CSeq: 2
Date: Mon, Sep 12 2011 11:29:07 GMT
Transport:RTP/AVP;unicast;destination=107.108.89.116;source=107.108.89.116;client_port=51962-51963;server_port=6970-6971
Session: 00007689

Note: Ref RFC 2326 Section 10.4

PLAY

The PLAY method tells the server to start sending data via the mechanism specified in SETUP. A client MUST NOT issue a PLAY request until any outstanding SETUP requests have been acknowledged as successful.

Example:

PLAY rtsp://107.108.89.116:554/ESPN2.ts RTSP/1.0
CSeq: 3
Session: 00007689
Range: npt=0.000-

RTSP/1.0 200 OK
CSeq: 3
Date: Mon, Sep 12 2011 11:33:07 GMT
Range: npt=0.000-
Session: 00007689
RTP-Info: url=rtsp://107.108.89.116/ESPN2.ts/track1;seq=8539;rtptime=13709

Note: RFC 2326 Section 10.5

PAUSE

The PAUSE request causes the stream delivery to be interrupted (halted) temporarily.

Example:

PAUSE rtsp://107.108.89.116:554/ESPN2.ts RTSP/1.0
CSeq: 4
Session: 00007689
RTSP/1.0 200 OK
CSeq: 4
Date: Mon, Sep 12 2011 11:35:10 GMT

Note: RFC 2326 Section 10.6

TEARDOWN

The TEARDOWN request stops the stream delivery for the given URI, freeing the resources associated with it.

Example:

TEARDOWN rtsp://107.108.89.116:554/sampleTS.ts RTSP/1.0
CSeq: 5
Session: 00007689
RTSP/1.0 200 OK
CSeq: 5
Date: Mon, Sep 12 2011 11:44:45 GMT

Note: RFC 2326 Section 10.7

To be supported RTSP Methods

The following methods will be supported in future releases:

Unsupported RTSP Methods

The following methods are not supported:

Header Definition Table

The following Table summarizes the header fields used by RTSP. Interpret these abbreviated short form as given below.

Header

Type

Support

Method

SamsungRTSP Support

Accept

R

opt.

entity

Yes

Accept-Encoding

R

opt.

entity

No

Accept-Language

R

opt.

all

No

Allow

r

opt.

all

No

Authorization

R

opt.

all

No

Bandwidth

R

opt.

all

No

Blocksize

R

opt.

all but OPTIONS, TEARDOWN

No

Cache-Control

g

opt.

SETUP

No

Conference

R

opt.

SETUP

No

Connection

g

req.

all

No

Content-Base

e

opt.

entity

No

Content-Encoding

e

req.

SET_PARAMETER

No

Content-Encoding

e

req.

DESCRIBE, ANNOUNCE

No

Content-Language

e

req.

DESCRIBE, ANNOUNCE

No

Content-Length

e

req.

SET_PARAMETER, ANNOUNCE

Yes

 

Content-Length

e

req.

entity

Yes

Content-Location

e

opt.

entity

No

Content-Type

e

req.

SET_PARAMETER, ANNOUNCE

No

Content-Type

r

req.

entity

No

CSeq

g

req.

all

Yes

Date

g

opt.

all

Yes

Expires

e

opt.

DESCRIBE, ANNOUNCE

No

From

R

opt.

all

No

If-Modified-Since

R

opt.

DESCRIBE, SETUP

No

Last-Modified

e

opt.

entity

No

Proxy-Authenticate

R

req.

all

No

Proxy-Require

R

req.

all

No

Public

r

opt.

All

Yes

Range

R

opt.

PLAY, PAUSE, RECORD

Yes

Range

r

opt.

PLAY, PAUSE, RECORD

Yes

Referer

R

opt.

all

No

Require

R

req.

All

No

Retry-After

r

opt.

all

No

RTP-Info

r

req.

PLAY

Yes

Scale

Rr

opt.

PLAY, RECORD

No

Session

Rr

req.

all but SETUP, OPTIONS

Yes

Server

r

opt.

all

No

Speed

Rr

opt.

PLAY

No

Transport

Rr

req.

SETUP

Yes

Unsupported

r

req.

all

No

User-Agent

R

opt.

All

No

Via

g

opt.

all

No

WWW-Authenticate

r

opt.

all

No

SDP Supported Feature

SDP provides a standard representation for session description. Following are table contains SDP fields.

SDP Example:

v=0
o=- 1315908999736260 1 IN IP4 107.108.89.116
s=MPEG Transport Stream, streamed by the LIVE555 Media Server
i=ESPN2.ts
t=0 0
a=tool:LIVE555 Streaming Media v2011.05.25
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:MPEG Transport Stream, streamed by the LIVE555 Media Server
a=x-qt-text-inf:ESPN2.ts
m=video 0 RTP/AVP 33
c=IN IP4 0.0.0.0
b=AS:5000
a=control:track1

Session Level description (Ref- RFC 4566 Section 5)

SDP Field

Description

SamsungRTSP stack Supported

v

Version

Yes

o

originator and session identifier

Yes

s

session name

Yes

i

session information

Yes

u

URI of description

Yes

e

email address

Yes

p

phone number

Yes

c

connection information

Yes

b

bandwidth information

Yes

z

time zone adjustments

Yes

k

encryption key

Yes

a

session attribute

Yes

t

time the session is active

Yes

r

repeat times

Yes

m

media name and transport address

Yes

Protocol Version ("v=")

The "v=" field gives the version of the Session Description Protocol.

Syntax:

v=0

SamsungRTSP Stack Support: Supported

Origin ("o=")

The "o=" field gives the originator of the session

Syntax:

o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>

SamsungRTSP Stack Support: Support all options

Session Name ("s=")

The "s=" field is the textual session name. There MUST be one and only one "s=" field per session description.

Syntax:

s=<session name>

SamsungRTSP Stack Support: Support

Session Information ("i=")

The "i=" field provides textual information about the session. There MUST be at most one session-level "i=" field per session description, and at most one "i=" field per media.

Syntax:

i=<session description>

SamsungRTSP Stack Support: Support

URI ("u=")

A URI is a Uniform Resource Identifier as used by WWW clients.

Syntax:

u=<uri>

SamsungRTSP Stack Support: Support

Email Address and Phone Number ("e=" and "p"

The "e=" and "p=" lines specify contact information for the person responsible for the conference. This is not necessarily the same person that created the conference announcement.

Syntax:

e=<email-address> and p=<phone-number>

SamsungRTSP Stack Support: Support

Connection Data ("c=")

A session description MUST contain either at least one "c=" field in each media description or a single "c=" field at the session level.

Syntax:

c=<nettype> <addrtype> <connection-address>

SamsungRTSP Stack Support: Support all options

Bandwidth ("b=")

This OPTIONAL field denotes the proposed bandwidth to be used by the session or media.

Syntax:

b=<bwtype>:<bandwidth>

SamsungRTSP Stack Support: Support all options

Timing ("t=")

The "t=" lines specify the start and stop times for a session.

Syntax:

t=<start-time> <stop-time>

SamsungRTSP Stack Support: Support all options

Repeat Times ("r=")

"r=" fields specify repeat times for a session.

Syntax:

r=<repeat interval> <active duration> <offsets from start-time>

SamsungRTSP Stack Support: Support all options

Time Zones ("z=")

To schedule a repeated session that spans a change from daylight saving time to standard time or vice versa, it is necessary to specify offsets from the base time.

Syntax:

z=<adjustment time> <offset> <adjustment time> <offset> ....

SamsungRTSP Stack Support: Support all options

Encryption Keys ("k=")

If transported over a secure and trusted channel, the Session Description Protocol MAY be used to convey encryption keys. A simple mechanism for key exchange is provided by the key field ("k=")

Syntax:

k=<method> and  k=<method>:<encryption key>

Available Method: clear, base64, uri, prompt

SamsungRTSP Stack Support: Support all options and methods

Attributes ("a=")

Attributes are the primary means for extending SDP.

Syntax:

a=<attribute> and a=<attribute>:<value>

SamsungRTSP Stack Support: Support all options

Media Level Description (Ref- RFC 4566 Section 5)

SDP Field

Description

SamsungRTSP stack Supported

i

media title

Yes

c

connection information

Yes

b

bandwidth information

Yes

k

encryption key

Yes

a

media attribute

Yes

Media Descriptions ("m=")

A session description may contain a number of media descriptions. Each media description starts with an "m=" field and is terminated by either the next "m=" field or by the end of the session description.

Syntax:

m=<media> port> <proto> <fmt> ...

SamsungRTSP Stack Support: Support all options

SDP Attributes at Media level (“a=”)

The following attributes are defined.

SamsungRTSP Not Supported:

SamsungRTSP Supported:

RTP Supported Feature

RTP is used to parse RTP Packet to extract RTP header field and extract data from packet.

After extracting data goes for depacketization. SamsungRTSP Stack support following depacketizers:

RTCP Supported Feature

RTCP is used to control data channel based on TCP Reports.

The following RTCP packet types to carry a variety of control information:

Additional Supported Features

Additional supported features include:

Where to Go Next