Difference between revisions of "Video API legacy"

From ElphelWiki
Jump to: navigation, search
 
(20 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
{{Manual legacy_pages}}
 +
 
{{en|ru=First_Acquaintance_With_Video_API.Ru|cn=Video_API_Extensions.cn}}
 
{{en|ru=First_Acquaintance_With_Video_API.Ru|cn=Video_API_Extensions.cn}}
  
The elementary system of using the Axis Video API, any who has even the slightest skills of writing HTML of pages can create. And with installed a set of the additional software, it is possible to create powerful enough system of video observation with an opportunity of record of videoarchives, journalizing, viewing of archives, etc.
+
''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]]''--[[User:Andrey.filippov|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 ==
 
== Information about image dimensions ==
Some parameters by default or transferred at the images obtaining is changing the image dimensions. It's such parameters as '''resolution, e_dcm_hor, e_dcm_vert, e_woi_width, e_woi_height, e_woi_left, e_woi_top'''. Sometimes for client application is necessary to know about dimensions of obtained 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:
+
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:
 
  <nowiki>http://192.168.0.9/var/axis-cgi/view/imagesize.cgi?</nowiki>
 
  <nowiki>http://192.168.0.9/var/axis-cgi/view/imagesize.cgi?</nowiki>
Is possible the transfer to this script of any parameters, which support the image.cgi and video.cgi. For example:
+
It is possible to transfer with this script any of the parameters which are supported by image.cgi and video.cgi. For example:
 
  <nowiki>http://192.168.0.9/var/axis-cgi/view/imagesize.cgi?e_dcm_vert=2&e_dcm_hor=2&e_woi_width=1800</nowiki>
 
  <nowiki>http://192.168.0.9/var/axis-cgi/view/imagesize.cgi?e_dcm_vert=2&e_dcm_hor=2&e_woi_width=1800</nowiki>
 
The server response is:
 
The server response is:
Line 14: Line 18:
  
 
== Static images ==
 
== Static images ==
For obtaining image from camera is enough to type the following path in the browser's address field:
+
To retrieve an image from the camera it is enough to type the following path in the browser's address field:
  
 
  <nowiki>http://192.168.0.9/jpg/image.jpg </nowiki>
 
  <nowiki>http://192.168.0.9/jpg/image.jpg </nowiki>
  
'''Note''' 192.168.0.9 - it's the camera IP-address by default. If you have changed the camera IP-address, please, type your variant.
+
'''Note''' 192.168.0.9 - this is the default camera IP-address. If you have changed the camera IP-address, please, type your variant.
  
It's possible also to inquire from camera the image with a certain set of parameters. The path is used for this:
+
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:
  
 
  <nowiki>http://192.168.0.9/axis-cgi/jpg/image.cgi?param1=xxx&param2=yyy&.....</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/jpg/image.cgi?param1=xxx&param2=yyy&.....</nowiki>
Line 26: Line 30:
 
See the list of accessible parameters below.
 
See the list of accessible parameters below.
 
   
 
   
'''resolution'''=<string>    Specify the resolution of the returned image, for example 800x600.  Product-dependent.  Checking the values which supported by your camera is possible at the address:  ''<nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=list&group=Properties.Image.Resolution</nowiki>''
+
'''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:  ''<nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=list&group=Properties.Image.Resolution</nowiki>''
 
   
 
   
'''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 have value from 0 to 100. In many cases the 30 is optimally.
+
'''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.
 
'''colorlevel'''=<int>    Sets level of color or grey-scale. It can have value from 0 to 100.  0 = grey-scale, 100 = full color.
Line 34: Line 38:
 
'''color'''=<int>    Enables/disables color.  It can have value 0 or 1.  0 = black and white, 1 = 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.  Checking the values which supported by your camera is possible at the address:  ''<nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=list&group=Properties.Image.Rotation</nowiki>''
+
'''rotation'''=<int>    Rotates the image clockwise.  Product-dependent.  You can check what values are supported by your camera at the address:  ''<nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=list&group=Properties.Image.Rotation</nowiki>''
 
   
 
   
Except the standard parameters, enumerated above, there are the extensions, which make it possible to more flexibly use cameras Elphel. More detailed information about these extensions you can read [[Video API Extensions]].
+
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 image with the assigned set of the parameters:
+
Example of obtaining an image with the assigned set of parameters:
  
 
  <nowiki>http://192.168.0.9/axis-cgi/jpg/image.cgi?resolution=1024x768&colorlrvel=45&compression=30</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/jpg/image.cgi?resolution=1024x768&colorlrvel=45&compression=30</nowiki>
Line 54: Line 58:
 
==Video stream==
 
==Video stream==
  
Cameras allow to obtain the continuous video stream. This stream can be transferred by two protocols - HTTP and RTP.
+
The cameras can be used to receive a continuous video stream. This stream can be transferred by two protocols - HTTP and RTP.
 
    
 
    
 
===HTTP===
 
===HTTP===
 
====Jpeg====
 
====Jpeg====
The stream is sequence of jpeg-files, separated by special marking line. This transfer format is named Multipart Jpeg or MPJPG. For stream obtaining in this format you can use the next path:
+
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:
 
  <nowiki>http://192.168.0.9/mjpg/video.mjpg</nowiki>
 
  <nowiki>http://192.168.0.9/mjpg/video.mjpg</nowiki>
As for the static images, you can assign any parameters for video stream too. For it you can use the next path:
+
As with static images, you can also assign parameters for the video stream. For this you can use the following path:
 
  <nowiki>http://192.168.0.9/axis-cgi/mjpg/video.cgi?param1=xxx&param2=yyy&.....</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/mjpg/video.cgi?param1=xxx&param2=yyy&.....</nowiki>
Except the parameters, enumerated above, such as '''resolution, compression, colorlevel, color, rotation''', you can assign also:
+
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.
 
'''duration=<int>'''    Specifies for how many seconds the video will be generated and pushed to the client. 0 = unlimited.
Line 70: Line 74:
 
'''fps=<int>'''    Using fps it is possible to specify the frame rate from the server. 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, by this way:
+
By default all these parameters are assigned to 0. You can change the default settings, for example, in this way:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&Image.I0.Stream.Duration=100&Image.I0.Stream.FPS=5&Image.I0.Stream.NbrOfFrames=1000</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&Image.I0.Stream.Duration=100&Image.I0.Stream.FPS=5&Image.I0.Stream.NbrOfFrames=1000</nowiki>
  
Except the standard parameters, enumerated above, there is extensions, which allow to use the Elphel cameras more flexibly. More detailed information about these extensions you can read at [[Video API Extensions]].
+
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 page [[Video API And Client Applications]] you can find the information about players, which can play the MPJPG video stream.
+
On the page [[Video API And Client Applications]] you can find some information about players, which can play the MPJPG video stream.
  
 
====Theora====
 
====Theora====
Line 81: Line 85:
 
      
 
      
 
===RTP===
 
===RTP===
 +
====Video Parameters====
 +
Note that due to obscure reasons, parameters set via
 +
 +
<pre>
 +
http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&root.ImageSource.I0.Sensor...=...
 +
</pre>
 +
 +
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:
 +
 +
<pre>
 +
http://192.168.0.9/axis-cgi/admin/param.cgi?action=list&group=ImageSource.I0.E_CurrentState
 +
</pre>
 +
 
====Jpeg====
 
====Jpeg====
Каждый jpeg-файл разделяется на множество пакетов размером меньше 1500 байт и передается по сети по протоколу RTP/UDP. Передача данных в этом случае существенно ускоряется, но при этом падает надежность передачи, что может приводить в перегруженных сетях к потере некоторого количества видеоинформации.
+
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.
  
На странице [[Video API And Client Applications.Ru]] можно найти информацию о программах, которые умеют принимать видеопоток формата RTP/JPEG.
+
On the page [[Video API And Client Applications]] you can find information about players, which can play the RTP/JPEG stream.
  
 
=====Multicast=====
 
=====Multicast=====
Чтобы получить видепоток по RTP/Multicast достаточно установить специальную переменную :
+
To obtain a video stream using RTP/Multicast it is sufficient to set the special variable:
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&Network.RTP.R0.AlwaysMulticast=yes</nowiki>
+
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&Network.RTP.R0.MulticastAlways=yes</nowiki>
При этом будет сгенерирован видеопоток со значениями по-умолчанию для multicast IP адреса, порта назначения и TTL. Эти значения можно изменить следующим образом :
+
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:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&Network.RTP.R0.VideoAddress=224.21.23.44&Network.RTP.R0.VideoPort=22222&Network.RTP.R0.TTL=90</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&Network.RTP.R0.VideoAddress=224.21.23.44&Network.RTP.R0.VideoPort=22222&Network.RTP.R0.TTL=90</nowiki>
 +
 +
Please note that while <tt>Network.RTP.R0.MulticastAlways</tt> is enabled, the HTTP MJPEG interface will become very slow. So you might want to disable it if not used by your application.
 
======SDP======
 
======SDP======
Такой видеопоток может быть принят, записан или воспроизведен при помощи mplayer, QuickTime, vic (из пакета mush). Для этого нужно с камеры получить SDP-файл :
+
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:
 
  <nowiki>http://192.168.0.9/mjpg/media.sdp</nowiki>
 
  <nowiki>http://192.168.0.9/mjpg/media.sdp</nowiki>
Сохраненный файл нужно передать на вход выбранной программы. Например:
+
The saved file should be transferred to your preferred player. For example:
 
  <nowiki>mplayer sdp://media.sdp</nowiki>
 
  <nowiki>mplayer sdp://media.sdp</nowiki>
  
 
======RTSP======
 
======RTSP======
Оригинальная спецификация Axis Video API не поддерживает RTSP в режиме multicast. В камерах Elphel эта возможность реализована как расширение протокола.
+
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.
  
 
=====Unicast=====
 
=====Unicast=====
Line 106: Line 127:
  
  
== Получение информации о функционировании системы ==
+
== Obtaining information about system functioning ==
Получить системную информацию можно по адресу :
+
You can obtain information about the system at the address:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/systemlog.cgi</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/systemlog.cgi</nowiki>
или, более подробную, по адресу
+
or more detailed information at the address:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/serverreport.cgi</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/serverreport.cgi</nowiki>
  
== Время и дата ==
+
== Date and Time ==
=== Получить дату и время ===
+
=== Retrieving the Date and Time ===
Узнать время, установленное в камере, можно по адресу :
+
To see the time which is stored inside the camera you can use the address:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/date.cgi?action=get</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/date.cgi?action=get</nowiki>
=== Установить дату и время ===
+
=== Setting Date and Time ===
Чтобы установить дату и время нужно использовать следующие параметры 
+
For setting the date and time you must use the following parameters:
  
 
{|
 
{|
Line 137: Line 158:
 
|}
 
|}
  
Например :
+
For example:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/date.cgi?action=set&year=2006&month=4&day=15&hour=14&minute=20&second=40</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/date.cgi?action=set&year=2006&month=4&day=15&hour=14&minute=20&second=40</nowiki>
  
  
  
== Управление пользователями ==
+
== User administration ==
Video API позволяет :
+
The Video API allows:
*регистрировать и удалять пользователей
+
*registration and deleting of users
*изменять пароли пользователей
+
*changing user passwords
*вводить пользователей в нужные группы
+
*adding users to special groups
=== Удаление существущего пользователя ===
+
=== Deleting a user ===
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=remove&user=joe</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=remove&user=joe</nowiki>
=== Создание нового пользователя ===
+
=== Creating a new user ===
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=joe&pwd=PASSWD&grp=axuser&sgrp=axview&comment=JOE</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=joe&pwd=PASSWD&grp=axuser&sgrp=axview&comment=JOE</nowiki>
Есть особенности в создании новых пользователей для камер Elphel и Axis. Так, все создаваемые пользователи, которые будут иметь доступ к камере через Video API ДОЛЖНЫ принадлежать к группе '''axoper'''. Кроме того, такие пользователи должны принадлежать к одной или нескольким из вторичных групп :
+
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''' ||-|| разрешен доступ к скриптам в каталоге /axis-cgi/view/
+
|'''axview''' ||-|| access is permitted to scripts which are placed in directory /axis-cgi/view/
 
|-
 
|-
|'''axoper''' ||-|| разрешен доступ к скриптам в каталоге /axis-cgi/operator/
+
|'''axoper''' ||-|| access is permitted to scripts which are placed in directory /axis-cgi/operator/
 
|-
 
|-
|'''axadmin''' ||-|| разрешен доступ к скриптам в каталоге /axis-cgi/admin/
+
|'''axadmin''' ||-|| access is permitted to scripts which are placed in directory /axis-cgi/admin/
 
|-
 
|-
 
|}
 
|}
При этом необходимо обратить особое внимание, что пользователи c полномочиями оператора должны входить во все три группы, с полномосиями оператора - в группы axoper и axview, и с полномочиями непривелигированного пользователя - только в группу axview.
+
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:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=administrator&pwd=foo&grp=axuser&sgrp=axadmin:axoper:axview&comment=Administrator</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=administrator&pwd=foo&grp=axuser&sgrp=axadmin:axoper:axview&comment=Administrator</nowiki>
*Оператор :
+
*Operator:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=operator&pwd=foo&grp=axuser&sgrp=axoper:axview&comment=Operator</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=operator&pwd=foo&grp=axuser&sgrp=axoper:axview&comment=Operator</nowiki>
  
*Непривилегированный пользователь :
+
*Unprivileged user:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=administrator&pwd=foo&grp=axuser&sgrp=axview&comment=Viewer</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=administrator&pwd=foo&grp=axuser&sgrp=axview&comment=Viewer</nowiki>
  
=== Изменение пароля ===
+
=== Password changing ===
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=update&user=joe&pwd=pass</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=update&user=joe&pwd=pass</nowiki>
  
=== Изменение принадлежности к вторичной группе ===
+
=== Changing the access rights for secondary group ===
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=update&user=joe&sgrp=axview:axoper</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=update&user=joe&sgrp=axview:axoper</nowiki>
  
  
  
== Перезагрузка камеры ==
+
== Rebooting the camera ==
Чтобы дать команду на перезагрузку камеры, используйте следующий адрес :
+
For camera rebooting, you should use the following address:
 
  <nowiki>http://192.168.0.9/var/axis-cgi/admin/restart.cgi</nowiki>
 
  <nowiki>http://192.168.0.9/var/axis-cgi/admin/restart.cgi</nowiki>
  
  
  
== Управление экспозицией ==
+
== Exposure control ==
Камеры Elphel поддерживают как стандартный так и расширенный интерфейс управления экспозицией. О расширенных настройках см. [[Video_API_Extensions.Ru]]
+
The Elphel cameras support exposure control with the standard and advanced interface. You can read about Advanced Settings on the page [[Video_API_Extensions]]
  
=== Автоэкспозиция ===
+
=== Autoexposure ===
Чтобы включить автоэкспозицию необходимо дать следующую команду :
+
To enable autoexposure you can use the following command:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&ImageSource.I0.Sensor.Exposure=auto</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&ImageSource.I0.Sensor.Exposure=auto</nowiki>
  
==== Параметры автоэкспозиции ====
+
==== Autoexposure parameters ====
Можно задавать область по которой будет вычисляться автоэкспозиция. Это можно делать командой :
+
It is possible to assign the area for autoexposure calculation. You can do this using the following command:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&ImageSource.I0.Sensor.ExposureWindow=full</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&ImageSource.I0.Sensor.ExposureWindow=full</nowiki>
ExposureWindow может принимать значения '''full''', '''center''', '''lower''', '''upper''', '''right''' и '''left'''.
+
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) :
 +
<nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&root.ImageSource.I0.Sensor.MaxExposureTime=150000</nowiki>
  
=== Ручное управление экспозицией ===
+
=== Manual control of exposure ===
Включить ручное управление экспозицией :
+
To enable manual control of exposure you can use the following command:
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&ImageSource.I0.Sensor.Exposure=manual</nowiki>
 
  <nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&ImageSource.I0.Sensor.Exposure=manual</nowiki>
 +
 +
Also you can set the time an image is exposed (0.1 msec step):
 +
<nowiki>http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&root.ImageSource.I0.Sensor.Shutter=50</nowiki>
 +
 +
'''For example''' Shutter=50 means 5000 microseconds or 5 miliseconds.
 +
 +
== Troubleshooting ==
 +
If your attempts to access images fail with <tt>500 Server Error</tt>, you may have to explicitely [[Change API|enable the Video API]].

Latest revision as of 15:42, 24 August 2008

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:

http://192.168.0.9/var/axis-cgi/view/imagesize.cgi?

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

http://192.168.0.9/var/axis-cgi/view/imagesize.cgi?e_dcm_vert=2&e_dcm_hor=2&e_woi_width=1800

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:

http://192.168.0.9/jpg/image.jpg 

Note 192.168.0.9 - 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:

http://192.168.0.9/axis-cgi/jpg/image.cgi?param1=xxx&param2=yyy&.....

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: http://192.168.0.9/axis-cgi/admin/param.cgi?action=list&group=Properties.Image.Resolution

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: http://192.168.0.9/axis-cgi/admin/param.cgi?action=list&group=Properties.Image.Rotation

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:

http://192.168.0.9/axis-cgi/jpg/image.cgi?resolution=1024x768&colorlrvel=45&compression=30
 

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

http://192.168.0.9/axis-cgi/admin/param.cgi?action=list&group=Image.I0.Appearance
  

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

http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&Image.I0.Appearance.Resolution=512x384&Image.I0.Appearance.Rotation=180&ColorEnabled=no&Image.I0.Appearance.Compression=50
http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&ImageSource.I0.Sensor.ColorLevel=60
  

Video stream

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

HTTP

Jpeg

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:

http://192.168.0.9/mjpg/video.mjpg

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

http://192.168.0.9/axis-cgi/mjpg/video.cgi?param1=xxx&param2=yyy&.....

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:

http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&Image.I0.Stream.Duration=100&Image.I0.Stream.FPS=5&Image.I0.Stream.NbrOfFrames=1000

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.

Theora

RTP

Video Parameters

Note that due to obscure reasons, parameters set via

http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&root.ImageSource.I0.Sensor...=...

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:

http://192.168.0.9/axis-cgi/admin/param.cgi?action=list&group=ImageSource.I0.E_CurrentState

Jpeg

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.

Multicast

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

http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&Network.RTP.R0.MulticastAlways=yes

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:

http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&Network.RTP.R0.VideoAddress=224.21.23.44&Network.RTP.R0.VideoPort=22222&Network.RTP.R0.TTL=90

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.

SDP

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:

http://192.168.0.9/mjpg/media.sdp

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

mplayer sdp://media.sdp
RTSP

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.

Unicast
RTSP

Theora

Obtaining information about system functioning

You can obtain information about the system at the address:

http://192.168.0.9/axis-cgi/admin/systemlog.cgi

or more detailed information at the address:

http://192.168.0.9/axis-cgi/admin/serverreport.cgi

Date and Time

Retrieving the Date and Time

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

http://192.168.0.9/axis-cgi/admin/date.cgi?action=get

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:

http://192.168.0.9/axis-cgi/admin/date.cgi?action=set&year=2006&month=4&day=15&hour=14&minute=20&second=40


User administration

The Video API allows:

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

Deleting a user

http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=remove&user=joe

Creating a new user

http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=joe&pwd=PASSWD&grp=axuser&sgrp=axview&comment=JOE

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:
http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=administrator&pwd=foo&grp=axuser&sgrp=axadmin:axoper:axview&comment=Administrator
  • Operator:
http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=operator&pwd=foo&grp=axuser&sgrp=axoper:axview&comment=Operator
  • Unprivileged user:
http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=administrator&pwd=foo&grp=axuser&sgrp=axview&comment=Viewer

Password changing

http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=update&user=joe&pwd=pass

Changing the access rights for secondary group

http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=update&user=joe&sgrp=axview:axoper


Rebooting the camera

For camera rebooting, you should use the following address:

http://192.168.0.9/var/axis-cgi/admin/restart.cgi


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

Autoexposure

To enable autoexposure you can use the following command:

http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&ImageSource.I0.Sensor.Exposure=auto

Autoexposure parameters

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

http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&ImageSource.I0.Sensor.ExposureWindow=full

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) :

http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&root.ImageSource.I0.Sensor.MaxExposureTime=150000

Manual control of exposure

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

http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&ImageSource.I0.Sensor.Exposure=manual

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

http://192.168.0.9/axis-cgi/admin/param.cgi?action=update&root.ImageSource.I0.Sensor.Shutter=50

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

Troubleshooting

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