---
title: PTZ commands
slug: ptz-commands
docTags: 
createdAt: 2025-06-22T18:25:56.903Z
---

:::hint{type="info"}
These API changes will be introduced in 3.2.0
:::



### mediaPtz.php API Calls

All requests are GET requests sent to /media/mediaPtz.php.

**Required Parameters for All Commands:**

- id=\<device\_id>: The numeric ID of the camera.
- command=\<command\_name>: The command to execute.

### PTZ Commands and Parameters

| Command          | Description                                     | Additional Parameters                                                                                                                                        | Example URL                                                              |
| ---------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| **move**         | Moves the camera. Combines pan, tilt, and zoom. | <br />* pan=\<l\|r> (left/right)
* tilt=\<u\|d> (up/down)
* zoom=\<t\|w> (tele/in \| wide/out)
* panspeed=\<0.0-1.0>
* tiltspeed=\<0.0-1.0>
* duration=\<ms> | /media/mediaPtz.php?id=1\&command=move\&pan=r\&tilt=u\&panspeed=0.8      |
| **stop**         | Stops any current camera movement.              | *(None)*                                                                                                                                                     | /media/mediaPtz.php?id=1\&command=stop                                   |
| **query**        | Retrieves presets and feature capabilities.     | *(None)*                                                                                                                                                     | /media<br />/mediaPtz.php?id=1\&command=query                            |
| **capabilities** | Retrieves detailed ONVIF capabilities as JSON.  | *(None)*                                                                                                                                                     | /media/mediaPtz.php?id=1\&command<br />=capabilities                     |
| **save**         | Saves the current position to a new preset.     | preset=\<id><br />name=\<string>                                                                                                                             | /media/mediaPtz<br />.php?id=1\&command=save\&preset=1\&name=Front+Door  |
| **rename**       | Renames an existing preset.                     | preset=\<id><br />name=\<string>                                                                                                                             | /media/mediaPtz.php?id=1\&command=<br />rename\&preset=1\&name=Main+Gate |
| **go**           | Moves the camera to a specified preset.         | preset=\<id>                                                                                                                                                 | /media/mediaPtz.php<br />?id=1\&command=go\&preset=1                     |
| **clear**        | Deletes a specified preset.                     | preset=\<id>                                                                                                                                                 | /media/mediaPtz.php?id<br />=1\&command=clear\&preset=1                  |
| **sethome**      | Sets the camera's current position as home.     | *(None)*                                                                                                                                                     | /media/mediaPtz.php?id=1\&command=sethome                                |
| **gotohome**     | Moves the camera to its saved home position.    | *(None)*                                                                                                                                                     | /media/media<br />Ptz.php?id=1\&command=gotohome                         |

