ONVIF Cameras Discovery
Discovering ONVIF cameras
Description
ONVIF Cameras Network Discovery
It is possible to discover the ONVIF cameras in Multicast mode, by scanning a range of IP addresses, or both by invoking both functions consecutively.
The discovery is performed in the background.
Starting the discovery
- to discover the ONVIF cameras through a multicast request, invoke:
ONVIFDiscoverCameras_Multicast (timeout_seconds)
- to discover the ONVIF cameras through a range of IP addresses, invoke:
ONVIFDiscoverCameras_IPRange (first_IP, last_IP, timeout_seconds)
Note: a timeout of 2 to 5 seconds should be sufficient.
Stopping the discovery before its completion
- eventually invoke ONVIFCancelDiscovery() to stop the current background process, if needed.
Results of the discovery
- each camera discovered is notified by an event OnONVIFDiscoveryCompletedNotification (dcs_CameraFound, int CameraCount)
- the end of the multicast discovery is notified by an event OnONVIFDiscoveryCompletedNotification (dcs_MulticastCompleted, int CameraCount)
- the end of the IP range scanning is notified by an event OnONVIFDiscoveryCompletedNotification (dcs_IPRangeCompleted, int CameraCount)
From any of these events it is possible to invoke ONVIFEnumCamerasDiscovered 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.