RTSP Signaling Design Specification

V1.0.05

Version Date Change Log
V1.0.00 2008/11/28 1. Document Created
V1.0.01 2010/04/26 1. defined the streaming method and RTP streaming in PlatformT encoders
V1.0.02 2010/11/08 1. correcting the time range in the example.
V1.0.03 2012/03/07 1. update the Server's Response of RTSP describe command.
V1.0.04 2012/04/12 1. correct audio track number for PlatformT and PlatformK firmware.
V1.0.05 2013/01/03 1. Add URI on RTSP for get video/audio streams.
2. Modified the RTSP URI implementation
3. Modified the multicast RTP streaming design.

General Description

The RTP video/audio streams are described and setup by the RTSP signaling between the client and server. In this article, I addressed on the RTSP signaling for RTP over UDP and RTP over Multicast streaming. The detail of the SDP in RTSP are not in the scope of this article.

The track number is the ID of a stream among the RTSP signaling. We use the track number to address the media of a stream. The available media on the server depends on the server type. Here is the list of the available media VS the servers.

Server Type Server Channel Mode Media track number
PlatformA One Channel Video Encoder & Camera None video 1
audio* 2
PlatformA QUAD Video Encoder Single Channel Mode Channel 1 Video 1
Channel 2 Video 2
Channel 3 Video 3
Channel 4 Video 4
audio* 5
Quad Channel Mode video 1
audio* 5
PlatformT Video Encoder & Camera Single Stream Mode video 1
audio* 2
Dual Stream Mode Stream 1 Video 1
Stream 2 Video 2
audio* 3
PlatformK Camera Single Stream Mode video 1
audio* 2
Dual Stream Mode Stream 1 Video 1
Stream 2 Video 2
audio* 3
4VGA / 6VGA Mode Stream 1 Video 1
Stream 2 Video 2
Stream 3 Video 3
Stream 4 Video 4
Stream 5 Video (available in 6VGA mode) 5
Stream 6 Video (available in 6VGA mode) 6
audio* 5 in 4VGA mode, 7 in 6VGA mode
Platform-A1 Camera Dual Stream Stream 1 Video 1
Stream 2 Video 2
audio* 3
*: if there is an audio function on the device and the audio function is enabled.
In PlatformA firmware, the audio stream must be with video stream.
In PlatformT and PlatformK firmware, user could get the audio RTP stream by giving the audio track number in the RTSP command.

RTSP Signaling

The RTSP connection command controls what media in server will be checkout. This command has to match the path of the media in the server. To compatible with ISVs, the server has to accept several type of the RTSP connection commands listed in the following table.

Describe Command

The client sends the DESCRIBE command to the server to request for descriptions of available media in the server. The server gives the track number for every media in the reply of the DESCRIBE command.

Setup Command

The client sends SETUP command to register the media for RTP streaming based on the description of the DESCRIBE command from server. Every media needs to perform the SETUP procedure in this SETUP signaling cycle. The server checks the parameters in the SETUP request command from the client. The error message will be returned and RTSP session will be closed if there are something wrong during the SETUP cycle.

The control of RTP over UDP and RTP over Multicast will be handled by the server. The V2_STREAMING_METHOD in SYSTEM CGI and the RTP_MULTICAST_STREAMING in ENCODER CGI defined the server's RTP streaming method. The media description for unicast and multicast in the RTSP describe session will be based on the setting of V2_STREAMING_METHOD and the state of RTP_MULTICAST_STREAMING.
The following table lists the RTP streaming protocol with these two settings.

V2_STREAMING_METHOD RTP_MULTICAST_STREAMING RTP streaming Protocol
Unicast Multicast
0, 1, 2, 3 Don't care Supported Requested by RTSP.
No multicast RTP streaming if there is no one request it.
4 Don't care Supported Firmware sends multicast RTP streaming all the time.
5 PLAY Supported Firmware sends multicast RTP streaming all the time.
PAUSE Supported Firmware does not send multicast streams event it gets multicast RTP request from a remote host.
The firmware could serve up to 10 streaming hosts which they could be TCP, unicast RTP, multicast RTP and RTP over HTTP streaming hosts.
Therefore, the firmware registers the remote host into its streaming database as it requests multicast RTP streaming service successfully (through RTSP SETUP and PLAY commands). It will occupy one streaming host entry in the firmware streaming database.

In RTSP connection command, the player might have the "udp" or "multicast" parameter. They will become the part of setup parameters in the RTSP setup sessions. In server, the term "udp" was treated as the client wants to get the unicast RTP stream and "multicast" was treated as the client wants to get the multicast RTP stream. The server should reject the connection request if the "udp" and "multicast" in setup parameter does not match the streaming state in the server.

I listed down these RTSP commands below.

RTSP Connection Command Server's Response
rtsp://DeviceIP:RtspPort
rtsp://DeviceIP:RtspPort/
describe all available media and streaming the media based on the setup commands.
rtsp://DeviceIP:RtspPort/udp
rtsp://DeviceIP:RtspPort/multicast
rtsp://DeviceIP:RtspPort/multicast/trackn
rtsp://DeviceIP:RtspPort/multicast/streamn
rtsp://DeviceIP:RtspPort/trackn
In PlatformA encoders :
  n must be 1.
describe all available media and streaming the media based on the setup commands.
In PlatformT, K and A1 encoders :
  n : the track number.
describe available media and streaming the media based on the track number in client describe and setup commands. If there is no track number,n, in the RTSP command, firmware return error in RTSP session.
rtsp://DeviceIP:RtspPort/udp/trackn
rtsp://DeviceIP:RtspPort/streamn These URIs are only available in Platform T(4.13), K (5.08) and A1(6.03) firmware.
n : the streaming ID.
Firmware describes available media and streaming the media based on the streaming ID in client describe and setup commands. The streaming ID presents the video which its channel ID = Steaming ID and audio media if AUDIO_IN function is enabled.
If there is no track number in the describe command, encoder responses describe command with all available media descriptions.
rtsp://DeviceIP:RtspPort/udp/streamn

Special Note for platform T, K and A1 encoders

The server services the media streams depends on the RTSP DESCRIBE and SETUP session. The streaming protocol is based on the RTSP command. If the udp is in the client's RTSP commands, the server will serve the RTSP commands with unicast protocol. Again, if the multicast is in the client's RTSP commands, the server will serve the RTSP commands with multicast protocol. If there is no udp and multicast in the client's RTSP commands, the unicast streaming protocol in the server is used.

RTSP Connection Command

RTP streaming protocol

rtsp://DeviceIP:RtspPort
V2_STREAMING_METHOD RTP_MULTICAST_STREAMING RTP streaming protocol
0, 1, 2, 3, 4, 5 PLAY or PAUSE Unicast
rtsp://DeviceIP:RtspPort/udp Unicast
rtsp://DeviceIP:RtspPort/multicast Multicast

Example of the RTSP Signaling

Here gives an example of the RTSP signaling. The player is the VLC and the device is the ACD2000Q which is in single channel mode. The authentication process was disabled here. The client's RTSP messages were listed in black and the server's RTSP messages were listed in blue.
In this example, the server will stream 4 video streams and 1 audio stream to the client after the RTSP PLAY command is done.
The RTSP connection command in the VLC is rtsp:// 72.16.3.61:7070

Example:

OPTIONS rtsp://172.16.3.61:7070 RTSP/1.0
CSeq: 43
User-Agent: VLC media player (LIVE555 Streaming Media v2006.03.16)

RTSP/1.0 200 OK
CSeq: 43
Date: Thu, Jan 01 2004 00:28:17 GMT
Public: OPTIONS, DESCRIBE, SETUP, PLAY, TEARDOWN


DESCRIBE rtsp://172.16.3.61:7070 RTSP/1.0
CSeq: 44
Accept: application/sdp
User-Agent: VLC media player (LIVE555 Streaming Media v2006.03.16)

RTSP/1.0 200 OK
CSeq: 44
Date: Thu, Jan 01 2004 00:28:17 GMT
Content-Base: rtsp://172.16.3.61:7070/
Content-Type: application/sdp
Content-Length: 1048

v=0
o=- 107291689700560000 1 IN IP4 0.0.0.0
s=Session streamed by RTP/RTSP server
i=ACTi.COM Streaming Media v
t=0 0
a=tool:ACTi.COM Streaming Media v2006.10.22
a=type:broadcast
a=control:*
a=range:ntp=now-
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=245;config=000001B003000001B50900000100000001200086C5D4C307D316843C146300
a=control:track1
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=245;config=000001B003000001B50900000100000001200086C5D4C307D316843C146300
a=control:track2
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=245;config=000001B003000001B50900000100000001200086C5D4C307D316843C146300
a=control:track3
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=245;config=000001B003000001B50900000100000001200086C5D4C307D316843C146300
a=control:track4
m=audio 0 RTP/AVP 111
c=IN IP4 0.0.0.0
a=rtpmap:111 L16/8000
a=control:track5


SETUP rtsp://172.16.3.61:7070/track1 RTSP/1.0
CSeq: 45
Transport: RTP/AVP;unicast;client_port=1314-1315
User-Agent: VLC media player (LIVE555 Streaming Media v2006.03.16)

RTSP/1.0 200 OK
CSeq: 45
Date: Thu, Jan 01 2004 00:28:17 GMT
Transport: RTP/AVP;unicast;destination=172.16.3.184;client_port=1314-1315;server_port=2084-2085
Session: 1


SETUP rtsp://172.16.3.61:7070/track2 RTSP/1.0
CSeq: 46
Transport: RTP/AVP;unicast;client_port=1316-1317
Session: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2006.03.16)

RTSP/1.0 200 OK
CSeq: 46
Date: Thu, Jan 01 2004 00:28:17 GMT
Transport: RTP/AVP;unicast;destination=172.16.3.184;client_port=1316-1317;server_port=2086-2087
Session: 1


SETUP rtsp://172.16.3.61:7070/track3 RTSP/1.0
CSeq: 47
Transport: RTP/AVP;unicast;client_port=1318-1319
Session: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2006.03.16)

RTSP/1.0 200 OK
CSeq: 47
Date: Thu, Jan 01 2004 00:28:17 GMT
Transport: RTP/AVP;unicast;destination=172.16.3.184;client_port=1318-1319;server_port=2088-2089
Session: 1


SETUP rtsp://172.16.3.61:7070/track4 RTSP/1.0
CSeq: 48
Transport: RTP/AVP;unicast;client_port=1320-1321
Session: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2006.03.16)

RTSP/1.0 200 OK
CSeq: 48
Date: Thu, Jan 01 2004 00:28:17 GMT
Transport: RTP/AVP;unicast;destination=172.16.3.184;client_port=1320-1321;server_port=2090-2091
Session: 1


SETUP rtsp://172.16.3.61:7070/track5 RTSP/1.0
CSeq: 49
Transport: RTP/AVP;unicast;client_port=1322-1323
Session: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2006.03.16)

RTSP/1.0 200 OK
CSeq: 49
Date: Thu, Jan 01 2004 00:28:17 GMT
Transport: RTP/AVP;unicast;destination=172.16.3.184;client_port=1322-1323;server_port=2092-2093
Session: 1


PLAY rtsp://172.16.3.61:7070 RTSP/1.0
CSeq: 50
Session: 1
Range: npt=now-
User-Agent: VLC media player (LIVE555 Streaming Media v2006.03.16)

RTSP/1.0 200 OK
CSeq: 50
Date: Thu, Jan 01 2004 00:28:17 GMT
Range: npt=now-
Session: 1
RTP-Info: url=rtsp://172.16.3.61:7070/track1;seq=7244,url=rtsp://172.16.3.61:7070/track2;seq=60731


TEARDOWN rtsp://172.16.3.61:7070 RTSP/1.0
CSeq: 51
Session: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2006.03.16)

RTSP/1.0 200 OK
CSeq: 51
Date: Thu, Jan 01 2004 00:28:37 GMT

See Also

Tunneling RTSP and RTP over HTTP

GO BACK

HOME