Video API legacy

From ElphelWiki
Jump to: navigation, search
This is a legacy page. The information bellow is not compatible with Elphel 393 or 353/363 series cameras.

in English | [[{{{de}}}|deutsch]] | [[{{{fr}}}|français]] | по-русски | автоперевод | 中文版 | 机械翻译

Video API is not implemented in the Model 353 camera (and in 333 it does not support the latest FPGA/driver features) - please use ccam.cgi--Andrey.filippov 00:07, 5 September 2007 (CDT)

Anyone who has even the slightest skill at writing HTML pages can use the Axis Video API. And with additional software installed, it is possible to create a powerful video observation system with the capabilities of recording video archives, journalizing, viewing of archives, etc. Note Change API legacy an how to enable the Video API.

Information about image dimensions

Some default parameters and some which are transferred when the image is obtained can change the image dimensions. For example parameters such as resolution, e_dcm_hor, e_dcm_vert, e_woi_width, e_woi_height, e_woi_left, e_woi_top. Sometimes a client application needs to know about the dimensions of the received image in advance (for example, for reserving a necessary area in a browser page or application window). You can obtain this information at the address:

It is possible to transfer with this script any of the parameters which are supported by image.cgi and video.cgi. For example:

The server response is:

image width  = 896
image height = 768

Static images

To retrieve an image from the camera it is enough to type the following path in the browser's address field: 

Note - this is the default camera IP-address. If you have changed the camera IP-address, please, type your variant.

It is also possible to ask the camera to send the image with a certain set of parameters. The path which can be used for this:

See the list of accessible parameters below.

resolution=<string> Specify the resolution of the returned image, for example 800x600. Product-dependent. You can check what values are supported by your camera using the address:

compression=<int> Adjusts the compression level of the image. Higher values correspond to higher compression, i.e. lower quality and smaller image size. It can take a value from 0 to 100. In many cases 30 is optimal.

colorlevel=<int> Sets level of color or grey-scale. It can have value from 0 to 100. 0 = grey-scale, 100 = full color.

color=<int> Enables/disables color. It can have value 0 or 1. 0 = black and white, 1 = color.

rotation=<int> Rotates the image clockwise. Product-dependent. You can check what values are supported by your camera at the address:

Apart from the standard parameters, enumerated above, there are some extensions, which make it possible to use the Elphel cameras more flexibly. You can read more detailed information about these extensions at Video API Extensions.

Example of obtaining an image with the assigned set of parameters:

If some parameters are not assigned, the default value is used. You can see the default values at the address:

You can change the default values. For this it is necessary to specify the parameter action=update. For example:

Video stream

The cameras can be used to receive a continuous video stream. This stream can be transferred by two protocols - HTTP and RTP.



The stream is a sequence of jpeg-files, separated by a special marking line. This transfer format is named Multipart Jpeg or MPJPG. For receiving a stream in this format you can use the following path:

As with static images, you can also assign parameters for the video stream. For this you can use the following path:

Apart from the parameters, enumerated above, such as resolution, compression, colorlevel, color, rotation, you can also assign:

duration=<int> Specifies for how many seconds the video will be generated and pushed to the client. 0 = unlimited.

nbrofframes=<int> Specifies how many frames the server will generate and push. 0 = unlimited.

fps=<int> Using fps it is possible to specify the frame rate from the server. 0 = unlimited.

By default all these parameters are assigned to 0. You can change the default settings, for example, in this way:

Apart from the standard parameters, enumerated above, there are extensions, which allow you to use the Elphel cameras more flexibly. More detailed information about these extensions can be found at Video API Extensions.

On the page Video API And Client Applications you can find some information about players, which can play the MPJPG video stream.



Video Parameters

Note that due to obscure reasons, parameters set via

will not take effect for RTP streams until the camera is restarted, although they will take effect immediately for videos streamed directly via HTTP.

You can access the list of parameters used for RTP streaming, by accessing the following URL:


Each jpeg-file is divided into many files with a size less than 1500 bytes which are transferred by RTP/UDP protocol through the network. In this case the data transmission is substantially accelerated, but the reliability of transfer falls, which can overload some networks and lead to the loss of a certain amount of video data.

On the page Video API And Client Applications you can find information about players, which can play the RTP/JPEG stream.


To obtain a video stream using RTP/Multicast it is sufficient to set the special variable:

The video stream will be generated with the default settings of variables for Multicast address, destination port and TTL. These variables can be changed by the following way:

Please note that while Network.RTP.R0.MulticastAlways is enabled, the HTTP MJPEG interface will become very slow. So you might want to disable it if not used by your application.


This video stream can be received, recorded or played back by MPlayer, QuickTime, vic (from the mush package). For this it is necessary to obtain the SDP-file from camera:

The saved file should be transferred to your preferred player. For example:

mplayer sdp://media.sdp

The original Axis Video API specification does not support RTSP in Multicast mode. In the Elphel cameras this possibility has been added as a protocol extension.



Obtaining information about system functioning

You can obtain information about the system at the address:

or more detailed information at the address:

Date and Time

Retrieving the Date and Time

To see the time which is stored inside the camera you can use the address:

Setting Date and Time

For setting the date and time you must use the following parameters:

action - set
year - 1970 - 2031 Current year.
month - 1 - 12 Current month.
day - 1 - 31 Current day.
hour - 0 - 23 Current hour.
minute - 0 - 59 Current minute.
second - 0 - 59 Current second.

For example:

User administration

The Video API allows:

  • registration and deleting of users
  • changing user passwords
  • adding users to special groups

Deleting a user

Creating a new user

Creating a new user is slightly different for Elphel and Axis cameras. All created users which will have the access to camera through Video API MUST belong to the axoper group. Also these users must belong to one or more secondary groups:

axview - access is permitted to scripts which are placed in directory /axis-cgi/view/
axoper - access is permitted to scripts which are placed in directory /axis-cgi/operator/
axadmin - access is permitted to scripts which are placed in directory /axis-cgi/admin/

At the same time it is necessary to pay special attention, because users who have Administrator rights must be entered into all three groups, users who have Operator rights must be entered into the axoper and axview groups, users who have Unprivileged user rights must be entered into the axview group only. Creating of three users with different rights, for example:

  • Administrator:
  • Operator:
  • Unprivileged user:

Password changing

Changing the access rights for secondary group

Rebooting the camera

For camera rebooting, you should use the following address:

Exposure control

The Elphel cameras support exposure control with the standard and advanced interface. You can read about Advanced Settings on the page Video_API_Extensions


To enable autoexposure you can use the following command:

Autoexposure parameters

It is possible to assign the area for autoexposure calculation. You can do this using the following command:

The ExposureWindow can have the values full, center, lower, upper, right and left.

Also it possible set a maximum exposure time (number of micro seconds) :

Manual control of exposure

To enable manual control of exposure you can use the following command:

Also you can set the time an image is exposed (0.1 msec step):

For example Shutter=50 means 5000 microseconds or 5 miliseconds.


If your attempts to access images fail with 500 Server Error, you may have to explicitely enable the Video API.