Camera Positioning Update Event

Hello,

I’m developing a plugin integration which runs in the Event Server. I’m testing with XProtect version 2021 R1. I’d like to receive an event if the user changes positioning information fields of a camera, ie: “GPS coordinates”, “Direction”, “Field of view”, or “Depth”.

I’m currently using code of the form:

_cameraConfigChangedObject = EnvironmentManager.Instance.RegisterReceiver(
    UpdateCameraConfig,
    new MessageIdFilter(
        MessageId.System.SystemConfigurationChangedIndication
     )
);

in order register for camera configuration changes. This appears to work fine for certain actions, such as a camera rename, but does not appear to fire when the Positioning Information fields are changed.

I’ve also tried to register for these changes like so:

_cameraConfigChangedObject = EnvironmentManager.Instance.RegisterReceiver(
    UpdateCameraConfig,
    new MessageIdAndRelatedKindFilter(
        MessageId.System.SystemConfigurationChangedIndication,
        VideoOS.Platform.Kind.Camera
    )
);

But also without any luck. I have set

EnvironmentManager.Instance.EnableConfigurationChangedService = true;

and am aware of the potential 60 second delay, and have waited as needed.

Any help would be appreciated.

Thanks,

Richard Zuber

Firstly, PTZ change, or camera positioning change, is not considered a configuration change by XProtect and this is the reason SystemConfiguratioChangedIndication does not work. Secondly, there is no such an event like Camera Positioning Changed Indication.

When trying to think of a workaround we have an idea that this KB article might be useful. https://developer.milestonesys.com/s/article/Find-out-if-a-camera-is-controlled-when-performing-manual-PTZ

The idea would be that you can see if someone is doing manual PTZ operations, when done you could read the PTZ coordinates of the camera. This will not work if the camera is doing patrolling where PTZ coordinates will change even if nobody manually manipulates the camera. Whether a workaround is feasible might depend on the use case scenario, but we hope you find a solution that might work for you.

Thanks for the info.

Is there any recommended way this situation to be handled? I don’t think instructing our users to restart the event server if any camera position information is changed would be ideal. I’m thinking our best bet would be to start a polling thread in the plugin that calls:

Configuration.Instance.GetItemsByKind(VideoOS.Platform.Kind.Camera);

periodically (say every 60 seconds) to look for any changes to the positioning fields.

Sorry, I realized I didn’t unfurl the rest of your reply above. I will also investigate that KB article you linked.

Thanks!