axis2API

来源:互联网 发布:淘宝卖家违规记录 编辑:程序博客网 时间:2024/06/05 04:50
 

5.3.3 PTZ control

To control the Pan, Tilt and Zoom behavior of a PTZ unit, the following PTZ control URL is used. This URL has view access rights.

Important: 
Some PTZ units automatically reduce pan and tilt movements as the zoom factor increases. Therefore, the actual movement may be less than what is requested of these units.
The PTZ control is device-dependent. For information about supported parameters and actual parameter values, please check the specification of the Axis PTZ driver you intend to use. The following table is only an overview.

Note:
The URL must follow the standard way of writing a URL, (RFC 2396: Uniform Resource Identifiers (URI) Generic Syntax); that is, spaces and other reserved characters (";", "/", "?", ":", "@", "&", "=", "+", "," and "$") within a <parameter> or a <value> must be replaced with %<ASCII hex>. For example, in the string My camera, the space will have to be replaced with %20, My%20camera.

Method:GET/POST

Syntax:

http://<servername>/axis-cgi/com/ptz.cgi?<parameter>=<value>[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

camera=<int>

1, ...1

Applies only to video servers with more than one video input. Selects the source camera. If omitted, the default camera is used.

whoami=<string>

<any value>

Returns the name of the system-configured device driver.

center=<int>,<int>
extrem3=<int>,<int>

<x>,<y>

Absolute:Used to send the coordinates for the point in the image where the user clicked. This information is then used by the server to calculate the pan/tilt move required to (approximately) center the clicked point.


Relative:Used to send the coordinates for the point in the image where the user clicked. This information is then used by the server to calculate the direction and number of degrees to move. The number of degrees increases with the distance from the center of the image to the point clicked.


Digital:Used to send the coordinates for the point in the image where the user clicked. This information is then used by the server to center the clicked point.

areazoom=<int>,<int>,<int>

<x>,<y>,<z>

Absolute: Centers on positions x,y (like the center command) and zooms by a factor ofz/100. Ifz is more than 100 the image is zoomed in (for example; z=300 zooms in to 1/3 of the current field of view). Ifz is less than 100 the image is zoomed out (for example; z=50 zooms out to twice the current field of view).


Relative: n/a


Note 1: In some camera models, the precision of areazoom can be strongly improved by calibrating the lens offset parameters.
Note 2: The HTTP API for area zoom is currently only supported by Axis PTZ and Dome cameras. 

imagewidth=<int>

1, ...1

Required in conjunction withcenterand areazoom if the image width displayed is different from the default size of the image, which is product-specific.

imageheight=<int>

1, ...1

Needed in conjunction withcenterand areazoom if the image height is different from the default size, which is product-specific.

move=<string>

home,
up,
down,
left,
right,
upleft,
upright,
downleft,
downright

Absolute:Moves the device 5 degrees in the specified direction.


Relative: Moves the device approx. 50-90 degrees2 in the specified direction.


Digital:Moves the image 25% of the image field width in the specified direction.

Note: home is only valid if any home position has been previously set with "home=yes".

pan=<float>

-180.0 - 180.0

Absolute: Pans the device relative to the (0,0) position.


Relative: n/a


Digital: Pans the device relative to the (0,0) position.

tilt

-180.0 - 180.0

Absolute: Tilts the device relative to the (0,0) position.


Relative: n/a


Digital: Tilts the device relative to the (0,0) position.

zoom=<int>

1 - 9999

Absolute: Zooms the device n steps.


Relative: n/a


Digital: Zooms the device n steps.

focus=<int>

1 - 9999

Absolute: Move Focus n steps.


Relative: n/a


Digital: n/a

iris=<int>

1 - 9999

Absolute: Move iris n steps.


Relative: n/a


Digital: n/a

brightness=<int>1

1 - 9999

Absolute: Move brightness n steps.


Relative: n/a


Digital: n/a

rpan=<float>

-360.0 - 360.0

Absolute: Pans the device n degrees relative to the current position.


Relative: Pans the device approx. n degrees relative to the current position.


Digital: Pans the device n degrees relative to the current position.

rtilt=<float>

-360.0 - 360.0

Absolute: Tilts the device n degrees relative to the current position.


Relative: Tilts the device approx. n degrees relative to the current position.


Digital: Tilts the device n degrees relative to the current position.

rzoom=<int>

-9999 - 9999

Absolute:Zooms the devicen steps relative to the current position. Positive values mean zoom in, negative values mean zoom out.


Relative:Zooms the device approx.n steps relative to the current position. Positive values mean zoom in, negative values mean zoom out.


Digital: Zooms the device n steps relative to the current position. Positive values mean zoom in, negative values mean zoom out.

rfocus=<int>

-9999 - 9999

Absolute:Move Focusn steps relative to the current position. Positive values mean focus far, negative values mean focus near.


Relative:Move Focus approx.n steps relative to the current position. Positive values mean focus far, negative values mean focus near.


Digital: n/a

riris=<int>

-9999 - 9999

Absolute:Move irisn steps relative to the current position. Positive values mean open iris, negative values mean close iris.


Relative:Move iris approx.n steps relative to the current position. Positive values mean open iris, negative values mean close iris.


Digital: n/a

rbrightness=<int>1

-9999 - 9999

Absolute:Move brightnessn steps relative to the current position. Positive values mean brighter image, negative values mean darker image.


Relative:Move brightness approx.n steps relative to the current position. Positive values mean brighter image, negative values mean darker image.


Digital: n/a

autofocus=<string>

on, off

Autofocus On/Off.


Digital: n/a

autoiris=<string>

on, off

Autoiris On/Off.


Digital: n/a

continuouspantiltmove= <int>,<int>

-100 - 100,-100 - 100

Continuous pan/tilt motion.

Positive values mean right (pan) and up (tilt), negative values mean left (pan) and down (tilt). "0,0" means stop.

Values as <pan speed>,<tilt speed>

continuouszoommove=<int>

-100 - 100

Continuous zoom motion. Positive values mean zoom in and negative values mean zoom out. "0" means stop.

continuousfocusmove=<int>

-100 - 100

Continuous focus motion. Positive values mean focus near and negative values mean focus far. "0" means stop.


Digital: n/a

continuousirismove=<int>

-100 - 100

Continuous iris motion. Positive values mean iris open and negative values mean iris close. "0" means stop.


Digital: n/a

continuousbrightnessmove=<int>1

-100 - 100

Continuous brightness motion. Positive values mean brighter image and negative values mean darker image. "0" means stop.


Digital: n/a

auxiliary=<string>

<function name>

Activates/deactivates auxiliary functions of the device where <function name> is the name of the device-specific function.


Digital: n/a

setserverpresetname=<string>

<preset name>4

Associates the current position to <preset name> as a preset position in the server.

Note: This request is moved to ptzconfig.cgi

setserverpresetno=<int>

1, ...

Saves the current position as a preset position number in the server.

Note: This request is moved to ptzconfig.cgi

home=<string>

yes

Makes the current position the home position for the camera. Used withsetserverpresetnameor  setserverpresetno.

Note: This request is moved to ptzconfig.cgi

removeserverpresetname=<string>

<preset name>4

Removes the specified preset position associated with <preset name>.

Note: This request is moved to ptzconfig.cgi

removeserverpresetno=<int>

1, ...

Removes the specified preset position.

Note: This request is moved to ptzconfig.cgi

gotoserverpresetname=<string>

<preset name>4

Move to the position associated with the <preset name>.

gotoserverpresetno=<int>

1, ...

Move to the position associated with the specified preset position number.

setdevicepreset=<int>

<preset pos>

Bypasses the presetpos interface and tells the device to save its current position as preset position <preset pos> directly in the device, where <preset pos> is a device-specific preset position number.

Note: This request is moved to ptzconfig.cgi

gotodevicepreset=<int>

<preset pos>

Bypasses the presetpos interface and tells the device to go directly to the preset position number <preset pos> stored in the device, where the <preset pos> is a device-specific preset position number.


Digital: n/a

bartype=<string>

absolute, relative

Used together with barcoord and determines how the bar shall be interpreted. If "absolute", the endpoints of the bar correspond to the current limits. If "relative", the behavior is device-dependent. The default interpretation is "absolute" for panbar, tiltbar and zoombar and "relative" for focusbar and irisbar.


Digital: n/a (always "absolute").

barcoord=<int>,<int>

<x>,<y>

Used in conjunction with panbar, tiltbar, zoombar, focusbar or irisbar, to send coordinates to the server.

panbar=<int>,<string>

<length>,<alignment>

<length> is the length of the bar in pixels, which is needed in order to calculate the center of the bar.
 
<alignment> is one of the strings "horizontal" or "vertical".
 
The alignment string determines if the x (horizontal) or the y (vertical) coordinate frombarcoord is used, i.e. if the bar is horizontal; use "horizontal" and if the bar is vertical; use"vertical" as alignment.

tiltbar=<int>,<string>

<length>,<alignment>

<length> is the length of the bar in pixels, which is needed in order to calculate the center of the bar.
 
<alignment> is one of the strings "horizontal" or "vertical".
 
The alignment string determines if the x (horizontal) or the y (vertical) coordinate frombarcoord is used, i.e. if the bar is horizontal; use "horizontal" and if the bar is vertical; use"vertical" as alignment.

zoombar=<int>,<string>

<length>,<alignment>

<length> is the length of the bar in pixels, which is needed in order to calculate the center of the bar.
 
<alignment> is one of the strings "horizontal" or "vertical".
 
The alignment string determines if the x (horizontal) or the y (vertical) coordinate frombarcoord is used, i.e. if the bar is horizontal; use "horizontal" and if the bar is vertical; use"vertical" as alignment. 

focusbar=<int>,<string>

<length>,<alignment>

<length> is the length of the bar in pixels, which is needed in order to calculate the center of the bar.
 
<alignment> is one of the strings "horizontal" or "vertical".
 
The alignment string determines if the x (horizontal) or the y (vertical) coordinate frombarcoord is used, i.e. if the bar is horizontal; use "horizontal" and if the bar is vertical; use"vertical" as alignment.


Digital: n/a

irisbar=<int>,<string>

<length>,<alignment>

<length> is the length of the bar in pixels, which is needed in order to calculate the center of the bar.
 
<alignment> is one of the strings "horizontal" or "vertical".
 
The alignment string determines if the x (horizontal) or the y (vertical) coordinate frombarcoord is used, i.e. if the bar is horizontal; use "horizontal" and if the bar is vertical; use"vertical" as alignment. 


Digital: n/a

brightnessbar=<int>,<string>1

<length>,<alignment>

<length> is the length of the bar in pixels, which is needed in order to calculate the center of the bar.
 
<alignment> is one of the strings "horizontal" or "vertical".
 
The alignment string determines if the x (horizontal) or the y (vertical) coordinate frombarcoord is used, i.e. if the bar is horizontal; use "horizontal" and if the bar is vertical; use"vertical" as alignment. 


Digital: n/a

speed=<int>

1 - 100

Sets the head speed of the device that is connected to the specified camera.


Digital: n/a

imagerotation=<int>

0, 90, 180, 270

If PTZ command refers to an image stream that is rotated differently than the current image setup, then the image stream rotation must be added to each command with this parameter to allow the server to compensate.

query=<string>

speed,
position,
presetposcam,
presetposall

Returns the current parameter values. 

info=<int>

1

Returns a description of available PTZ commands.
 
No PTZ control is performed.

1 Product-dependent. Check the product's specification.
2 Actual values are device driver-specific.
3 Obsolete.
4 <preset name> is a string with a maximum of 31 characters, ~ is not allowed.

Example: Request information about which PTZ commands are available for camera 3.

http://myserver/axis-cgi/com/ptz.cgi?info=1&camera=3