Guys, I need your help badly. I need to play a stream recorded from an IP camera. It's a RTSP stream served by Milestone XProtect's ONVIF bridge (for those who know).
I have on URL for the stream : rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650
VLC Media Player plays it good, but... always from the start. I have 7 days of video footage, and each time I launch the stream, VLC starts it from the very beginning, and "sliding further" is not possible.
Here is a sample from the console (using "-vvv"), showing the RTSP exchange between my client and the server :
Code: Select all
Sending request: OPTIONS rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650 RTSP/1.0
CSeq: 2
User-Agent: LibVLC/3.0.8 (LIVE555 Streaming Media v2019.11.06)
Received 208 new bytes of response data.
Received a complete OPTIONS response:
RTSP/1.0 200 OK
CSeq: 2
Date: Mon, Apr 20 2020 00:09:03 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER
Supported: play.basic, play.scale, setup.rtp.rtcp.mux
Sending request: DESCRIBE rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650 RTSP/1.0
CSeq: 3
User-Agent: LibVLC/3.0.8 (LIVE555 Streaming Media v2019.11.06)
Accept: application/sdp
Received 170 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 401 Unauthorized
CSeq: 3
Date: Mon, Apr 20 2020 00:09:03 GMT
WWW-Authenticate: Digest realm="RtspServerLibrary", nonce="A6Dl5quCyjPo9OCbl0Yzy8XcNncYMdO6"
Resending...
Sending request: DESCRIBE rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650 RTSP/1.0
CSeq: 4
Authorization: Digest username="admin", realm="RtspServerLibrary", nonce="A6Dl5quCyjPo9OCbl0Yzy8XcNncYMdO6", uri="rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650", response="bafe1f107003a143516e018dcefc4080"
User-Agent: LibVLC/3.0.8 (LIVE555 Streaming Media v2019.11.06)
Accept: application/sdp
[000055c32501b1d0] qt interface debug: IM: Setting an input
Received 1034 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 4
Date: Mon, Apr 20 2020 00:09:03 GMT
Supported: play.basic, play.scale, setup.rtp.rtcp.mux
Content-base: rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650
Content-type: application/sdp
Content-Length: 778
v=0
o=- 1587341343721651 1 IN IP4 127.0.0.1
s=libRtspServer
c=IN IP4 0.0.0.0
t=0 0
a=tool:libRtspServer 1.0.0
a=range:npt=0.0-563733.7
a=range:clock=20200413T113328Z-20200413T180229Z;clock=20200413T182142Z-20200413T183743Z;clock=20200413T184242Z-20200413T213537Z;clock=20200413T213712Z-20200413T224433Z;clock=20200414T214842Z-20200414T231642Z;clock=20200415T074251Z-20200415T080405Z;clock=20200415T082609Z-20200415T183839Z;clock=20200416T082017Z-20200416T150512Z;clock=20200416T190047Z-20200416T193611Z;clock=20200416T220036Z-20200416T230506Z;clock=20200417T074825Z-20200417T154347Z;clock=20200419T085648Z-20200419T121145Z;clock=20200419T144845Z-
m=video 0 RTP/AVP 96
a=framerate:1.000000
a=rtpmap:96 H264/90000
a=control:streamid=0
a=fmtp:96 packetization-mode=1;
[00007f0cf80011a0] live555 demux debug: RTP subsession 'video/H264'
Sending request: SETUP rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650/streamid=0 RTSP/1.0
CSeq: 5
Authorization: Digest username="admin", realm="RtspServerLibrary", nonce="A6Dl5quCyjPo9OCbl0Yzy8XcNncYMdO6", uri="rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650", response="e1e212e63c54dc4af516084fd402347e"
User-Agent: LibVLC/3.0.8 (LIVE555 Streaming Media v2019.11.06)
Transport: RTP/AVP;unicast;client_port=59114-59115
Received 235 new bytes of response data.
Received a complete SETUP response:
RTSP/1.0 200 OK
CSeq: 5
Date: Mon, Apr 20 2020 00:09:03 GMT
Session: C9DC4585
Transport: RTP/AVP;unicast;client_port=59114-59115;server_port=4000-4001
Media-Properties: Random-Access=2.5, Unlimited, Immutable, Scales="-16:16"
[00007f0d00000c80] main input debug: selecting program id=0
[00007f0cf80011a0] live555 demux debug: setup start: 0,000000 stop:0,000000
Sending request: PLAY rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650 RTSP/1.0
CSeq: 6
Authorization: Digest username="admin", realm="RtspServerLibrary", nonce="A6Dl5quCyjPo9OCbl0Yzy8XcNncYMdO6", uri="rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650", response="3c1b8a89c5f630f673216a026c965ebe"
User-Agent: LibVLC/3.0.8 (LIVE555 Streaming Media v2019.11.06)
Session: C9DC4585
Range: npt=0.000-
Received 221 new bytes of response data.
Received a complete PLAY response:
RTSP/1.0 200 OK
Scale: 1
Range: npt=0.000-
CSeq: 6
Date: Mon, Apr 20 2020 00:09:03 GMT
Session: C9DC4585
RTP-Info: url=rtsp://192.168.137.196:554/vod/D88F96F3-D1F5-4A05-BAB3-E1A8009CF650;seq=43428;rtptime=6852
As you can see in the response of the DESCRIBE request, there are all the records I can play :
a=range:clock=20200413T113328Z-20200413T180229Z;clock=20200413T182142Z-20200413T183743Z;clock=20200413T184242Z-20200413T213537Z;clock=20200413T213712Z-20200413T224433Z;clock=20200414T214842Z-20200414T231642Z;clock=20200415T074251Z-20200415T080405Z;clock=20200415T082609Z-20200415T183839Z;clock=20200416T082017Z-20200416T150512Z;...
But HOW can I tell VLC to start playing the stream at a given, absolute, time? What is the syntax? I tried many many ways, still the PLAY request specifies Range: npt=0.000- so I understand I only have the beginning.
Also, what is the correct code to do it using libvlc in C/C++ ? I already have a graphical integration but I need to specify an absolute time to start the stream.
Please help me, I've been searching 2 weeks without success, and I'm under pressure because I'm late for delivery...
Kind regards
Boris