PTZ-camera control

To control PTZ-camera you need to get an access to it.

Example of a request:

https://192.168.1.200:8080/ptz?command=open&channel=FByNlKIq&sid=fjMlBJ0I

Key elements of the request:

  • command=open - command to get an access to PTZ-camera control;
  • channel=[guid_channel] - guid PTZ-camera channel;
  • sid=[id_session] - id of a session in which a request is being processed (see example Get a session ID).

Example of a server response:

{
    "success" : "1",
}

You can control and set PTZ-camera usingthe following requests:

  • Zoom in/Zoom out:

    https://192.168.1.200:8080/ptz?command=zoom&speed=1&sid=fjMlBJ0I

    where

    • speed=[value] - zoom in/zoom out speed(from -10 to 10).

  • Focus:

    https://192.168.1.200:8080/ptz?command=focus&speed=1&sid=fjMlBJ0I

    where

    • speed=[value] - focus point from the farthest(-10) to the closest(10).

  • To turn on autofocus function:

    https://192.168.1.200:8080/ptz?command=autofocus&sid=fjMlBJ0I
  • Diaphragm setting:

    https://192.168.1.200:8080/ptz?command=iris&speed=1&sid=fjMlBJ0I

    where

    • speed=[value] - open diaphragm size (from -10 to 10).

  • To turn on diaphragm autotuning function:

    https://192.168.1.200:8080/ptz?command=autoiris&sid=fjMlBJ0I
  • PTZ-camera rotation:

    https://192.168.1.200:8080/ptz?command=turn&speed_x=1&speed_y=-1&sid=fjMlBJ0I

    where

    • speed_x=[value] - rotation speed around the vertical axis (from -10 to 10).
    • speed_y=[value] - rotation speed around the horizontal axis (from -10 to 10).

  • Rotation of PTZ-camera to given coordinates:

    https://192.168.1.200:8080/ptz?command=position_set&speed_x=1&pan=0.0&tilt=0.0&zoom=0.0&sid=fjMlBJ0I

    where

    • pan=[value] - camera rotation angle.
    • tilt=[value] - camera tilt angle.
    • zoom=[value] - approximation grade.

  • Stop rotation/approximation/deletion of PTZ-camera:

    https://192.168.1.200:8080/ptz?command=stop&sid=fjMlBJ0I
  • Rotation of PTZ-camera to a defined preset:

    https://192.168.1.200:8080/ptz?&command=preset_goto&preset=1&sid=fjMlBJ0I

    where

    • preset=[value] - preset number.

  • To save camera position as preset:

    https://192.168.1.200:8080/ptz?&command=preset_save&preset=1&sid=fjMlBJ0I

    where

    • preset=[value] - preset number.

  • To delete camera preset:

    https://192.168.1.200:8080/ptz?&command=preset_delete&preset=1&sid=fjMlBJ0I

    where

    • preset=[value] - preset number.

  • To run tracking function:

    https://192.168.1.200:8080/ptz?&command=preset_patrol_start&preset=1&sid=fjMlBJ0I

    where

    • preset=[value] - tracking number.

  • Control commands of OSD-menu in PTZ-camera:

    https://192.168.1.200:8080/ptz?&command=[command]&sid=fjMlBJ0I

    where

    • command=menu_on - enter OSD-menu;
    • command=menu_off - exit OSD-menu;
    • command=menu_up - arrow up;
    • command=menu_down - arrow down;
    • command=menu_down - arrow down;
    • command=menu_right - arrow right;
    • command=menu_zoom_in - Z+ button;
    • command=menu_zoom_out - Z- button;
    • command=menu_escape - ESC button;
    • command=menu_enter - ENTER button;

To finish PTZ-camera operation send the request:

https://192.168.1.200:8080/ptz?&command=[command]&sid=fjMlBJ0I