Api Focus/Iris/Contrast/Brightness control
AnsweredIs it possible to control camera Focus/Iris/Contrast/Brightness with api calls? I'm interested in simple functions, like +/- on each.
-
Hi, We currently integrating NX Witness into our software to be able to see video streams, control PTZ cameras and more, we are using the "For Developers" tab, the "Server Api" and the "Video Api".
Video Streams and PTZ controls are very straight forward but I couldn't find any references or info to manually control the camera "lens" and image properties (i.e focus, iris, brightness, contrast...) with + and - buttons through the server Api, I've guessed it would be in PTZ controls but its not there.
Now i'm asking if its possible and how can one do it :) -
Hello Alex,
I couldn't find any references or info to manually control the camera "lens" and image properties (i.e focus, iris, brightness, contrast...)
The Server does not have these preferences.
However, the Server can act as an HTTP proxy server. That means, that you can send a request via the Server to control lens.
In this regard, I see two possible ways.
#1 Use Server as a proxy
Here is an example
curl -vk https://ya.ru -x http://admin:password@localhost:7001
In such manner, via the Server you can send any HTTP request to a camera.
#2 Use Generic Events
You could configure manually or programmatically a set of rules with "Generic Event" as event and "Do HTTP request" as Action.
"Generic Event" has several fields with corresponding placeholders, which can be used in the "Do HTTP Request" action. You can read more details about Generic Events in the built-in help in GUI.
Despite the description, you can utilize fields for any purpose you need.
Here is a solution.
1. You configure several Generic Event rule per camera
- one for focus control
- on for iris control,
- one for brightness control,
- one for contrast control
2. In the "Do HTTP Request" you set a URL invoking a corresponding API on a camera
you can use placeholders
{event.source} – Replaced by the content in the "Source contains" field.
{event.caption} – Replaced by the content in the "Caption contains" field.
{event.description}
for passing parameters to the URL
3. You trigger an event via /api/createEvent API
You can pass source, caption, description parameters to this API.
In total, the pipeline is as following:
/api/createEvent invoked -> Generic Event triggered -> Do HTTP Request sent -> Camera API invoked -> focus, iris, brightness, contrast changed.
Please sign in to leave a comment.
Comments
3 comments