PTZ

Authentication

HTTP Basic / Digest authentication is required. The user must have permission to control system devices.

PTZ URL Format

The PTZ URL default format is as follows:

GET /ptz/[camera]?action=[action]
  • The camera is the number of the camera to control, starting at 0.
  • The action indicates the PTZ action.

Commands other than the position and stop commands can take a timeout (milliseconds) argument. If you send a command with a timeout argument, the camera will automatically send a stop command after that time has passed. will automatically send a stop command to the camera. The default value for timeout is 1 second, A timeout value of 0 will not automatically send a stop command.

Pan / Tilt / Zoom / Focus

Actions:

  • stop: Stop
  • pan-left: Pan left
  • pan-right: Pan right
  • tilt-up: Tilt up
  • tilt-down: Tilt down
  • left-up: Move left up
  • left-down: Move left down
  • right-up: Move up right
  • right-down: Move right down
  • zoom-tele: Zoom tele
  • zoom-wide: Zoom out
  • focus-near: Focus near
  • focus-far: Focus far away

The pan / tilt / zoom / focus commands can take a speed argument. This argument indicates the speed of movement, with values ranging from 1 to 100.

The following is an example of moving Pan to the left with a speed of 50.

GET /ptz/0?action=pan-left&speed=50 HTTP/1.1

The following is an example of moving Tilt down with a speed of 100.

GET /ptz/0?action=tilt-down&speed=100 HTTP/1.1

The following is an example of stopping PTZ movement.

GET /ptz/0?action=stop HTTP/1.1

Auto Pan / Tilt

Actions:

  • pan-auto-on: Start Auto Pan
  • pan-auto-off: Stop Auto Pan
  • pan-auto-set-start: Set Auto Pan start position
  • pan-auto-set-end: Set Auto Pan end position
  • tilt-auto-on: Start Auto Tilt
  • tilt-auto-off: Stop Auto Tilt

The following is the command to start Auto Pan:

GET /ptz/0?action=pan-auto-on HTTP/1.1

The follwing is the command to stop Auto Pan:

GET /ptz/0?action=pan-auto-off HTTP/1.1

Auto Focus

Actions:

  • focus-auto: Focus Auto

The follwing is the command to run Auto Focus:

GET /ptz/0?action=focus-auto HTTP/1.1

Preset

Actions:

  • preset-set: Preset set
  • preset-reset: Preset reset
  • preset-move: Preset move

The preset argument represents the preset number, which can range from 1 to 255.

The following example navigates to Preset 1.

GET /ptz/0?action=preset-move&preset=1 HTTP/1.1

Here's an example of setting up Preset 2.

GET /ptz/0?action=preset-set&preset=2 HTTP/1.1

Tour

Start and stop tours set up on the NVR.

Actions:

  • tour-start: Tour start
  • tour-stop: Tour stop

The tour argument represents the tour number, which can range from 1 to 16.

The following example starts Tour 1.

GET /ptz/0?action=tour-start&tour=1 HTTP/1.1

The following example stops Tour.

GET /ptz/0?action=tour-stop HTTP/1.1

Home Position

Set or move the home position of a camera that supports the PTZ Home function.

Actions:

  • home-set: Home Set
  • home-reset: Home Reset
  • home-move: Move to Home

The following is an example of navigating to the home location.

GET /ptz/0?action=home-move HTTP/1.1

The following is an example of setting the home location.

GET /ptz/0?action=home-set HTTP/1.1

Move to Center

Move the PTZ so that the requested position is the center of the video.

Actions:

  • center: Move to the center position

It takes the following arguments

  • x: Specifies the horizontal position of the center. (0 ~ 65535)
  • y: Specifies the vertical position of the center. (0 ~ 65535)

The following example moves the center to (1000, 8000).

GET /ptz/0?action=center&x=1000&y=8000 HTTP/1.1

Move to Absolute Position

Move the PTZ to an absolute position.

Actions:

  • position: Move to the absolute position.

The arguments it uses are:

  • pan: Specifies the pan position (0 ~ 65535)
  • tilt: Specifies the tilt position (0 ~ 65535)
  • zoom: Specifies the zoom position (0 ~ 65535)
  • focus: Specifies the focus position (0 ~ 65535)
  • autofocus: Whether to use autofocus (0 / 1)

If the autofocus value is 1, the focus value is ignored.

The following is an example to pan (1000), tilt (5000), zoom (2000), and focus (500).

GET /ptz/0?action=position&pan=1000&tilt=5000&zoom=2000&focus=500 HTTP/1.1

The following is an example of how to pan (1000), tilt (5000), zoom (2000), and using autofocus.

GET /ptz/0?action=position&pan=1000&tilt=5000&zoom=2000&autofocus=1 HTTP/1.1

Move to Area

Move the PTZ to the requested area.

Actions:

  • areazoom: Move to the area

It takes the following arguments:

  • x: Specifies the horizontal position at which the region starts (0 ~ 65535)
  • y: Specifies the vertical position where the region starts (0 ~ 65535)
  • width: Specifies the width from the x coordinate. (0 ~ 65535)
  • height: Specifies the height from the y coordinate. (0 ~ 65535)

Here is an example of navigating to an area of width (5000) and height (5000) based on coordinates (1000, 8000).

GET /ptz/0?action=areazoom&x=1000&y=8000&width=5000&height=5000 HTTP/1.1

AUX

Turn the camera's AUX device on and off.

Actions:

  • aux-on: AUX on
  • aux-off: AUX off

The device argument represents the AUX device number, with values ranging from 1 to 255.

The following example turns on AUX device #1.

GET /ptz/0?action=aux-on&device=1 HTTP/1.1

The following is an example of turning off AUX device #2.

GET /ptz/0?action=aux-off&device=2 HTTP/1.1

Others

Actions:

  • light-on: Light On
  • light-off: Light Off
  • wiper-on: Wiper On
  • wiper-off: Wiper Off
  • washer-on: Washer On
  • washer-off: Washer Off
  • power-on: Power On
  • power-off: Power Off
  • iris-in: Iris In
  • iris-out: Iris Out
  • iris-auto: Iris Auto
  • menu-on: OSD Menu On
  • menu-off: OSD Menu Off
  • menu-set: OSD Menu Set
  • position-restore: Restore PTZ Position

The following command turns on the wipers.

GET /ptz/0?action=wiper-on HTTP/1.1