定位录像时间的rtsp消息
编者:李国帅
背景原因:
使用rtsp至今依然是重要的媒体播放方式,这里回顾一下,录像定位方法。
定位消息play:
我们使用rtsp的play消息定位录像的位置,例如
PLAY rtsp://192.168.10.108:554/h264/ch1/main/av_stream RTSP/1.0
Authorization: Basic YWRtaW46MTIzNDU=
CSeq: 6
Session: 1528544584
Range: npt=0.0-
x-prebuffer: maxtime=0.0
User-agent: RtspClient
---------
RTSP/1.0 200 OK
CSeq: 6
Session: 1528544584
Range: npt=now-
RTP-Info: url=trackID=1;seq=17915,url=trackID=2;seq=57620
-------------------------------------------------------------------
在describe中查询录像长度和时间
RTSP/1.0 200 OK
Server: DSS/1.0.5 (Build/6; Platform/Linux; Release/Darwin Streaming Server; State/Development; )
Cseq: 3
Last-Modified: Tue, 08 May 2012 08:16:40 GMT
Cache-Control: must-reval(LIVE555 Streaming Media v2011.12.23)
Session: 7705749015246682008
Range: npt=0.000-
RTSP/1.0 200 OK
Server: DSS/1.0.5 (Build/6; Platform/Linux; Release/Darwin Streaming Server; State/Development; )
Cseq: 5
Session: 7705749015246682008
Range: npt=0.00000-698.40000
RTP-Info: url=rtsp://192.168.10.35:554/video1/trackID=0;seq=15619;rtptime=1911497317
PAUSE rtsp://192.168.10.35:554/video1/ RTSP/1.0
CSeq: 6
User-Agent: LibVLC/2.0.1 (LIVE555 Streaming Media v2011.12.23)
Session: 7705749015246682008
RTSP/1.0 200 OK
Server: DSS/1.0.5 (Build/6; Platform/Linux; Release/Darwin Streaming Server; State/Development; )
Cseq: 6
Session: 7705749015246682008
PLAY rtsp://192.168.10.35:554/video1/ RTSP/1.0
CSeq: 7
User-Agent: LibVLC/2.0.1 (LIVE555 Streaming Media v2011.12.23)
Session: 7705749015246682008
Range: npt=396.691-
RTSP/1.0 200 OK
Server: DSS/1.0.5 (Build/6; Platform/Linux; Release/Darwin Streaming Server; State/Development; )
Cseq: 7
Session: 7705749015246682008
Range: npt=396.69100-698.40000
RTP-Info: url=rtsp://192.168.10.35:554/video1/trackID=0;seq=17212;rtptime=1912838828
PLAY rtsp://192.168.10.35:554/video1/ RTSP/1.0
CSeq: 6
User-Agent: LibVLC/2.0.1 (LIVE555 Streaming Media v2011.12.23)
Session: 7705749015912989047
Scale: 1.100110
RTSP/1.0 200 OK
Server: DSS/1.0.5 (Build/6; Platform/Linux; Release/Darwin Streaming Server; State/Development; )
Cseq: 6
Session: 7705749015912989047
Speed: 1.10011
Range: npt=22.16000-698.40000
RTP-Info: url=rtsp://192.168.10.35:554/video1/trackID=0;seq=20973;rtptime=1294004159
PLAY rtsp://192.168.10.35:554/video1/ RTSP/1.0
CSeq: 10
User-Agent: LibVLC/2.0.1 (LIVE555 Streaming Media v2011.12.23)
Session: 7705749015912989047
Scale: 0.900090
RTSP/1.0 200 OK
Server: DSS/1.0.5 (Build/6; Platform/Linux; Release/Darwin Streaming Server; State/Development; )
Cseq: 10
Session: 7705749015912989047
Speed: 0.90009
Range: npt=97.16000-698.40000
RTP-Info: url=rtsp://192.168.10.35:554/video1/trackID=0;seq=32044;rtptime=1292160624