Video API legacy

From ElphelWiki
Revision as of 07:46, 23 December 2005 by Ilya (talk | contribs) (First Acquaintance With Video API moved to Video API)
Jump to: navigation, search

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


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.

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:

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

Is possible the transfer to this script of any parameters, which support the 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

For obtaining image from camera 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 - it's the camera IP-address by default. 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:

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. Checking the values which supported by your camera is possible at 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 have value from 0 to 100. In many cases the 30 is optimally.

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. Checking the values which supported by your camera is possible at the address: http://192.168.0.9/axis-cgi/admin/param.cgi?action=list&group=Properties.Image.Rotation

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.

Example of obtaining image with the assigned set of the 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

Cameras allow to obtain the continuous video stream. This stream can be transferred by two protocols - HTTP and RTP.

HTTP

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:

http://192.168.0.9/mjpg/video.mjpg

As for the static images, you can assign any parameters for video stream too. For it you can use the next path:

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

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

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, by 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

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.

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

Theora

RTP

Jpeg

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

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

Multicast

Чтобы получить видепоток по RTP/Multicast достаточно установить специальную переменную :

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

При этом будет сгенерирован видеопоток со значениями по-умолчанию для multicast IP адреса, порта назначения и TTL. Эти значения можно изменить следующим образом :

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
SDP

Такой видеопоток может быть принят, записан или воспроизведен при помощи mplayer, QuickTime, vic (из пакета mush). Для этого нужно с камеры получить SDP-файл :

http://192.168.0.9/mjpg/media.sdp

Сохраненный файл нужно передать на вход выбранной программы. Например:

mplayer sdp://media.sdp
RTSP

Оригинальная спецификация Axis Video API не поддерживает RTSP в режиме multicast. В камерах Elphel эта возможность реализована как расширение протокола.

Unicast
RTSP

Theora

Получение информации о функционировании системы

Получить системную информацию можно по адресу :

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

или, более подробную, по адресу

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

Время и дата

Получить дату и время

Узнать время, установленное в камере, можно по адресу :

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

Установить дату и время

Чтобы установить дату и время нужно использовать следующие параметры

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.

Например :

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


Управление пользователями

Video API позволяет :

  • регистрировать и удалять пользователей
  • изменять пароли пользователей
  • вводить пользователей в нужные группы

Удаление существущего пользователя

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

Создание нового пользователя

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

Есть особенности в создании новых пользователей для камер Elphel и Axis. Так, все создаваемые пользователи, которые будут иметь доступ к камере через Video API ДОЛЖНЫ принадлежать к группе axoper. Кроме того, такие пользователи должны принадлежать к одной или нескольким из вторичных групп :

axview - разрешен доступ к скриптам в каталоге /axis-cgi/view/
axoper - разрешен доступ к скриптам в каталоге /axis-cgi/operator/
axadmin - разрешен доступ к скриптам в каталоге /axis-cgi/admin/

При этом необходимо обратить особое внимание, что пользователи c полномочиями оператора должны входить во все три группы, с полномосиями оператора - в группы axoper и axview, и с полномочиями непривелигированного пользователя - только в группу axview. Пример создания трех пользователей с различными привелегиями :

  • Администратор :
http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=administrator&pwd=foo&grp=axuser&sgrp=axadmin:axoper:axview&comment=Administrator
  • Оператор :
http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=operator&pwd=foo&grp=axuser&sgrp=axoper:axview&comment=Operator
  • Непривилегированный пользователь :
http://192.168.0.9/axis-cgi/admin/pwdgrp.cgi?action=add&user=administrator&pwd=foo&grp=axuser&sgrp=axview&comment=Viewer

Изменение пароля

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

Изменение принадлежности к вторичной группе

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


Перезагрузка камеры

Чтобы дать команду на перезагрузку камеры, используйте следующий адрес :

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


Управление экспозицией

Камеры Elphel поддерживают как стандартный так и расширенный интерфейс управления экспозицией. О расширенных настройках см. Video_API_Extensions.Ru

Автоэкспозиция

Чтобы включить автоэкспозицию необходимо дать следующую команду :

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

Параметры автоэкспозиции

Можно задавать область по которой будет вычисляться автоэкспозиция. Это можно делать командой :

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

ExposureWindow может принимать значения full, center, lower, upper, right и left.


Ручное управление экспозицией

Включить ручное управление экспозицией :

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