Using the API to send pan and tilt commands - is it asynchronous? #492
-
Hi, I'm currently developing an application that requires using the api of AXIS. The idea is the following: I need to move the camera x degrees to the right capture a frame from the camera, process it with an algorithm. This process is in a loop. What I noticed is that the movement command is asynchronous, for instance after I move the camera without a time sleep, the frame captured is distorted, which I know is because the camera is still moving. With a delay, after sending the command to move the camera, the frame is not distorted. From my understanding an asyncronous command works as the following: The command is sent, and while the camera is moving, the next instruction in the code is immediatelly executed. I mean when i do this command: The code below the requests.get is immediatelly executed while the camera is moving. This is not good. Is there anyway I can control the execution without time.sleep? I'm programming in python. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This automatically generated reply acts as a friendly reminder. Answers to your questions will most often come from the community, from developers like yourself. You will, from time to time, find that Axis employees answers some of the questions, but this is not a guarantee. Think of the discussion forum as a complement to other support channels, not a replacement to any of them. If your question remains unanswered for a period of time, please revisit it to see whether it can be improved by following the guidelines listed in Axis support guidelines. |
Beta Was this translation helpful? Give feedback.
-
It is asynchronous, For PTZ camera, it takes time to move to the position you set in API, the API will return once camera received the command, so you have to wait until the PTZ move to the postion and then do the snapshot you need. |
Beta Was this translation helpful? Give feedback.
It is asynchronous, For PTZ camera, it takes time to move to the position you set in API, the API will return once camera received the command, so you have to wait until the PTZ move to the postion and then do the snapshot you need.