Class ONVIFControl
ONVIF camera control class.
Implements
Inherited Members
Namespace: VisioForge.Core.VideoCapture
Assembly: VisioForge.Core.dll
Syntax
public class ONVIFControl : IDisposable
Constructors
ONVIFControl()
Initializes a new instance of the ONVIFControl class.
Declaration
public ONVIFControl()
ONVIFControl(BaseContext)
Initializes a new instance of the ONVIFControl class.
Declaration
public ONVIFControl(BaseContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| BaseContext | context | The context. |
Methods
Connect(String, String, String, Nullable<TimeSpan>, Int32)
Connects to camera.
Declaration
public bool Connect(string url, string username, string password, TimeSpan? timeout = null, int rtspPort = 554)
Parameters
| Type | Name | Description |
|---|---|---|
| String | url | ONVIF url (like http://192.168.1.100/onvif/device_service). |
| String | username | User name. |
| String | password | Password. |
| Nullable<TimeSpan> | timeout | Timeout. We suggest to use 5-10 seconds. |
| Int32 | rtspPort | RTSP port, 554 by default. |
Returns
| Type | Description |
|---|---|
| Boolean | The bool. |
Connect(Uri, String, String, Nullable<TimeSpan>, Int32)
Connects to camera.
Declaration
public bool Connect(Uri url, string username, string password, TimeSpan? timeout = null, int rtspPort = 554)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | url | ONVIF url (like http://192.168.1.100/onvif/device_service). |
| String | username | User name. |
| String | password | Password. |
| Nullable<TimeSpan> | timeout | Timeout. We suggest to use 5-10 seconds. |
| Int32 | rtspPort | RTSP port, 554 by default. |
Returns
| Type | Description |
|---|---|
| Boolean | The bool. |
ConnectAsync(String, String, String, Nullable<TimeSpan>, Int32)
Connects to camera (async).
Declaration
public Task<bool> ConnectAsync(string url, string username, string password, TimeSpan? timeout = null, int rtspPort = 554)
Parameters
| Type | Name | Description |
|---|---|---|
| String | url | ONVIF url (like http://192.168.1.100/onvif/device_service). |
| String | username | User name. |
| String | password | Password. |
| Nullable<TimeSpan> | timeout | Timeout. We suggest to use 5-10 seconds. |
| Int32 | rtspPort | RTSP port, 554 by default. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | The bool. |
ConnectAsync(Uri, String, String, Nullable<TimeSpan>, Int32)
Connects to camera (async).
Declaration
public Task<bool> ConnectAsync(Uri url, string username, string password, TimeSpan? timeout = null, int rtspPort = 554)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | url | ONVIF url (like http://192.168.1.100/onvif/device_service). |
| String | username | User name. |
| String | password | Password. |
| Nullable<TimeSpan> | timeout | Timeout. We suggest to use 5-10 seconds. |
| Int32 | rtspPort | RTSP port, 554 by default. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | The bool. |
Disconnect()
Disconnects from camera.
Declaration
public void Disconnect()
DisconnectAsync()
Disconnects from camera (async).
Declaration
public Task DisconnectAsync()
Returns
| Type | Description |
|---|---|
| Task | The Task. |
Dispose()
Dispose.
Declaration
public void Dispose()
Dispose(Boolean)
Dispose.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | disposing | Disposing parameter. |
Finalize()
Finalizes an instance of the ONVIFControl class.
Declaration
protected void Finalize()
GetDeviceCapabilities()
Gets the device capabilities.
Declaration
public Capabilities12 GetDeviceCapabilities()
Returns
| Type | Description |
|---|---|
| Capabilities12 | Capabilities12. |
GetDeviceCapabilitiesAsync()
Gets the device capabilities asynchronous.
Declaration
public Task<Capabilities12> GetDeviceCapabilitiesAsync()
Returns
| Type | Description |
|---|---|
| Task<Capabilities12> | Task<Capabilities12>. |
GetDeviceInformation()
Gets device information.
Declaration
public ONVIFDeviceInformation GetDeviceInformation()
Returns
| Type | Description |
|---|---|
| ONVIFDeviceInformation |
GetDeviceInformationAsync()
Gets device information (async).
Declaration
public Task<ONVIFDeviceInformation> GetDeviceInformationAsync()
Returns
| Type | Description |
|---|---|
| Task<ONVIFDeviceInformation> |
GetMediaEndpoints()
Gets the media endpoints.
Declaration
public MediaEndpoint[] GetMediaEndpoints()
Returns
| Type | Description |
|---|---|
| MediaEndpoint[] | MediaEndpoint[]. |
GetMediaEndpointsAsync()
Gets the media endpoints asynchronous.
Declaration
public Task<MediaEndpoint[]> GetMediaEndpointsAsync()
Returns
| Type | Description |
|---|---|
| Task<MediaEndpoint[]> | Task<MediaEndpoint[]>. |
GetProfiles()
Gets video profiles.
Declaration
public Profile[] GetProfiles()
Returns
| Type | Description |
|---|---|
| Profile[] | The Profile[]. |
GetProfilesAsync()
Gets video profiles (async).
Declaration
public Task<Profile[]> GetProfilesAsync()
Returns
| Type | Description |
|---|---|
| Task<Profile[]> | The Profile[]. |
GetVideoURL(Int32)
Get direct video URL (usually RTSP).
Declaration
public string GetVideoURL(int profileIndex = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | profileIndex | Profile index. First profile used by default. |
Returns
| Type | Description |
|---|---|
| String | The string. |
GetVideoURL(String)
Get direct video URL (usually RTSP).
Declaration
public string GetVideoURL(string profileName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | profileName | Profile name. |
Returns
| Type | Description |
|---|---|
| String | The string. |
GetVideoURLAsync(Int32)
Get direct video URL (usually RTSP).
Declaration
public Task<string> GetVideoURLAsync(int profileIndex = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | profileIndex | Profile index. First profile used by default. |
Returns
| Type | Description |
|---|---|
| Task<String> | The string. |
GetVideoURLAsync(String)
Get direct video URL (usually RTSP).
Declaration
public Task<string> GetVideoURLAsync(string profileName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | profileName | Profile name. |
Returns
| Type | Description |
|---|---|
| Task<String> | The string. |
PTZ_GetRanges()
Gets PTZ ranges for camera.
Declaration
public ONVIFPTZRanges PTZ_GetRanges()
Returns
| Type | Description |
|---|---|
| ONVIFPTZRanges | The ONVIFPTZRanges. |
PTZ_GetRangesAsync()
Gets PTZ ranges for camera (async).
Declaration
public Task<ONVIFPTZRanges> PTZ_GetRangesAsync()
Returns
| Type | Description |
|---|---|
| Task<ONVIFPTZRanges> | The ONVIFPTZRanges. |
PTZ_SetAbsolute(Single, Single, Single)
Set absolute pan-tilt-zoom values. Check ranges before usage.
Declaration
public void PTZ_SetAbsolute(float x, float y, float z)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | x | X. |
| Single | y | Y. |
| Single | z | Zoom. |
PTZ_SetAbsoluteAsync(Single, Single, Single)
Set absolute pan-tilt-zoom values (async). Check ranges before usage.
Declaration
public Task PTZ_SetAbsoluteAsync(float x, float y, float z)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | x | X. |
| Single | y | Y. |
| Single | z | Zoom. |
Returns
| Type | Description |
|---|---|
| Task | Task. |
PTZ_SetHome()
Sets PTZ home position.
Declaration
public bool PTZ_SetHome()
Returns
| Type | Description |
|---|---|
| Boolean | The bool. |
PTZ_SetHomeAsync()
Sets PTZ home position.
Declaration
public Task<bool> PTZ_SetHomeAsync()
Returns
| Type | Description |
|---|---|
| Task<Boolean> | The bool. |