Working with PTZ Cameras

Introduction

Eagle Eye Cloud Cloud VMS is compatible with wide range of PTZ cameras in the market.

Learn more about PTZ cameras here.

It is possible to control PTZ cameras using API. The following sections describe how you can work with PTZ cameras.

Checking a camera's PTZ capability

To check whether a camera has PTZ capability use the GET /cameras endpoint and include the capabilities parameter.

Result: If the value is true, the parameter provides the PTZ capabilities shown below.

"ptz": {
                    "capable": true,
                    "panTilt": true,
                    "zoom": true,
                    "positionMove": true,
                    "directionMove": true,
                    "centerOnMove": true
                }

Getting the current PTZ position

The GET /cameras/{cameraId}/ptz/position endpoint gives the current x, y, z coordinates of the PTZ. The x and y coordinates provide the position on the x, y plane and z represents the PTZ zoom.

curl --location --request GET 'https://<baseURL>/api/v3.0/cameras/10081a66/ptz/position' \
--header 'Authorization: Bearer <access_token>'


response:

{
    "x": -0.999667,
    "y": 0.4184,
    "z": 0.0
}

Moving a PTZ to a desired position

Use the PUT /cameras/{cameraId}/ptz/position endpoint to control the position of the PTZ.

curl --location --request PUT 'https://baseUrl/api/v3.0/cameras/10081a66/ptz/position' \
--header 'Authorization: Bearer c001~2fd0d73f17e5e7388ad748c74f8eefd3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <access_token>'\
--data-raw '{
  "moveType": "direction",
  "direction": [
    "left","left"
  ],
  "stepSize": "large"
}'

The following video shows the PTZ controls in action using Postman.