PTZ Control in realtime

zeralight

n3wb
Feb 27, 2019
1
0
Bordeaux
I'm using the Hikvision Device Network SDK (for Windows 64-bit) to control a camera PTZ position. The control must be realtime: the camera moves accordingly the mouse movement on the screen.
I have found these APIs:
  1. NET_DVR_PTZControl( [ Start | Stop ], [ UP_LEFT | UP_RIGHT | ... (8 directions ): this is not very suitable as I want to have custom directions, for example to move in a direction for 60° Pan and 30° Tilt.
  2. NET_DVR_SetDVRConfig( NET_DVR_SET_PTZPOS, destination_pos): The problem I have experimented with this one is that It creates a new TCP socket for each request which creates latency problems.
It would be great if someone knows the best solution to this porblem
 
I used keyboard for ages with Hikvision PTZs...which is clunky, slow and imprecise at best. I also hated the mouse control in Blue Iris. I have now ended up using a Hikvision DS-1200KI keyboard/joystick, which is an enormous night and day improvement.

This is a cool solution as it works over LAN so doesn’t need extra cable connection like RS485 joysticks etc do.

If you go this route, be aware that not all Hikvision keyboards work over LAN...even ones that have USB ports. I think the 1200 is the cheapest one that will do it.
 
zeralight: Did you find a solution to this problem, I'm dealing with the same problem.

Isn't there a way to control it with joystick X Y information ?
 
if (!CHCNetSDK.NET_DVR_SetDVRConfig(m_lUserID, CHCNetSDK.NET_DVR_SET_PTZPOS, 1, ptrPtzCfg, (UInt32)nSize))
{
iLastErr = CHCNetSDK.NET_DVR_GetLastError();
str = "NET_DVR_SetDVRConfig failed, error code= " + iLastErr;
/设置POS参数失败
MessageBox.Show(str);
return;
} I used this command its always throwing me error code 11. This is from SDK preview Demo I can connect to camera, able to do Left,Right,Up,Down,ZoomIn,ZoomOut. But when i tried to use this command with passing same parameter which I am receiving from !CHCNetSDK.NET_DVR_GetDVRConfig(m_lUserID, CHCNetSDK.NET_DVR_GET_PTZPOS, -1, ptrPtzCfg, (UInt32)nSize, ref dwReturn) This get command. I am using Same SDK C# project what they provide from Site SDK

Let me know if someone know that's firmware version issue or any configuration will require for specific command please reply us.
 
zeralight: Did you find a solution to this problem, I'm dealing with the same problem.

Isn't there a way to control it with joystick X Y information ?
For this you can write your own logic base on Pan and Tilt Ratio and Deside direction with Pan or title rate.
 
What is the latency threshold you do not want to exceed?


  1. NET_DVR_SetDVRConfig( NET_DVR_SET_PTZPOS, destination_pos): The problem I have experimented with this one is that It creates a new TCP socket for each request which creates latency problems.

Have you tried isapi requests?

I believe the least latency relies in using rs485 directly on camera input itself. But then again whatever custom controller you make would need to be incredibly fast