Skip to content

ONVIF Cameras Discovery

The ONVIF cameras can be discovered in multicast mode, by scanning a range of IP addresses, or both, by invoking both functions consecutively. Both discoveries can run at the same time: the cameras found are accumulated in the same list, which is cleared when a discovery starts while no other discovery is running.

The discovery is performed in the background.

Starting the discovery

Note

timeout_seconds_or_0_for_default is the total duration of the discovery; 0 selects the default duration (4 seconds). 2 to 5 seconds are usually sufficient.

Stopping the discovery before its completion

If needed, invoke ONVIFCancelDiscovery () to stop the current background process.

Results of the discovery

From any of these events, ONVIFEnumCamerasDiscovered can be invoked for each camera, whose index is specified by the CameraIndex parameter. When CameraIndex >= the number of cameras, the function returns false.

The sample code is included in the Delphi and C# MainDemo projects.