Absolute date/time seeking on a RTSP replay stream from Milestone ONVIF bridge (using libVLC)

Hi,

I need to use the replay via RTSP on one camera using the ONVIF bridge in Milestone XProtect.

So I use that kind of URL:

rtsp://user:passwd@my-onvif-bridge:554/vod/mid-camera-uuid

This works, but in the solution I develop, I also need to deliver a timeline widget which is able to seek the RTSP stream at a given, absolute time. So that one can see what the camera recorded at any time, if there was a recording.

Can someone give me some tips to achieve this goal (even by reloading the whole stream at a given time, doesn’t matter), using libVLC?

Kind regards

-

Hi Sullivan,

There are mainly two ways to get information for the camera recordings trough the ONVIF Bridge Server.

  • Use the “FindRecordings” command of the ONVIF interface.

This will require support for some SOAP commands, which could be tricky.

In addition there are specifics in the implementation of this command. There are few threads in the forum that describe it in details.

This however is the recommended way.

  • Use the “DESCRIBE” command response of the RTSP protocol.

There is a settings in the “Advanced” configuration tab of the ONVIF Bridge server settings in the MC MIP Plug-in for “Return sequences on command” as well as “Maximum number to return:” and "Return from start or end of recording: ".

Those by default are turned off, because they could cause significant delay of the response of the DESCRIBE command. If you enable them you will return information about the recordings in the SDP of the response like:

a=range:clock=20150929T170000Z-20150930T075116Z;clock=20150930T075435Z-20150930T153931Z;clock=20150930T154025Z-20150930T154818Z;

If I remember well it was possible to attach custom processor on command in the libVLC, so it will be feasible.

Thanks Petar for your reply.

I already have the information about the recordings, as I (finally) managed to make the FindRecordings SOAP call work (thanks to Tsvetomira Georgieva on another post).

Now what I need is to be able to start the stream at an absolute time.

I just tried some options, to see which are supported by your RTSP binding.

I try some options in VLC Media Player (the libvlc is the same).

The “run-time” option works, “run-time=20” plays my stream from the beginning and stops it after 20 seconds, “stop-time=20” does the same, but “start-time=20” doesn’t work. Nor does “start-time=clock=20200416T130000Z”.

Can you help me find a correct set of options to play a stream at a given, absolute time in VLC? I will then be able to code it.

Hi Sullivan,

As far as I know VLC doesn’t support absolute time. You could specify only a relative one. Exactly with “–start-time=X”, where X is the exact number of seconds since DB start.

And Yes, it is supported by Milestone RTSP server.

Please bear in mind the the VLC behavior is not (by me) the correct one. For example if you specify start time and speed you can see (with wireshark for example) the it first starts playback from the time zero (0), after that fires another PLAY with specified seek time (relative) and after a while another one with the needed speed.

Therefore in resulting stream you could receive few frames from the DB start and after that the needed ones.

Sorry to insist, but my request is quite urgent. I tried for days to give vlc parameters to start my replay stream at an absolute time, but without success. To be honest I’m not really sure that Milestone implemented it in the RTSP server of the ONVIF bridge.

If so, I need to know it to search a replacement solution, as I’m already 2 days late for delivery.

Regards

Hi Sullivan,

it is Easter time in Bulgaria, so we are on holiday until Tuesday.

Please refer to my answer in this question:

https://developer.milestonesys.com/s/question/0D73X000007XR80/is-it-possible-to-use-the-onvif-bridge-to-replay-archive-video-specifically-does-the-onvif-bridge-support-rtsp-time-range-requests-and-onvif-specified-rtp-extra-header-to-the-actual-time-of-the-frame?s1oid=00D200000008Uid&s1nid=0DB0O000000Kzmh&emkind=chatterCommentNotification&s1uid=0050O0000071vmN&emtm=1579636403783&fromEmail=1&s1ext=0