ONVIF: camera information and discovery
Getting camera information without starting the live stream
- create the filter instance,
- query the filter interface and invoke (e.g. in C++):
hr = DatasteadRtspSourceConfig.Action (RTSP_Action_GetONVIFInfo, "rtsp://...");
if (SUCCEEDED (hr)) {
WCHAR *OnvifInfo;
hr = DatasteadRtspSourceConfig.GetStr (RTSP_ONVIF_Info_As_XML_str, &OnvifInfo);
if (SUCCEEDED (hr)) {
MessageBox (0, OnvifInfo, NULL, 0);
}
}
You can then invoke the GetStr (RTSP_ONVIF_Info...) functions to read the individual ONVIF settings (manufacturer, model, serial number, firmware version, PTZ information...), see the Parameter identifiers section.
ONVIF discovery
The filter supports the ONVIF discovery through the IDatasteadONVIFDiscovery interface, declared in the following files:
| Language | Declaration file |
|---|---|
| C# | Include\C#\DatasteadRTSPSourceFilter.cs |
| VB.NET | Include\C#\DatasteadRTSPSourceFilter.vb |
| C++ | Include\C++\DatasteadRTSPSourceFilter.h |
| Delphi | Include\Delphi\DatasteadRTSPSourceFilter.pas |
The interface exposes the following functions:
DiscoverCameras_MulticastDiscoverCameras_ScanIPNetworkDiscoverCameras_ScanIPRangeCancelCameraDiscoveryEnumCamerasDiscoveredSetDiscoveryNotificationCallback
Usage:
- to discover the IP cameras, invoke one of the 3
DiscoverCameras...functions, - to enumerate the cameras discovered from the discovery notification callback, invoke
EnumCamerasDiscoveredin a loop by incrementing CameraIndex, starting from 0, until the function returns false.
The sample code is included in the DatasteadRTSPSource_CSharp_Demo C# project.