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. |
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* 3 Dual Stream Mode Stream 1 Video 1 Stream 2 Video 2 audio* 3 *: if there is an audio function on the device or the audio function is enabled.
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 MPEG4 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.
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 describe all available media and streaming the media based on the setup commands rtsp://DeviceIP:RtspPort/udp rtsp://DeviceIP:RtspPort/multicast rtsp://DeviceIP:RtspPort/track1 describe all available media and streaming the media based on the setup commands. The track 1 is only expected in the RTSP setup session. However, the server could provide other media streams if the client setup other tracks in the RTSP setup session.
The server has to be able to parser the parameter, track1, udp/track1, and multicast/track1 to response the setup request.rtsp://DeviceIP:RtspPort/udp/track1 tsp://DeviceIP:RtspPort/multicast/track1 rtsp://DeviceIP:RtspPort/trackn n : the track number.
describe all available media and streaming the media based on the setup commands. The track n is only expected in the RTSP setup session. However, the server could provide other media streams if the client setup other tracks in the RTSP setup session.
The server has to be able to parser the parameter, trackn, udp/trackn, and multicast/trackn to response the setup requestrtsp://DeviceIP:RtspPort/udp/trackn tsp://DeviceIP:RtspPort/multicast/trackn Special Note for platformT encoders
In platformT, the presentation of V2_STREAMING_METHOD is different from the platformW and platformA. 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. The RTP_MULTICAST_STREAMING URL is a dummy URL in platformT.
RTSP Connection Command RTP streaming protocol
rtsp://DeviceIP:RtspPort Unicast rtsp://DeviceIP:RtspPort/udp Unicast rtsp://DeviceIP:RtspPort/multicast Multicast The server will not multicast the media streams even the V2_STREAMING_METHOD is 4 or 5. It starts to send the multicast media streams as a client completes the RTSP signaling for multicasting. The server stops multicasting when there is no client connected to it for multicasting.
PLAY Command
When the client is success in SETUP session, it sends the PLAY command to ask the server to send the media streams if the streaming protocol is unicast. In multicast streaming protocol, the server sends the multicasting media streams all the time. The client just listens the RTP ports given in the DESCRIBE and SETUP sessions for media streams.
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:7070Example:
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