What is the best way to issue PTZ commands given a pan/tilt/zoom values -/+100

I am doing protocol integration for Milestone XProtect Professional+ with our API, and I would like to know given a set of PTZ relative speeds, i.e. { -10, 3, +20} that are between -100 and +100, what would be the best command to use. Our API assumes setting the speed to 0 would stop the move in that direction.

Any code examples would be greatly appreciated.

I think the RecorderCommandService PTZMoveStart and PTZMoveStop is what you are looking for. This uses a double and the ranges are in general [0..1].

There is no protocol sample but there is a sample that comes close, the PTZandPresets sample is a MIP library .Net sample but it illustrates the use of PTZMoveStart and PTZMoveStop.

PTZMoveStart

https://doc.developer.milestonesys.com/html/RecorderSOAPhelp/class_recorder_command_service.html#a05db8199a1a7d43d22e30af0c9ab3e71

PTZMoveStop

https://doc.developer.milestonesys.com/html/RecorderSOAPhelp/class_recorder_command_service.html#a176d37cdacd57670f4d02e3bc71958aa

PTZandPresets

https://doc.developer.milestonesys.com/html/index.html?base=samples/ptzandpresets_sample.html&tree=tree_search.html?search=ptzandpresets

Hi Rie,

Thank you for the response. Unfortunately we are using protocol integration only, so it’s either PTZ or PTZSetAbsolutePosition

https://doc.developer.milestonesys.com/html/index.html?base=samples/ptzandpresets_sample.html&tree=tree_search.html?search=ptzandpresets

It seems that PTZSetAbsolutePosition is not available for c type servers, so my only choice would be PTZ, and I would have to figure out how frequent to issue the request in order to achieve the desired behavior.

Thanks again.

Hi Ruslan,

PTZSetAbsolutePosition is doing something else entirely, it is configuring PTZ Presets on the e-code XProtect servers.

You should, from my understanding of your question, either use PTZMoveStart or PTZMoveAbsoluteCommand, both of which you can see used in the sample. PTZMoveStart is doing movement in a certain direction until you stop with PTZMoveStop. PTZMoveAbsoluteCommand makes the camera move to the absolute coordinates you order.

Hi Rie,

Thank you for your recommendation. We are using protocol integration only, so I am operating only on the documentation for PTZ using

https://doc.developer.milestonesys.com/html/index.html?base=samples/ptzandpresets_sample.html&tree=tree_search.html?search=ptzandpresets

Using PTZMoveStart and PTZMoveStop are only used by Component Integration, and therefore not available to us.

The sample is not protocol, you should use the Recorder Command Service. You can find both PTZMoveStart and PTZMoveAbsoluteCommand on the Recorder Commend Service.

Rie,

Thank you for the recommendation.