Jazea / Onvif.Core

A lightweight ONVIF Discovery and Client library.
MIT License
71 stars 26 forks source link

how to get the device's current ptz datas? #23

Open ynioba opened 1 month ago

jlovald commented 1 month ago

You need to setup a camera as shown in the README, then use the camera's PTZClient.

var account = new Account("camera_ip", "camera_username", "camera_password");
var camera = Camera.Create(account, ex =>
{
    // exception
});

if (camera != null)
{
   var response = await camera.Ptz.GetStatusAsync();
}

For more info about the specifics of the response: https://www.onvif.org/specs/srv/ptz/ONVIF-PTZ-Service-Spec-v211.pdf https://www.onvif.org/wp-content/uploads/2016/12/ONVIF_WG-APG-Application_Programmers_Guide-1.pdf