Get

Function

This API is used to get PTZ control information.

Request Message

Parameter Description

Table 1
ParameterRangeTypeDescription
channel"CH1"…"CHx",
"IP_CH1"…" IP_CHx",
"WIFI_CH1"…",WIFI_CHx",
The number of channels depends on the capabilities of the device.
stringChannel name.

Sample:

POST /API/PreviewChannel/PTZ/Get HTTP/1.1
{
    "version": "1.0",
    "data":{
        "channel": "CH1",
        "disable_ManualHumanTrace": false,
        "current_cruise_mode": "Mode_Default_Cruise",
        "zoom_step": 5,
        "focus_step": 5
    }
}

Response Message

Parameter Description

Table 2
ParameterRangeTypeDescription
channelstring
ptz_version"1.0","2.0","3.0"stringPtz version.
cmd"Ptz_Cmd_Up",
"Ptz_Cmd_Down",


"Ptz_Privacy_Mode",
"Ptz_Trace_Mode"
stringSee Table 3 for more information of cmd.
state"Stop","Start"stringFor button press and release.
zoom_step1,5,20intZoom adjust the number of steps.
focus_step1,5,20intFocus adjust the number of steps.
zoom_sliderDepending on the lensintZoom slider.
focus_sliderDepending on the lensintFocus slider.
isctlboolWhether gray screen; true: no gray screen; false: gray screen.
speed0-10
0-100(For DVR/NVR)
int(only control)
preset_point0-255int arrayThe maximum length of the array is 255, each bit represents a preset point, the value of each bit (0-255) represents the polling time of the corresponding preset point, 0 means no preset point is set for this bit.
line_scan_stateboolLine scan cruise state.
trace_preset_pointarrayPreset point set by TOUR.
preset_point_no1-255int(only control)
ctl_stopbooltrue:stop ctl operation(only control)
preset_point_time1-255intSingle preset point polling time.(only control)
preset_point_namelen:1-31stringPreset point name, ranging from 1 to 31 character.
zoom_minus_add"Ptz_Cmd_ZoomMinus"
"Ptz_Cmd_ZoomAdd"
objectRange used it to display the zoom button
focus_minus_add"Ptz_Cmd_FocusMinus",
"Ptz_Cmd_FocusAdd"
objectRange used it to display the focus button Range
iris_minus_add"Ptz_Cmd_IrisMinus",
"Ptz_Cmd_IrisAdd"
objectRange used it to display aperture buttons.
btn_autofocus"Ptz_Btn_AutoFocus"objectUsed to display the autofocus button.
btn_default"Ptz_Btn_Default"objectUsed to display the restore button.
btn_refresh"Ptz_Btn_Refresh"objectUsed to display the refresh button
preset_point_cruise_btn"Ptz_Cmd_Cruise"objectUsed to display the cruise buttons.
is_req_progressboolWhether to issue the progress polling command.
ptz_direction_control"Ptz_Cmd_Up"
"Ptz_Cmd_Down",
"Ptz_Cmd_Left",
"Ptz_Cmd_Right",
"Ptz_Cmd_UpLeft",
"Ptz_Cmd_UpRight",
"Ptz_Cmd_DownLeft",
"Ptz_Cmd_DownRight",
"Ptz_Cmd_CircleCenter"
objectRange used it to display direction control.
advanced_mode"Mode_Preset_Point",
"Mode_Watch_Mode",
"Mode_Line_Scan",
"Mode_Trace",
"Mode_Pattern_Scan"
objectRange used it to display each mode in the advanced mode.
trace_number0-3intTour 1-4 tracks.
pattern_scan_number0-3intPattern scan 1-4 tracks.
pattern_scan_number_isset0-3bool arrayWhether pattern scan 1-4 has been marked.
line_scan_speed"Low",
"Middle",
"High"
stringline scan speed
line_scan_areaboolWhether linear scan is set.
trace_interval"5s""6s""7s"….."59s""60s"stringTour time interval.
utc_protocolstringUtc Protocol.
utc_cmd"Coax_Cmd_Menu",
"Coax_Cmd_Up",
"Coax_Cmd_Left",
"Coax_Cmd_Right",
"Coax_Cmd_Down"
string
current_cruise_mode"Mode_Default_Cruise",
"Mode_Preset_Point",
"Mode_Watch_Mode",
"Mode_Line_Scan",
"Mode_Trace",
"Mode_Pattern_Scan",
"Mode_Restore_Btn"
stringCurrent pattern scan mode
belt_times_use0-100intBelt life, more than 90, prompt life is not enough, 100 can not cruise.
quick_use"Ptz_QuickUse_3DPosition",
"Ptz_QuickUse_AutoFocus",
"Ptz_QuickUse_PtzReset",
"Ptz_QuickUse_WatchMode",
"Ptz_QuickUse_ManualHumanTrace",
"Ptz_QuickUse_LensReset"
stringRange used it to display shortcut function buttons.
preset_point_obj0-256object arrayObject of the number of preset point arrays,see Table 4 for more information of member in array.
watch_mode_mode"Mode_Default_Cruise",
"Mode_Watch_Point",
"Mode_Line_Scan",
"Mode_Trace",
"Mode_Pattern_Scan"
stringMode of watch mode.
watch_mode_num0 - 255intNum of public modes in watch mode.(except linear scan)
watch_mode_num"low",
"middle",
"high"
stringLinear scan speed in watch mode.
Table 3
ParameterRangeTypeDescription
cmd"Ptz_Cmd_Up",
"Ptz_Cmd_Down",
"Ptz_Cmd_Left",
"Ptz_Cmd_Right",
"Ptz_Cmd_UpLeft",
"Ptz_Cmd_UpRight",
"Ptz_Cmd_DownLeft",
"Ptz_Cmd_DownRight",
"Ptz_Cmd_ZoomAdd",
"Ptz_Cmd_ZoomMinus",
"Ptz_Cmd_FocusAdd",
"Ptz_Cmd_FocusMinus",
"Ptz_Cmd_IrisAdd",
"Ptz_Cmd_IrisMinus",
"Ptz_Cmd_CircleCenter",
"Ptz_Cmd_Cruise",
"Ptz_Change_CruiseTime",
"Ptz_Cmd_AddPreset",
"Ptz_Cmd_ClearPreset",
"Ptz_Cmd_CallPreset",
"Ptz_Cmd_AuxiliartOpen",
"Ptz_Cmd_AuxiliartClose",
"Ptz_Cmd_LockFocus",
"Ptz_LineScan_StartPoint",
"Ptz_LineScan_EndPoint",
"Ptz_Cmd_LineScanSetSpeed",
"Ptz_LineScan_CruiseStart",
"Ptz_LineScan_CruiseStop",
"Ptz_Btn_Default",
"Ptz_Zoom_Position",
"Ptz_Focus_Position",
"Ptz_Zoom_Move",
"Ptz_Focus_Move",
"Ptz_Btn_AutoFocus",
"Ptz_AreaFocus",
"Ptz_Btn_Refresh",
"Ptz_CalibRationSetting",
"Ptz_Tour_Start",
"Ptz_Tour_Stop",
"Ptz_Pattern_CruiseStart",
"Ptz_Pattern_CruiseStop",
"Ptz_Pattern_RecordStart",
"Ptz_Pattern_RecordStop",
"Ptz_Net_Osd",
"Ptz_3Dposition",
"Ptz_Light",
"Ptz_Rain",
"Ptz_CalcpadNumSetting",
"Ptz_Cmd_NewSceneCalib",
"Ptz_Cmd_DefCruise_Start",
"Ptz_Cmd_DefCruise_Stop",
"Ptz_WatchPoint_Add",
"Ptz_Privacy_Mode",
"Ptz_Trace_Mode"
string(only control)
Table 4
ParameterRangeTypeDescription
no1-256intThe number of preset points can be set up to 255.
namelen:1-31stringArray preset point name: range 1 to 31 character.
addboolWhether the preset point has been set.

Sample:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "result":"success",
    "data":{
        "channel":"CH1",
        "preset_point":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
        "belt_times_use":0,
        "preset_point_obj":
        [
            {
                "no":1,
                "name":"point 1",
                "add":false
            },
            {
                "no":2,
                "name":"point 2",
                "add":false
            },
            {
                "no":3,
                "name":"point 3",
                "add":false
            },
            ...
            {
                "no":254,
                "name":"point 254",
                "add":false
            },
            {
                "no":255,
                "name":"point 255",
                "add":false
            }
        ],
        "watch_mode_time":20,
        "watch_mode_mode":"Mode_Default_Cruise",
        "watch_mode_num":0,
        "line_scan_area":false,
        "line_scan_speed":"low",
        "trace_interval":20,
        "trace_number":0,
        "trace_preset_point":[[],[],[],[]],
        "pattern_scan_number_isset":[true,false,false,false],
        "pattern_scan_number":0,
        "current_cruise_mode":"No_Cruise"
    }
}

Error Code

See Response Messages Body and Common error_code for more information.