I have spent some time modifying the PTZandPresets sample to try and reproduce this issue but I have not been able to reproduce the lag with a modified sample. Whatever the problem is seems related to the customers hardware. I have been able to reproduce what seems like a bug on a Dahua driver, where I need to send a move stop command before I can send a move start command in a different direction. We are forwarding PTZ continuous move commands from the client application which uses a virtual joystick similar to what we see in the smart client (camera moves faster the further away you are from center). I need to be able to send a move start with different values quickly and this does not work on some camera drivers like Dahua.
I noticed they had a few cameras (Dahua, Hanwha, Axis, HikVision and other models) added with the ONVIF driver, and they enabled PTZ on all of them even though the cameras were not actually PTZ.
In my test on my local server, I added 4 cameras from different brands using the ONVIF driver, and one actual PTZ cam also with the ONVIF driver. No issues with my cameras.
Here is the modified sample, perhaps you will have more luck in your environment.
There is a checkbox to start polling the PTZ positions from ALL the cameras (not filtering by PTZ to have better chance to try and break it).
My guess at this point is that some device(s) on the customer site is slow to reply to the get absolute postion and perhaps that could be slowing down all the other commands?
To run the test, choose an actual PTZ camera, enable the new checkbox, and modify the Pan from -1 to 1 and click start after each time you change the pan value. Even without using the stop command, you should be able to send multiple start commands in a row in different directions and the camera will cooperate.
On the client system, if we send a start command on the dahua camera, flip the pan value and send another start command in the oposite direction, the camera will just stop and the following start commands in the same direction do not work.
If however you fire a stop command in between, the camera will change directions.
I do not have more ideas to reproduce the lag effect I was seeing in my standalone service code. Altough a difference is that in my code, I wait for the PTZ move command to return before I can fire the next one.
I did not know this behavior with Dahua cameras, this was perhaps throwing us off a bit but now I know the issue so I can try to code around it by sending a stop command before a new start command.
Edit: Also, when spamming PTZ commands, the Dahua camera crashes and restarts lol. Dahua DH-SD49225XAN-HNR