PZT "integration", design question

Hi!

We want to control PTZ for a Camera from an application and we are planning to use the new camera task added in 2024 R2 (SetPtzAbsolutePosition) in Config API. If we have understood the API for this correctly when Panning, as an example, you can set a value between -1 and 1.0, and these are “absolute” values, like if I set 0 it will panned to the “center” and -1 and 1 will pan to max left/right?

If we want, in our UI, show to the user the current PTZ values should we subscribe to the MotionStopped event via your WebSocket API and then get the new PTZ values via the GetPtzAbsolutePosition task when we detected this event, is this correct?

Kind Regards Hans

I believe your understanding and description is correct.

For an understanding of the mentioned values I suggest you ‘play’ with the component sample - PTZ and Presents..

https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/ptzandpresets/readme.html&tree=tree_2.html

The idea to subscribe to the MotionStopped event is not bad, yet I have two reservations.

When you set up a patrolling scheme, you specify a transition period, and based on this the recording server disable motion detection for the period where the camera moves. This is made so in order to have a patrolling camera that only will report motion when there is actual motion and not motion because of the camera itself moving. This means that the camera will move and shift position without the MotionStopped event happening. Unfortunately the is no PTZMoveStopped event you can subscribe to instead.

The second reservation is less important, I was thinking that there will be a lot of motion detection starting and stopping that is not caused by the camera itself moving.

The idea will, as far as I can tell, work if not using patrolling.

Ok, thanks for your answer. We noticed now that there is a PtzMoveRelative method available in the RecorderCommandService (the SOAP API) that I think better suit our needs. We where waiting for the SetPtzAbsolutePosition support in 2024R2 to start the PTZ integrationen but we did not think of the implications related using absolute positioning.

Do you know if it there is any plan (in near future) to add a “SetPtzRelativePosition” task to the Config API? But I think since we will use the RecorderCommandService for recoding search it will be quite easy for us to control the PTZ from that API as well.

/Hans

About “SetPtzRelativePosition” allow me a little longer explanation.

Most PTZ cameras are absolute positioning and this means they can work with a set of coordinates, you can ask the camera where it is and it will answer with a set of coordinates, and reversely you can give a set of coordinates and ask the camera to turn to that position.

Some cameras are relative positioning and this means the do not work with coordinates. Instead of asking the camera to go to a position given by coordinates, you can just tell it to go right or left (or any direction). As a relative positioning you cannot ask for or use coordinates. I believe relative positioning PTZ cameras are getting less common, they were very common when the conversion from analog to digital in cameras and cctv started.

Given this nature of absolute and relative positioning I don’t think “SetPtzRelativePosition” will make sense.

If you think I misunderstood the question and you had something else in mind let me know.

Ok, I think I understand… but just to double check :slight_smile: … so if we want, in our UI, support panning/tilting/zooming in small steps we should/could do a GetPtzAbsolutePosition and take the returned coordinates, adjust them (for example add 0.1 to the pan value) and then do a SetPtzAbsolutePosition with the adjusted values.

Regarding “Some cameras are relative positioning and this means the do not work with coordinates” , do you know if we get an error if we do a Get/SetPtzAbsolutePosition for such a camera? But based on you description I do not think we will have customers with that old cameras.

/Hans

Yes, small step moves could be done like that.

You get no errors if the camera does not support absolute positioning, in that case GetPtzAbsolutePosition returns zeros and SetPtzAbsolutePosition does nothing.