Skip to content

Control a PTZ Camera

Control PTZ camera direction, zoom, presets, and wiper.

  • Name: PTZ camera control
  • Description: Moves a robot-mounted PTZ camera or controls its lens.
  • Method: POST
  • Path: remoteApi/cameraCtrl
  • Login required: No
  • Permission required: Yes

  • cameraCode · String · Required

    Camera code
    Example: 001

  • ctrlType · Integer · Required

    Control type: 3 robot-mounted PTZ; 4 zoom and focus
    Example: 3

  • command · Integer · Required

    Command
    Example: 4

  • value · Integer · Optional

    Command value
    Example: 0

  • channelNum · Integer · Optional

    Camera channel number. Pass 1 when ctrlType is 4; this field may be omitted when ctrlType is 3.
    Example: 1

Command values:

Shared parameters: ctrlType = 3; channelNum may be omitted. For value, use 1 to start or 0 to stop.

commandDescription
1Up
2Down
3Left
4Right
5Up-left
6Up-right
7Down-left
8Down-right

Shared parameters: ctrlType = 4, channelNum = 1. For autofocus (command = 5), value is not applicable.

commandDescription
1Zoom in
2Zoom out
3Increase focal length
4Decrease focal length
5Autofocus
{
"cameraCode": "001",
"ctrlType": 3,
"command": 4,
"value": 0,
"channelNum": 1
}

In this example, cameraCode identifies the camera; ctrlType = 3 selects PTZ control, command = 4 selects rightward movement, and value = 0 stops that movement.

FieldTypeExampleDescription
codeInteger200Status code
successBooleantrueWhether the request succeeded
msgStringsuccessResponse message
{
"success": true,
"code": 200,
"msg": "Operation succeeded",
"data": null
}
CodeDescription
400Invalid parameters
401Unauthorized
403Access denied
404Resource not found
500Internal server error