Skip to content

ONVIF Replay

To use the ONVIF Replay, first get the list of the recordings available on the ONVIF DVR or IP camera:

VideoGrabber.VideoSource = vs_IPCamera;
VideoGrabber.IPCameraURL = "onvif://192.168.2.144";
VideoGrabber.SetAuthentication (at_IPCamera, "user", "password");
string XMLRecordings = VideoGrabber.ONVIFDeviceInfo (onv_XMLReplay);

Then extract from XMLRecordings the URL of the recording that must be replayed ("uri" field), and pass the extracted URL (*) to IPCameraURL:

VideoGrabber.VideoSource = vs_IPCamera;
VideoGrabber.IPCameraURL = "rtsp://..."; // (*)
VideoGrabber.SetAuthentication (at_IPCamera, "user", "password");
VideoGrabber.StartPreview();

Note: if seeking is required, add ">starttime=nnn" at the end of the replay URL (with nnn expressed in milliseconds). E.g., to start the replay at 15 seconds (15000 ms):

rtsp://192.168.1.22/rtsp_tunnel?rec=1&vcd=2>starttime=15000

Example of XML data structure returned for 2 recordings:

<recordings>
  <recording>
    <id>Cam1Rec0</id>
    <source>SRC_1_0</source>
    <name>________</name>
    <description>Cam1Rec0</description>
    <address>LOCAL_SRC_1_0</address>
    <uri>rtsp://192.168.8.139/rtsp_tunnel?rec=1&vcd=2&enableaudio=1&audio_mode=0&aacOut=1&silence=0</uri>
  </recording>
  <recording>
    <id>Cam1Rec1</id>
    <source>SRC_1_1</source>
    <name>________</name>
    <description>Cam1Rec1</description>
    <address>LOCAL_SRC_1_1</address>
    <uri>rtsp://192.168.8.139/rtsp_tunnel?rec=1&inst=2&vcd=2&enableaudio=1&audio_mode=0&aacOut=1&silence=0</uri>
  </recording>
</recordings>