C->S
OPTIONS rtsp://219.219.218.224:554/m RTSP/1.0
CSeq: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2009.07.09)
S->C
RTSP/1.0 200 OK
Server: vlc 1.0.1
Content-Length: 0
Cseq: 1
Public: DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE,GET_PARAMETER
C->S
DESCRIBE rtsp://219.219.218.224:554/m RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: VLC media player (LIVE555 Streaming Media v2009.07.09)
S->C
RTSP/1.0 200 OK
Content-type: application/sdp
Server: VLC Server
Content-Length: 544
CSeq: 2
Cache-Control: no-cache
v=0 //协议版本
o=- 78967746000 3 IN IP4 219.219.218.224 //拥有者,即会话的创建者
c=IN IP4 0.0.0.0 //连接信息,此处表示本机
t=0 0 //如果stop-time设置为0,则会话没有时间限制。如果start-time也设置为0,则会话被认为是永久的.
a=tool:vlc 1.0.1 //创建任务描述的工具的名称及版本号
a=range:npt=0-7.741 //视频的正常播放范围
m=audio 0 RTP/AVP 96 //音频流使用的协议 m= / …
a=rtpmap:96 mpeg4-generic/32000 //a=rtpmap: / [/]
a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1290; SizeLength=13;IndexLength=3; IndexDeltaLength=3; Profile=1; //a=fmtp:
a=control:rtsp://219.219.218.224:554/m/trackID=0
m=video 0 RTP/AVP 97 //视频流使用的协议
a=rtpmap:97 MP4V-ES/90000
a=fmtp:97 profile-level-id=3; config=000001b022000001b50900000100000001200084456a285020f0a300;
a=control:rtsp://219.219.218.224:554/m/trackID=1
C->S
SETUP rtsp://219.219.218.224:554/m/trackID=0 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=3106-3107
User-Agent: VLC media player (LIVE555 Streaming Media v2009.07.09)
S->C
RTSP/1.0 200 OK
Transport: RTP/AVP/UDP;client_port=3106-3107
Server: VLC Server
Content-Length: 0
Cseq: 3
Cache-Control: no-cache
Session: 11478
C->S
SETUP rtsp://219.219.218.224:554/m/trackID=1 RTSP/1.0
CSeq: 4
Transport: RTP/AVP;unicast;client_port=3108-3109
Session: 11478
User-Agent: VLC media player (LIVE555 Streaming Media v2009.07.09)
S->C
RTSP/1.0 200 OK
Transport: RTP/AVP/UDP;client_port=3108-3109
Server: VLC Server
Content-Length: 0
Cseq: 4
Cache-Control: no-cache
Session: 11478
C->S
PLAY rtsp://219.219.218.224:554/m RTSP/1.0
CSeq: 5
Session: 11478
Range: npt=0.000-
User-Agent: VLC media player (LIVE555 Streaming Media v2009.07.09)
S->C
RTSP/1.0 200 OK
Server: VLC Server
Content-Length: 0
CSeq: 5
Cache-Control: no-cache
Session: 11478;timeout=5
C->S
GET_PARAMETER rtsp://219.219.218.224:554/m RTSP/1.0
CSeq: 6
Session: 11478
User-Agent: VLC media player (LIVE555 Streaming Media v2009.07.09)
S->C
RTSP/1.0 200 OK
Server: VLC Server
Content-Length: 0
CSeq: 6
Cache-Control: no-cache
C->S
TEARDOWN rtsp://219.219.218.224:554/m RTSP/1.0
CSeq: 7
Session: 11478
User-Agent: VLC media player (LIVE555 Streaming Media v2009.07.09)
S->C
RTSP/1.0 200 OK
Server: VLC Server
Content-Length: 0
CSeq: 7
Cache-Control: no-cache
Session: 11478;timeout=5
以上是利用RTSP协议进行流媒体播放的一个完整过程,其中setup,play是必须用到的方法,其它方法是可选。上述红色的标注部分是对sdp协议的一些主要参数进行的解释。