步骤一:
发送:
OPTIONS rtsp://127.0.0.1/172.30.31.225:8000:HIK-DS8000HC:0:1:admin:hs123456:av_stream RTSP/1.0
CSeq: 1
User-Agent:LIVE555 Streaming Media v2012.03.20
返回:
RTSP/1.0 200 OK
CSeq: 1
Public:OPTION, DESCRIBE, SETUP, PLAY, TEARDOWN, PAUSE
步骤二:
发送:
DESCRIBE rtsp://127.0.0.1/172.30.31.225:8000:HIK-DS8000HC:0:1:admin:hs123456:av_stream RTSP/1.0
CSeq: 2
User-Agent:LIVE555 Streaming Media v2012.03.20
Accept: application/sdp
返回:
RTSP/1.0 200 OK
CSeq: 2
Content-type: application/sdp
Content-length: 270
v=0
o=- 15537009225566771910 15537009225566771910 IN IP4 HS-PC
s=Unnamed
i=N/A
c=IN IP4 0.0.0.0
t=0 0
m=video 0 RTP/AVP 110
a=tool:vlc 2.1.3
a=recvonly
a=type:broadcast
a=charset:UTF-8
a=rtpmap:110 HIK/9600
b=RR:0
a=rtpmap:0 PCMU/8000
a=control:trackID=1
步骤三:
发送:
SETUP rtsp://127.0.0.1/172.30.31.225:8000:HIK-DS8000HC:0:1:admin:hs123456:av_stream/trackID=1 RTSP/1.0
CSeq: 3
User-Agent:LIVE555 Streaming Media v2012.03.20
Transport: RTP/AVP/TCP;unicast;destination=(null);client_port=10000-10001
返回:
RTSP/1.0 200 OK
CSeq: 3
Session: 1024//这个值是后面交互要用到值
Transport:RTP/AVP;unicast;server_port=10002-10003;client_port=10000-10001
步骤四:
发送:
PLAY rtsp://127.0.0.1/172.30.31.225:8000:HIK-DS8000HC:0:1:admin:hs123456:av_stream RTSP/1.0
CSeq: 4
User-Agent:LIVE555 Streaming Media v2012.03.20
Session:1024 //是上一步的返回值
Range:npt-0.000-
返回:
RTSP/1.0 200 OK
CSeq: 4
Session: 1024//是上一步的返回值
步骤五:
发送:
TEARDOWN rtsp://127.0.0.1/172.30.31.225:8000:HIK-DS8000HC:0:1:admin:hs123456:av_stream RTSP/1.0
CSeq: 5
User-Agent:LIVE555 Streaming Media v2012.03.20
Session:1024//是上一步的返回值
返回:
RTSP/1.0 200 OK
CSeq: 6
Date: Sat, Jan 01 2000 00:05:27 GMT