Share via


4.2 RTSP Playback

This example shows the RTSP messages exchanged between a client and a DMS to initiate streaming of video content.

As shown in the figure below, an RTSP command sequence begins when the first request sent by a client to a server is a DESCRIBE request. The client then sends a SETUP request for each stream, followed by a PLAY request. After responding to the PLAY request, the DMS starts sending RTP packets to the client. RTCP packets can flow between the client and DMS in both directions. When the DMS has sent the last RTP packet, it sends an ANNOUNCE request to the client.

Typical RTSP command sequence

Figure 5: Typical RTSP command sequence

The DESCRIBE request and response look like this:

DESCRIBE

 rtsp://192.168.2.3:554/WMPNSSv4/2849580144/0_ezA3ODUyNTlFLUJERDUtNEFGQS04MEIwLTQ3MDVBMkQ0NTI0NX0uMC44.wmv RTSP/1.0
 User-Agent: WMPlayer/12.00.7600.16385 guid/3300AD50-2C39-46C0-AE0A-39E48EB3C868
 Accept: application/sdp
 Accept-Charset: UTF-8, *;q=0.1
 X-Accept-Authentication: Negotiate, NTLM, Digest
 Accept-Language: en-US, *;q=0.1
 CSeq: 1
 Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch, com.microsoft.wm.eosmsg, com.microsoft.wm.predstrm, com.microsoft.wm.fastcache, com.microsoft.wm.locid, com.microsoft.wm.rtp.asf, dlna.announce, dlna.rtx, dlna.rtx-dup, com.microsoft.wm.startupprofile
  
 RTSP/1.0 200 OK
 Content-Base: rtsp://192.168.2.3:554/WMPNSSv4/2849580144/0_ezA3ODUyNTlFLUJERDUtNEFGQS04MEIwLTQ3MDVBMkQ0NTI0NX0uMC44.wmv/
 Server: WMPNss/12.00.7233.0000
 Last-Modified: Sun, 14 Jun 2009 20:11:50 GMT
 Cache-Control: must-revalidate,proxy-revalidate,x-wms-content-size=26246026
 Content-Length: 2270
 Date: Fri, 04 Sep 2009 19:46:23 GMT
 X-Playlist-Gen-Id: 1
 Content-Type: application/sdp
 CSeq: 1
 Supported: com.microsoft.wm.srvppair, com.microsoft.wm.sswitch, com.microsoft.wm.eosmsg, com.microsoft.wm.predstrm, com.microsoft.wm.fastcache, dlna.announce, dlna.rtx, dlna.rtx-dup, com.microsoft.wmdrm-nd
  

Note The SDP example is omitted for brevity. For SDP examples, see section 4.1.

The DESCRIBE request illustrates the use of the User-Agent header (section 2.2.3.5), X-Accept-Authentication header (section 2.2.3.6) and Supported header (section 2.2.3.3.1).

The response to the DESCRIBE request sent by the DMS shows the use of the Cache-Control header (section 2.2.3.1), X-Playlist-Gen-Id header (section 2.2.3.7), and Supported header (section 2.2.3.3.2).

Next the client sends one or two SETUP requests. The client will send one SETUP request for audio content, and two SETUP requests for video content.

Two SETUP requests for video content and the corresponding responses look like this:

SETUP

 rtsp://192.168.2.3:554/WMPNSSv4/2849580144/0_ezA3ODUyNTlFLUJERDUtNEFGQS04MEIwLTQ3MDVBMkQ0NTI0NX0uMC44.wmv/audio RTSP/1.0
 User-Agent: WMPlayer/12.00.7600.16385 guid/3300AD50-2C39-46C0-AE0A-39E48EB3C868
 Accept-Charset: UTF-8, *;q=0.1
 X-Accept-Authentication: Negotiate, NTLM, Digest
 Accept-Language: en-US, *;q=0.1
 CSeq: 2
 X-Playlist-Gen-Id: 1
 Transport: RTP/AVPF/UDP;unicast;client_port=59462-59463;ssrc=2a0e3eea;mode=PLAY
 Buffer-Info.dlna.org: dejitter=1319264;TD=20000;BFR=0
  
 RTSP/1.0 200 OK
 Transport: RTP/AVPF/UDP;unicast;client_port=59462-59463;server_port=5004-5005;ssrc=d2ddf9b1;rtcp-fb-ssrc=56ea5280;mode=PLAY
 Server: WMPNss/12.00.7233.0000
 Blocksize: 1450
 Session: 11626846570809248029
 CSeq: 2
  
 SETUP rtsp://192.168.2.3:554/WMPNSSv4/2849580144/0_ezA3ODUyNTlFLUJERDUtNEFGQS04MEIwLTQ3MDVBMkQ0NTI0NX0uMC44.wmv/video RTSP/1.0
 User-Agent: WMPlayer/12.00.7600.16385 guid/3300AD50-2C39-46C0-AE0A-39E48EB3C868
 Accept-Charset: UTF-8, *;q=0.1
 X-Accept-Authentication: Negotiate, NTLM, Digest
 Accept-Language: en-US, *;q=0.1
 Session: 11626846570809248029
 CSeq: 3
 X-Playlist-Gen-Id: 1
 Transport: RTP/AVPF/UDP;unicast;client_port=59464-59465;ssrc=cd3b20a5;mode=PLAY
 Buffer-Info.dlna.org: dejitter=40623775;TD=25996;BFR=0
  
 RTSP/1.0 200 OK
 Transport: RTP/AVPF/UDP;unicast;client_port=59464-59465;server_port=5004-5005;ssrc=d79e123a;rtcp-fb-ssrc=033572b1;mode=PLAY
 Server: WMPNss/12.00.7233.0000
 Blocksize: 1450
 Session: 11626846570809248029
 CSeq: 3
  

The response to the SETUP request shows the use of the rtcp-fb-ssrc parameter on the Transport header (section 2.2.3.4).

The client then sends a PLAY request. The PLAY request and response look like this:

 PLAY rtsp://192.168.2.3:554/WMPNSSv4/2849580144/0_ezA3ODUyNTlFLUJERDUtNEFGQS04MEIwLTQ3MDVBMkQ0NTI0NX0uMC44.wmv RTSP/1.0
 X-Playlist-Seek-Id: 1
 User-Agent: WMPlayer/12.00.7600.16385 guid/3300AD50-2C39-46C0-AE0A-39E48EB3C868
 Accept-Charset: UTF-8, *;q=0.1
 WCT.DLNA.ORG: 1
 X-Accept-Authentication: Negotiate, NTLM, Digest
 Accept-Language: en-US, *;q=0.1
 Session: 11626846570809248029
 CSeq: 4
 Range: npt=0-
 Bandwidth: 2147483647
  
 RTSP/1.0 200 OK
 Scale: 1
 Range: npt=0-30.093
 Server: WMPNss/12.00.7233.0000
 Speed: 1
 RTP-Info: url=audio;seq=26415;rtptime=25366, url=video;seq=28232;rtptime=31729
 Session: 11626846570809248029
 CSeq: 4 
  

The PLAY request shows the usage of the X-Playlist-Seek-Id header (section 2.2.3.8).

After the DMS has finished streaming RTP packets, it sends an ANNOUNCE request to the client.

The ANNOUNCE request and response look like this:

 ANNOUNCE rtsp://192.168.2.3:554/WMPNSSv4/2849580144/0_ezA3ODUyNTlFLUJERDUtNEFGQS04MEIwLTQ3MDVBMkQ0NTI0NX0uMC44.wmv/ RTSP/1.0
 Server: WMPNss/12.00.7233.0000
 RTP-Info: url=audio;seq=27067;rtptime=55412, url=video;seq=46685;rtptime=61775
 X-Playlist-Gen-Id: 1
 Session: 11626846570809248029
 Event-Type.dlna.org: 2000
 Content-Type: application/x-wms-extension-cmd
 CSeq: 1
  
 RTSP/1.0 200 OK
 Server: WMPlayer/12.00.7600.16385 guid/3300AD50-2C39-46C0-AE0A-39E48EB3C868
 Session: 11626846570809248029
 CSeq: 1

The ANNOUNCE request shows the usage of the Content-Type header (section 2.2.3.2).

All other RTSP headers shown in this section are defined in either [RFC2326] or [DLNA].