Skip to main content

PTZ Presets

Application Guide

For a complete walkthrough of PTZ camera control with code examples, see the PTZ Camera Control application guide.

Manage PTZ preset positions -- save, list, recall, and delete named camera positions. This page covers four related endpoints:

  • PtzGotoPreset -- move the camera to a saved preset
  • PtzGetPresets -- list all saved presets
  • PtzAddPreset -- save the current position as a new preset
  • PtzDeletePreset -- remove a saved preset

Endpoint Summary

CommandEndpointMethodRequest Body
PtzGotoPreset/PtzGotoPreset[/channelId]POSTPreset ID
PtzGetPresets/PtzGetPresets[/channelId]POST or GETNone
PtzAddPreset/PtzAddPreset[/channelId]POSTPreset name
PtzDeletePreset/PtzDeletePreset[/channelId]POSTPreset ID

Products: IPC, NVR Channel ID: Optional (default 1)


PtzGotoPreset

Moves the camera to a saved preset position by ID.

Request Example

<?xml version="1.0" encoding="utf-8"?>
<presetInfo version="1.0" xmlns="http://www.ipc.com/ver10">
<id>2</id>
</presetInfo>
ParameterTypeDescription
iduint32The preset ID to navigate to (as returned by PtzGetPresets)

PtzGetPresets

Returns a list of all saved preset positions with their IDs and names.

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<config version="1.0" xmlns="http://www.ipc.com/ver10">
<presetInfo type="list" maxCount="360">
<itemType type="string" maxLen="10"></itemType>
<item id="1"><![CDATA[DDD]]></item>
</presetInfo>
</config>
ParameterTypeDescription
maxCountuint32Maximum number of presets supported by this device
item (attribute: id)uint32Preset ID number
item (value)stringPreset name (max 10 characters)

PtzAddPreset

Saves the camera's current position as a new named preset. First move the camera to the desired position using PtzControl, then call this endpoint.

Request Example

<?xml version="1.0" encoding="utf-8"?>
<presetInfo version="1.0" xmlns="http://www.ipc.com/ver10">
<name><![CDATA[preset1]]></name>
</presetInfo>
ParameterTypeRangeDescription
namestringMax 10 charactersName for the preset position

PtzDeletePreset

Deletes a saved preset by ID.

Request Example

<?xml version="1.0" encoding="utf-8"?>
<presetInfo version="1.0" xmlns="http://www.ipc.com/ver10">
<id>2</id>
</presetInfo>
ParameterTypeDescription
iduint32The preset ID to delete

Notes

  • Use PtzGetCaps to check presetMaxCount for the maximum number of presets your device supports (typically 255 or 360).
  • Preset names are limited to 10 characters and should be wrapped in CDATA tags.
  • Presets are stored on the device and persist across reboots.