Skip to content

error getting ptz #50

Open
Open

Description

@chuckgmthompson

when trying to do the simple move example, I am getting a null exception.
I tracked it down to the caps.Capabilities.PTZ is null in here:

`public static async Task CreatePTZClientAsync (string host, string username, string password)
{
var binding = CreateBinding ();
var device = await CreateDeviceClientAsync (host, username, password);
var caps = await device.GetCapabilitiesAsync (new CapabilityCategory [] { CapabilityCategory.PTZ });
var ptz = new PTZClient (binding, new EndpointAddress (new Uri (caps.Capabilities.PTZ.XAddr)));

var time_shift = await GetDeviceTimeShift (device);
ptz.ChannelFactory.Endpoint.EndpointBehaviors.Clear ();
ptz.ChannelFactory.Endpoint.EndpointBehaviors.Add (new SoapSecurityHeaderBehavior (username, password, time_shift));

// Connectivity Test
await ptz.OpenAsync ();

return ptz;

}`

I have tried in on a few of my wansview cameras and get the same on each.
Anyone have any ideas?

Activity

  1. jlovald commented on Sep 11, 2025

    @jlovald

    Which specific camera models are you struggling with, and do they support pan/tilt?
    It might be that the vendor does not conform properly to the onvif specification, that Capabilities cannot be deserialized, or that the camera simply does not support PTZ movement through Onvif.

    If you can provide the raw response from the camera using Wireshark and post it. That would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions