+ All Categories
Home > Documents > OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are...

OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are...

Date post: 07-Jul-2020
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
34
OpenVideo - Capture Standard
Transcript
Page 1: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

OpenVideo - Capture Standard

Page 2: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 2 of 34

Table of Contents 1. Introduction ....................................................................................................................... 4

1.1. Overview ......................................................................................................................................4 1.2. Purpose .........................................................................................................................................4 1.3. Schema .........................................................................................................................................4 1.4. Diagram notation ..........................................................................................................................4 1.5. List of files installed with the OpenVideo - Capture Standard SDK ............................................4 1.6. Design ...........................................................................................................................................5

1.6.1. Parameters ...........................................................................................................................5 1.6.2. Commands ..........................................................................................................................5 1.6.3. getvideo Command .............................................................................................................5 1.6.4. Rules ...................................................................................................................................5

1.7. Example ........................................................................................................................................6

2. Schema definition ............................................................................................................. 7 2.1. Schema location ............................................................................................................................7 2.2. CameraCapsGroup .......................................................................................................................7 2.3. CameraCapsGroup/CameraCaps ..................................................................................................8 2.4. CameraCapsGroup/CameraCaps/CmdParamGroup .....................................................................8 2.5. CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam ..................................................8

2.5.1. id attribute ...........................................................................................................................9 2.5.2. setcmd and getcmd attributes ........................................................................................... 11 2.5.3. type attribute ..................................................................................................................... 11 2.5.4. Ranges and enumerations .................................................................................................. 12 2.5.5. default attribute ................................................................................................................. 12 2.5.6. Example for CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam .................. 12

2.6. CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam/CmdParamEnumGroup ......... 12 2.7. CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam/CmdParamEnumGroup/ CmdParamEnum .................................................................................................................................... 12

2.7.1. cmd attribute ..................................................................................................................... 13 2.7.2. standard attribute ............................................................................................................... 13 2.7.3. Examples of enumerated parameters................................................................................. 13

2.8. CameraCapsGroup/CameraCaps/CommandGroup .................................................................... 14 2.9. CameraCapsGroup/CameraCaps/CommandGroup/Command ................................................... 14

2.9.1. id attribute ......................................................................................................................... 15 2.9.2. protocol attribute ............................................................................................................... 15 2.9.3. mode attribute ................................................................................................................... 15 2.9.4. body attribute .................................................................................................................... 15 2.9.5. prefix and postfix attributes .............................................................................................. 15 2.9.6. repeatRequest, delay and controlRate attributes ............................................................. 16

2.10. CameraCapsGroup/CameraCaps/CommandGroup/Command/ParamGroup......................... 16 2.11. CameraCapsGroup/CameraCaps/CommandGroup/Command/ParamGroup/Param ............. 16

2.11.1. type attribute ................................................................................................................. 17 2.11.2. paramid attribute .......................................................................................................... 17 2.11.3. prefix and postfix attributes ......................................................................................... 17 2.11.4. format attribute ............................................................................................................. 17 2.11.5. body attribute ............................................................................................................... 17

2.12. CameraCapsGroup/CameraCaps/CommandGroup/Command/ReconnectGroup .................. 17 2.13. CameraCapsGroup/CameraCaps/CommandGroup/Command/ReconnectGroup/Reconnect 18

3. Parameters ....................................................................................................................... 18 3.1. Version ....................................................................................................................................... 18 3.2. InputNum .................................................................................................................................... 18

Page 3: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 3 of 34

3.3. FrameRate .................................................................................................................................. 18 3.4. Resolution and Standard ............................................................................................................. 18 3.5. Quality ........................................................................................................................................ 19 3.6. Brightness, Contrast, Hue, Saturation, Sharpness, Gamma, WhiteBalance, BacklightComp, and Exposure .......................................................................................................................................... 19

4. PTZ Parameters ............................................................................................................... 19 4.1. PanSpeed and TiltSpeed ............................................................................................................. 20 4.2. MoveStop, ZoomStop, FocusStop and IrisStop .......................................................................... 20 4.3. AutoFocus and AutoIris.............................................................................................................. 20 4.4. FocusNear and FocusFar ............................................................................................................ 21 4.5. IrisOpen and IrisClose ................................................................................................................ 21 4.6. ZoomIn and ZoomOut ................................................................................................................ 21 4.7. Preset .......................................................................................................................................... 21

5. OpenVideo - Capture Standard Simulator .................................................................... 21 5.1. Files used from the simulator ..................................................................................................... 22 5.2. Changing the camera configuration ............................................................................................ 22 5.3. Querying the camera configuration ............................................................................................ 23 5.4. Retrieving video stream from the camera ................................................................................... 23

6. Final Testing .................................................................................................................... 24 6.1. Overview .................................................................................................................................... 24 6.2. Video capturing .......................................................................................................................... 24 6.3. Changing parameters on the fly .................................................................................................. 25 6.4. Changing parameters that require reconnection ......................................................................... 25 6.5. Querying current parameter values ............................................................................................. 25 6.6. PTZ ............................................................................................................................................. 25

Appendix A: RTP/RTSP Capture Standard Integration ........................................................... 26

Index ............................................................................................................................................... 30

Page 4: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 4 of 34

1. Introduction

1.1. Overview OpenVideo - Capture Standard was developed so that additional IP cameras can be incorporated into the OnGuard product more easily. The basic concept is that most IP cameras have embedded web-services with similar interfaces. The approach of capturing video from IP cameras and configuring it is essentially the same. The only difference between IP cameras is the syntax of the commands and the camera capabilities. In order to integrate an IP camera only the syntax and capabilities must be described. This syntax description must follow certain rules as described in this document.

1.2. Purpose This document describes the process for integrating an IP camera into the OnGuard video product. An IP camera can be integrated with the Lenel Network Video Recorder (LNVR) by creating an XML document describing the camera capabilities, parameters and rules for generating requests to the camera, and parsing camera responses. Once the XML file has been installed to the folder where the schema is located, the camera can be used with OnGuard. No development or special tools are required for the integration. The XML file can be created in any text editor such as Notepad. An editor specifically designed to edit and verify XML files, such as Altova XMLSPY, would simplify the work.

1.3. Schema The camera capabilities and syntax of camera commands must be described in an XML file that conforms to the schema. The XML schema is installed during LNVR installation by default to C:\Documents and Settings\All Users\Application Data\Lenel\LNVSuite\Caps\Camera\CameraCaps.xsd. This is an XML schema which defines the format of the XML files for integrating the cameras with the LNVR. During the SDK installation, the schema file will get installed under the '\OpenVideo – CaptureStandard\Demo' subfolder. All files with the .xml extension that are located in the folder mentioned above will be considered by the LNVR as descriptions of cameras. Each file can contain descriptions of any number of cameras.

1.4. Diagram notation Diagrams used in the document are generated by Altova XMLSPY (www.altova.com) and should be familiar to XMLSPY users. For readers not familiar with XMLSPY, here is brief description: XML elements in a diagram look like rectangles. A solid frame is used for required elements; a dotted frame is used for optional elements. Cardinality is displayed under the element. For example, the element CameraCapsGroup the diagram says that CameraCapsGroup is a required element that can contain any number (from 0 to infinity) of CameraCaps elements. The CameraCaps element is optional.

1.5. List of files installed with the OpenVideo - Capture Standard SDK The installation will create a subfolder \OpenCapture\ with the following files:

• This documentation: OpenVideo-CaptureStandard.pdf. • The schema: CameraCaps.xsd • Capture Simulator: CamCapsTest.exe • An example XML file: Axis213.xml

Page 5: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 5 of 34

1.6. Design The XML document describing a camera contains the following three pieces:

1. Camera capabilities as a list of parameters containing each supported parameter, its type, ranges and enumeration of values

2. A list of commands that an LNVR would send to the camera to set/query the parameters

3. Rules binding the parameters and commands

1.6.1. Parameters

Some examples of parameters are: Resolution, Framerate, Brightness, Contrast, etc. Currently the list of parameters is limited to those listed in section 2.5. In future versions it will be possible to allow parameters that are not covered by that list, thus allowing proprietary camera parameters.

1.6.2. Commands

A command is sent to the camera which either provides some response that is parsed and used by the LNVR or executes an action on the camera. An example of a command is “getvideo” (typically used to retrieve video from a video source – camera). Some commands are reserved, including the generic commands getvideo and handshake, as well as the following PTZ commands: AutoFocus, IrisStop, ZoomStop, FocusStop, and MoveStop. Other commands may have arbitrary names. These names will be determined by cross references from parameter’s getcmd and setcmd attributes.

1.6.3. getvideo Command

This command is used to request a video stream from the camera. The response from the camera must be one of the following (in the order of preference):

1. Stream of MJPEG images. In this case, a camera would keep sending an HTTP stream containing MJPEG images to the LNVR indefinitely without waiting for any feedback from the LNVR.

2. Stream of MJPEG images as in with one exception: the LNVR must repeat the command after each received image. For this case, the repeatRequest attribute must be set to “true” on the getvideo command.

3. One JPEG image. Some cameras can only send one JPEG image and close the connection automatically. This is also allowed. No special attributes are required, since after the JPEG is received the connection will be closed and the LNVR would have to establish a new connection. This approach typically does not allow capturing video at high frame rates since after each frame is received the connection must be re-established, which consumes time. Therefore this approach should be avoided if possible.

4. Stream of MPEG4 video. In this case, a camera would keep sending an HTTP stream containing MPEG4 images to the LNVR indefinitely without waiting for any feedback from the LNVR. This is a limited capability and might need to be evaluated for a particular camera. The JPEG images must be delivered as specified by “image/jpeg” MIME type (Content-Type: image/jpeg). The MPEG4 images must be delivered as specified by “image/mpeg” or “video/mpeg”MIME type (“Content-Type: image/mpeg” or “Content-Type: video/mpeg”). The parameter “Content-Length” would make receiving JPEGs slightly faster, but it is not required.

1.6.4. Rules

The rules link parameters and commands together. They do not have a separate section in the XML document. Instead attributes and nested elements of the other elements are used to define the rules.

Page 6: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 6 of 34

1.6.4.1. Set/query parameter rule

This rule is achieved by using the getcmd and setcmd attributes. These attributes specify which command is used to query and set the parameter to the camera. The command also specifies which parameters it uses through its collection of ParamGroup/Param elements. Each element in this collection corresponds to one parameter. This is a many to one relation, meaning that several parameters can reference the same command. The command is issued only once and all the parameters are embedded into the command. When you change the camera parameters in the OnGuard user interface, the corresponding commands (specified in the setcmd attribute) will be transmitted to the camera to apply the change. The best case scenario is when the parameters can be changed on the fly. In this scenario, no restarting of video is required and therefore no video is lost. If the parameter can only be changed by reissuing the getvideo command or the getvideo command has to be reissued from the LNVR (which is possible – see Reconnection rule), then some small piece of video will be lost during the reconnection of the getvideo command.

1.6.4.2. Reconnection rule

Some cameras require that video streaming is restarted for parameter changes to take effect. For example, there is a camera-wide parameter “Resolution” that is not part of the getvideo command. When the resolution is changed on the camera it does not affect existing clients, so all clients have to restart to get the video feed with the new resolution. Use Command/ReconnectGroup for specifying parameters that require reconnection. If the “Resolution” parameter is only part of the getvideo command, then the getvideo command will be restarted automatically.

1.6.4.3. Handshake rule

Some cameras require that a cookie (or session id – the name varies) be presented in some commands. The cookie must be requested from a camera before any other operation. The camera will generate the cookie for the client (for the LNVR). This cookie must then be embedded into other commands. Since the value of the cookie could not be known a priori and specified in the XML document, the handshake mechanism was designed to accommodate it. The LNVR will send commands with a reserved name handshake before any other command to request the cookie is sent. The response will be parsed, and the value of the cookie will be put into one of the temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands that have the paraml parameter. Multiple handshake commands may be used in order to accommodate multiple startup commands (i.e. handshake1, handshake2 etc) and they will be called in order. It is recommended to use fewer handshake commands where possible to limit the startup time of the video.

1.7. Example This example illustrates what the XML document for integrating a camera might look like for an imaginary “Camera ABC” IP camera. Only resolution, frame rate, and quality are configurable parameters for the camera. Let’s assume the camera can also be queried for the firmware version using the “getVersion” command. The version information will come in response to the http://ip_address/cgi-bin/param.cgi?action=list&group=firmware command and can be found after the “Version=” substring. The version information will be in the form of two integers separated by a dot (type="int.int"). Assume also that the camera has the following format for the command used for retrieving video: http://ip_address/cgi-bin/video.cgi?resolution=high&compression=100&fps=30. This example is for maximum quality, frame rate, and resolution. Corresponding values for these parameters must be embedded into the command instead of the hard coded values (i.e. 640x480, 100 and 30) as needed.

Page 7: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 7 of 34

In order for the LNVR to start capturing video from the camera, it needs to send only one command/request to the camera as shown previously. The response from the camera must be a sequence of JPEG images as specified by the MIME image/jpeg type. Each JPEG image must be separated by at least one empty line. The XML file for integration of the camera would be the following:

Example 1: Complete camera description document

2. Schema definition

2.1. Schema location schema location: C:\ Documents and Settings\All Users\Application Data\Lenel\LNVSuite\Caps\Camera \CameraCaps.xsd

2.2. CameraCapsGroup Diagram

Children CameraCaps

Attributes Name Type Use ver xs:float required

<?xml version="1.0" encoding="UTF-8"?> <CameraCapsGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CameraCaps.xsd" ver="2.17"> <CameraCaps id="Camera ABC"> <CmdParamGroup> <CmdParam id="Resolution" type="intxint" default="320x240" setcmd="getvideo"> <CmdParamEnumGroup> <CmdParamEnum cmd="low">320x240</CmdParamEnum> <CmdParamEnum cmd="high">640x480</CmdParamEnum> </CmdParamEnumGroup> </CmdParam> <CmdParam id="FrameRate" type="int" default="5" setcmd="getvideo" start="1" end="30"/> <CmdParam id="Quality" type="int" default="50" setcmd="getvideo" start="1" end="100"/> <CmdParam id="Version" type="int.int" getcmd="getVersion" default="0.0"/> </CmdParamGroup> <CommandGroup> <Command id="getvideo" protocol="HTTP/1.1" mode="GET" subprotocol="CGI" body="cgi-bin/video.cgi" postfix="text=0"> <ParamGroup> <Param type="in" paramid="Resolution" prefix="resolution="/> <Param type="in" paramid="Quality" prefix="compression="/> <Param type="in" paramid="FrameRate" prefix="fps="/> </ParamGroup> </Command> <Command id="getVersion" protocol="HTTP/1.1" mode="GET" subprotocol="CGI" body="cgi-bin/param.cgi" prefix="action=list&amp;group=firmware"> <ParamGroup> <Param type="out" paramid="Version" prefix="Version="/> </ParamGroup> </Command> </CommandGroup> </CameraCaps> </CameraCapsGroup>

Page 8: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 8 of 34

The root of the schema is element CameraCapsGroup. This element contains the version attribute and a collection of CameraCaps elements. The version should be set to the LNVR version which was used during the camera integration as one floating point value, for example “2.17”.

2.3. CameraCapsGroup/CameraCaps Diagram

Children CmdParamGroup CommandGroup

Attributes Name Type Use id xs:string required ver xs:string optional

A description of each of the camera types is located in the CameraCaps element. The id attribute represents the camera name (how it will be presented to the end user). The element contains parameters and capabilities of the camera in CmdParamGroup and commands and rules to generate the commands in CommandGroup.

Example 2. Top level XML elements.

2.4. CameraCapsGroup/CameraCaps/CmdParamGroup This element contains the collection of camera capabilities and parameters.

Diagram

Children CmdParam

2.5. CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam Diagram

Children CmdParamEnumGroup

Attributes Name Type Use setcmd xs:string optional

<?xml version="1.0" encoding="UTF-8"?> <CameraCapsGroup mlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CameraCaps.xsd" ver="2.17"> <CameraCaps id="Camera ABC"> <CmdParamGroup> … </CmdParamGroup> <CommandGroup> … </CommandGroup> </CameraCaps> </CameraCapsGroup> </CameraCapsGroup>

Page 9: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 9 of 34

getcmd xs:string optional id xs:string required type xs:string required start xs:string optional end xs:string optional step xs:string optional default xs:string required

The element CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam describes each parameter. This is the key element of the schema. Any parameter (Brightness, Resolution, etc) would be described using this element. This element would describe whether the parameter values can be presented as a range (for example from 1 to 100) or as an enumeration (such as “high”, “medium”, “low”); the name of the parameter as OnGuard would see it (id attribute); the type of parameter (string, integer, …) and the commands that set/get the parameter to the camera (getcmd and setcmd attributes).

2.5.1. id attribute

The id attribute represents a parameter name and can belong to one of the following groups: General Group, PTZ Group, or Special Group. The parameter name defines how this parameter will be presented in OnGuard. IP cameras may have different parameter names, but the concept is the same. General Group This group describes parameters for basically everything excluding PTZ. So, if a camera does not have PTZ, then the remaining two groups (PTZ Group and Special Group) typically will not be needed.

# Parameter Description 1. Version Specifies the version of the video source. This is typically used for a

request from the camera to send the version of the camera. This value is then used to display the version of the camera in OnGuard.

2. InputNum 3. Rotation Used to specify the rotation of the camera. The rotation is handled

internally in OnGuard so this parameter is never used. 4. Resolution Specifies the resolutions of the camera. Typically we use resolutions

higher than 320x240, since these resolutions are can be viewed properly. 5. Quality Specifies the quality of the picture (or specifies the opposite of the

compression level). 6. Bitrate Used typically for MPEG4, specifies the Bitrate that the MPEG4 is

transmitting images. 7. Brightness Used to set (or get) the brightness of the image. 8. Contrast Used to set (or get) the contrast of the image. 9. Hue Used to set (or get) the hue of the image. 10. Saturation Used to set (or get) the saturation (color level) of the image. 11. Sharpness Used to set (or get) the sharpness of the image. 12. Gamma Used to set (or get) the gamma of the image. 13. WhiteBalance Used to set (or get) the white balance setting of the camera. 14. BacklightComp Used to set (or get) the backlight compensation of the image on or off. 15. Exposure Used to set (or get) the exposure of the sensor to light. 16. Monochrome Used to set (or get) the sharpness of the image. 17. param1 -

param9 Special generic parameters used for handshake and other commands.

PTZ Group This group describes the PTZ parameters.

# Parameter Description 1. PanSpeed Used for setting the pan speed for continuous motion commands. 2. TiltSpeed Used for setting the Tilt speed for continuous motion commands. 3. Pan Used for setting the Pan value for relative commands. 4. Tilt Used for setting the Tilt value for relative commands. 5. MoveSpeed Used for setting the move speed (Pan, Tilt, Zoom) for continuous

motion commands. 6. MoveStop Used for stop continuous motion commands. 7. AutoFocus Used to set the Focus on the camera to Auto or Manual.

Page 10: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 10 of 34

# Parameter Description 8. Focus Used for setting the Focus value for relative commands. 9. FocusNear Used for setting the Focus Near speed for continuous focus. 10. FocusFar Used for setting the Focus Far speed for continuous focus. 11. FocusStop Used for setting the Focus Stop command. 12. AutoIris Used to set the Iris on the camera to Auto or Manual. 13. Iris Used for setting the Iris value for relative commands. 14. IrisOpen Used for setting the Iris Open speed for continuous Iris. 15. IrisClose Used for setting the Iris Close speed for continuous Iris. 16. IrisStop Used for setting the Iris Stop Command. 17. Zoom Used for setting the Zoom value for relative commands. 18. ZoomIn Used for setting the Zoom In speed for continuous zoom. 19. ZoomOut Used for setting the Zoom Out speed for continuous zoom. 20. ZoomStop Used for setting the Zoom Stop Command. 21. Preset Used to send Preset commands to the camera. 22. PanBy Used for setting the pan value for relative panning commands. 23. TiltBy Used for setting the tilt value for relative tilting commands. 24. ZoomBy Used for setting the zoom value for relative zooming commands. 25. FocusBy Used for setting the focus value for relative focusing commands. 26. IrisBy Used for setting the iris value for relative iris commands. 27. PanTo Used for setting the pan value for absolute panning commands. 28. TiltTo Used for setting the tilt value for absolute tilting commands. 29. ZoomTo Used for setting the zoom value for absolute zooming commands. 30. FocusTo Used for setting the focus value for absolute focusing commands. 31. IrisTo Used for setting the iris value for absolute iris commands. 32. ViewingAngle Used internally. Not currently used. 33. ProportionalPTZOff Used internally. When on, the recorder will request the zoom level

prior to performing any Pan Tilt operation. This allows the logic to move proportionally to the zoom (so at zoomed in values, the Pan Speed is slower).

PanSpeed TiltSpeed ZoomStop Preset MoveStop AutoFocus ZoomIn FocusNear FocusFar FocusStop AutoIris ZoomOut IrisOpen IrisClose IrisStop

Special Group Some cameras require other parameters in commands. One example of this is the handshaking mechanism where a client requires a cookie from the camera during the connection process and uses the cookie in all other commands. This handshaking mechanism is described in section 1.6.4.3. Use parameter names “param1” through “param9”. Another special parameter is Standard. It describes a list of video standards for the camera (often NTSC and PAL). This parameter is optional. If it exists, then the Resolution parameter may have different resolutions for different video standards. When a user selects a standard, only the resolution values that have standard attributes set to the selected standard will be available. Note: For some cameras, the Video Standard approach does not apply. In this case the XML document must not have the Standard parameter in the list.

# Parameter Description 1. Standard Used to set (or get) the standard of the video (NTSC or

PAL). 2. AudioInVolume Used to set the incoming audio volume. 3. AudioInQuality Used to set the incoming audio quality (as of this version it

is only set to G711 mu-law). 4. AudioInSource Used to set the incoming audio source (mic or line). 5. AudioMode The Audio Mode specifies the type of audio that is

supported by the camera (i.e.full, half etc). 6. GainThreshold Used internally. Do not use. 7. MaxExposureTime Used internally. Do not use.

Page 11: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 11 of 34

# Parameter Description 8. MaxGain Used internally. Do not use. 9. MPEGProfileLevel Used internally. Do not use. 10. MPEGICount Used internally. Do not use. 11. MPEGPCount Used internally. Do not use. 12. MPEGBCount Used internally. Do not use. 13. MPEGRestartStream Used internally. Do not use. 14. IO_Input Specifies the Dry contact input number (i.e. when multiple

inputs are needed) 15. IO_Input_value Specifies the input value that is returned by the camera,

when the single status request is needed. 16. IO_Input_Monitor_value Specifies the input value that is returned by the camera,

when the monitor request is needed. 17. IO_Output Specifies the Dry contact output number (i.e. when

multiple outputs are needed) 18. IO_Output_value Specifies the output value that is send to the camera, when

the single output request is used. 19. Video_Input_value Specifies the video input number (i.e. when multiple video

inputs are used for video servers) 20. Passwd_UserName Specifies the username of the user password to change 21. Passwd_Password Specifies the password of the user password to change 22. Passwd_UserLine Specifies the user string prior to the user (Optional) 23. Passwd_MinLength Specifies the minimum length of the password 24. Passwd_MaxLength Specifies the maximum length of the password 25. Passwd_CharSet Specifies the character set allowed for the password (i.e.

"21,23-27,2D,2E,30-39,40-5A,5E,5F,61-7A,7E") 26. Passwd_UserSeparator Specifies the password separator character. 27. Passwd_TypeNameSeparator Specifies the type name separator character. 28. Passwd_AccessRightSeparator Specifies the Access right separator character. 29. Passwd_UserPassBase64 Specifies whether the username and password will be

encoded in Base64. 30. Passwd_UserPassSeparator Specifies whether the Username and password will have a

separator. 31. CameraMemoryPort Specifies the In Camera Storage port number (used only

for certain cameras, do not use) 32. CameraMemoryRoot Specifies the In Camera Storage root path for the ftp

commands(used only for certain cameras, do not use) 33. MD_Window Specifies the Motion detection window. 34. MD_value Specifies the Motion detection value expected. 35. MD_threshold Specifies the Motion detection threshold. 36. TimeMaster Specifies whether the camera can have time stamps (used

only for certain cameras, do not use) 37. WorldTimeZone Used internally. Do not use.

2.5.2. setcmd and getcmd attributes

The setcmd and getcmd attributes reference commands set and query the parameter to/from the camera. The same command can be specified for a number of different parameters; this means that several parameters can be changed at once.

2.5.3. type attribute

The type attribute specifies the type of the parameter. Values can be “int”, “intxint”, “string”, “int.int” or “int.int.int”. The type attribute defines how the parameter will be presented in a command. The “int” value is used when an integer value is part of the command. The “intxint” value is used for the Resolution parameter; for example “320x240”. The “string” value is used when the parameter resolves to a string in the command. (For example, quality is often an enumeration of strings, such as “fine”, “good”, “low”.) The

Page 12: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 12 of 34

two remaining types are typically used to parse version information from the camera. The camera version could be one, two, or three digits separated by dots. The example in section 2.5.6 illustrates how the version parameter could be used.

2.5.4. Ranges and enumerations

The parameter values could be described as ranges and enumerations. A range is useful for a parameter whose value is an integer and could belong to a range from A to B (often from 1 to 100). The start and end attributes define the range of a parameter. Note that the beginning of the range could be less than its end, for example (range 100 to 1). This is useful when the camera parameter is opposite from the OnGuard parameter (for example OnGuard has a parameter Quality, but the camera has a parameter Compression). Example 3 below shows that FrameRate parameter is limited to a range from 1 to 15. Enumerations are used for all other cases. For more information on enumerations see section 2.6.

2.5.5. default attribute

The ‘default’ attribute specifies the default value of the parameter.

2.5.6. Example for CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam

Example 3: Simplest parameters

2.6. CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam/CmdParamEnumGroup

This element is used for parameters that can be represented in an enumeration. It is only needed if the value of the parameter is an enumeration (for example: “high”, “low”). The Resolution parameter also requires this element. Other parameters can be presented as ranges. For more information, see “Ranges and enumerations”.

Diagram

Children CmdParamEnum

2.7. CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam/CmdParamEnumGroup/CmdParamEnum

Diagram

Type extension of xs:string

<?xml version="1.0" encoding="UTF-8"?> <CameraCapsGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CameraCaps.xsd" ver="2.17"> <CameraCaps id="Camera ABC"> <CmdParamGroup> <CmdParam id="FrameRate" type="int" default="5" setcmd="getvideo" start="1" end="15"/> <CmdParam id="Version" type="int.int" getcmd="getVersion" default="0.0"/> … </CmdParamGroup> …

Page 13: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 13 of 34

Attributes Name Type Use ui xs:string optional cmd xs:string optional standard xs:string optional

This element contains data about each enumerated value.

2.7.1. cmd attribute

The cmd attribute is optional and is used when data embedded to the command is not the same as the logical enumeration value. For example, a camera might use the concept of compression level instead of the OnGuard concept of quality. Where the relation could be: compression level = 100-quality. Then quality value 100 must be converted to compression value 0 and so on. See the Quality parameter in section 2.7.3 for an example.

2.7.2. standard attribute

The ‘standard’ attribute is used for representing video standards in the Resolution parameter because PAL and NTSC cameras typically have identical behavior with the exception of resolution. While NTSC cameras have a resolution of 320x240, PAL cameras may have a resolution of 352x288. The ‘standard’ attribute allows using both such cameras by specifying only one camera type.

2.7.3. Examples of enumerated parameters

The Quality parameter is converted to the camera-specific compression level value. The Resolution parameter is specified for both CIF and 4CIF resolutions for both PAL and NTSC video standards. The FrameRate parameter is only available on the camera at frame rates of 1, 5, or 10 frames per second.

Example 4: Parameters – Enumerations

<?xml version="1.0" encoding="UTF-8"?> <CameraCapsGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CameraCaps.xsd" ver="2.17"> <CameraCaps id="Camera ABC"> <CmdParamGroup> <CmdParam id="Quality" type="int" default="50" setcmd="getvideo"> <CmdParamEnumGroup> <CmdParamEnum cmd="100">0</CmdParamEnum> <CmdParamEnum cmd="50">50</CmdParamEnum> <CmdParamEnum cmd="0">100</CmdParamEnum> </CmdParamEnumGroup> </CmdParam> <CmdParam id="Resolution" type="intxint" default="320x240" setcmd="getvideo"> <CmdParamEnumGroup>

<CmdParamEnum cmd="CIF&amp;spixel=1" standard="NTSC">320x240</CmdParamEnum> <CmdParamEnum cmd="CIF&amp;spixel=1" standard="PAL">384x288</CmdParamEnum> <CmdParamEnum cmd="4CIF&amp;spixel=1" standard="NTSC">640x480</CmdParamEnum> <CmdParamEnum cmd="4CIF&amp;spixel=1" standard="PAL">768x576</CmdParamEnum> </CmdParamEnumGroup> </CmdParam> <CmdParam id="FrameRate" type="int" default="5" setcmd="getvideo"> <CmdParamEnumGroup> <CmdParamEnum>1</CmdParamEnum> <CmdParamEnum>5</CmdParamEnum> <CmdParamEnum>10</CmdParamEnum> </CmdParamEnumGroup> </CmdParam> …

Page 14: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 14 of 34

2.8. CameraCapsGroup/CameraCaps/CommandGroup Diagram

Children Command

This element contains collections of all commands (requests) that can be sent to the camera. The only required command is “getvideo”. This command is invoked to capture video streaming from the camera. All other commands are invoked to set or query the corresponding parameters. The relationship between commands and parameters is many-to-many and is defined as follows. A parameter can reference a command that is used to set/query it in its setcmd and getcmd attributes. A command lists parameters in the order that they will be embedded in the command using the CameraCapsGroup/CameraCaps/CommandGroup/Command/ParamGroup element.

2.9. CameraCapsGroup/CameraCaps/CommandGroup/Command Diagram

Children ParamGroup ReconnectGroup

Attributes Name Type Use id xs:string required protocol xs:string required mode xs:string optional subprotocol xs:string optional body xs:string optional prefix xs:string optional postfix xs:string optional separator xs:string optional repeatRequest xs:boolean optional delay xs:int optional controlRate xs:boolean optional

The element describes a command (request) that would be sent to the camera. Each command has following syntax:

The placeholders in the command syntax mean the following:

<camera ip> is a placeholder for the actual camera IP address;

<body> is the content of the body attribute;

<prefix> is the content of the prefix attribute;

<postfix> is the content of the postfix attribute;

<param1=value1&param2=value2…> represents the list of parameters that is contained in the ParamGroup element.

Note: If the ampersand symbol (&) between parameters must be replaced by something else, use the separator attribute to specify the separator. An empty separator is also allowed.

http://<camera ip>/<body>?<prefix><param1=value1&param2=value2…><postfix> HTTP/1.1

Page 15: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2013 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 15 of 34

2.9.1. id attribute

The id attribute describes the internal name of the command. The name is used as a reference between the parameters and commands. This is what is specified in the parameter in the setcmd and getcmd fields.

2.9.2. protocol attribute

The protocol attribute specifies the protocol between the LNVR and the camera. Currently only the HTTP protocol is available, but different HTTP versions can be used. Typically it would be set to “HTTP/1.1”.

2.9.3. mode attribute

The mode attribute currently can be either GET or POST. For the GET mode all parameters will be put in the request header.

Example 5: GET command

If a request has some data that must be embedded into the request body then the POST mode must be used. All parameters that need to go into the request body must set the attribute body="true” in their CameraCapsGroup/CameraCaps/CommandGroup/Command/ParamGroup/Param element.

2.9.4. body attribute

The body attribute specifies the body of the header request. The contents of this attribute will be added directly after the address during the URL generation phase.

2.9.5. prefix and postfix attributes

The prefix attribute specifies whether some additional data must be added right after the body. The prefix will be separated from the body by the separator. The separator is specified using the separator attribute. If

Assume a camera has the following command format:

http://192.168.1.1/cgi-bin/mipeg/video.cgi?resolution=320x240&compression=50&fps=5&clock=0 HTTP/1.1

Then the XML representation of the command could be: <Command id="getvideo" protocol="HTTP/1.1" mode="GET" subprotocol="CGI" body="cgi-bin/mjpg/video.cgi" postfix="clock=0"> <ParamGroup>

<Param type="in" paramid="Resolution" prefix="resolution="/> <Param type="in" paramid="Quality" prefix="compression="/> <Param type="in" paramid="FrameRate" prefix="fps="/>

</ParamGroup> /C d

Example of a POST mode command: POST http://192.168.1.1/cgi-bin/syssetup HTTP/1.1

Content-Length: 39

resolution=320x240&compression=50&fps=5

The following URL command

http://192.168.1.1/cgi-bin/mipeg/video.cgi HTTP/1.1

must be described with the following attributes: protocol="HTTP/1.1 mode=”GET” subprotocol=”CGI” body="cgi-bin/mjpg/video.cgi"

Page 16: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 16 of 34

this attribute is not set, then the default separator (question mark) is used. An empty separator is also allowed.

The postfix attribute specifies data that must be added after the list of parameters. See example 5 with postfix="clock=0".

2.9.6. repeatRequest, delay and controlRate attributes

The ‘epeatRequest, delay and controlRate attributes are sometimes used for the “getvideo” command to receive a continuous video stream from the camera. For most IP cameras, none of the attributes are needed. For this reason, this attribute is not often used and its default value is “false”.

2.9.6.1. repeatRequest attribute

The repeatRequest attribute must be set to true when the LNVR must send the getvideo command after each received image to get the next image.

2.9.6.2. delay attribute

The delay attribute is used when an IP camera requires a delay before accepting the command.

2.9.6.3. controlRate attribute

The controlRate attribute is used when the IP camera sends images as fast as possible. Therefore in order to regulate frame rate, the LNVR must wait before processing the next frame. For example, a camera can stream only 30 frames per second, but only one frame per second is needed for the user. The LNVR would then periodically wait to make sure that no more than one frame per second is transmitted. The majority of IP cameras have the ability to control frame rate through their API and therefore the controlRate attribute is not needed for such cases.

2.10. CameraCapsGroup/CameraCaps/CommandGroup/Command/ParamGroup

This element holds a collection of parameters for the command. Diagram

Children Param

2.11. CameraCapsGroup/CameraCaps/CommandGroup/Command/ParamGroup/Param

Diagram

The following URL command

http://192.168.1.1/cgi-bin/param.cgi?action=list&group=Image HTTP/1.1

must be described with the following attributes: protocol="HTTP/1.1 mode=”GET” subprotocol=”CGI” body="cgi-bin/param.cgi" prefix=’action=list&amp;group=Image”

Page 17: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 17 of 34

Attributes Name Type Use type xs:string required Paramid xs:string optional item xs:string optional prefix xs:string optional postfix xs:string optional format xs:string optional body xs:boolean optional

If a command has parameters then this element must be used to enter details for each parameter.

2.11.1. type attribute

The type attribute can be set to either “in” or “out” in order to specify whether the parameter is an input or output parameter. Input parameters will be embedded in the command before the command is sent to the camera. Output parameters will be found in the response from the camera and parsed by the LNVR. An example of this is a query for the camera firmware version.

2.11.2. paramid attribute

The paramid attribute is a cross reference to the parameter from the CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam list.

2.11.3. prefix and postfix attributes

The prefix attribute specifies the string that must be inserted before the value for input parameters. For output parameters this specifies the substring that identifies the parameter. The LNVR will search for the substring in the camera response and parse the data to determine the parameter value. The ‘postfix’ attribute specifies the string that must be added after the parameter value.

2.11.4. format attribute

The format attribute specifies the format of a C function printf() that will be used to convert the parameter value to a string.

2.11.5. body attribute

The body attribute can be either true or false. If it is set to true, then the parameter will go to the request body instead of the request header. See section 2.9.3 on GET and POST modes in the CameraCapsGroup/CameraCaps/CommandGroup/Command command for an example.

2.12. CameraCapsGroup/CameraCaps/CommandGroup/Command/ReconnectGroup

This element specifies optional collections of parameters that require reconnection in order for the change in the parameter to take effect.

Diagram

Children Reconnect

Page 18: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 18 of 34

2.13. CameraCapsGroup/CameraCaps/CommandGroup/Command/ReconnectGroup/Reconnect

Diagram

Attributes Name Type Use

Paramid xs:string required

If the end user changes the value of a parameter in the OnGuard user interface, then the corresponding command (the one that is specified in the parameter’s setcmd attribute) will be sent to the camera. For some IP cameras this is not enough and other commands (most often getvideo) must be reissued to the camera and therefore the existing connection must be broken and new a connection established. Each of these parameters must be listed in the element using the ‘paramid’ attribute.

3. Parameters

3.1. Version The Version parameter describes the camera version. If this parameter is listed, then the camera can be queried for its firmware version. The format of the version in the response must be one, two, or three integer values separated by dots (for example: “1”, “1.0” or “1.0.20”). Depending on how many integers there are in the version format, the corresponding type must be used: either “int”, “int.int” or “int.int.int”. Please make sure the first integer of the version number does not start with a '0'.

3.2. InputNum The ‘InputNum’ parameter is used for IP cameras that have multiple video inputs. The parameter describes how many inputs there are in the camera using the ‘start’ and ‘end’ attributes. It also specifies how the command must be built in order to capture video from a specified input.

3.3. FrameRate The FrameRate parameter specifies allowable frame rates in frames per second.

3.4. Resolution and Standard The ‘Resolution’ parameter must have the type ‘intxint’. It represents video resolution in pixels, for example 320x240. The possible values of resolutions must be listed in the parameter’s enumeration section. As with all enumerated parameters, if the format “320x240” is appropriate for the camera commands, then the ‘cmd’ attribute in the enumeration is not needed. If a camera has another format for representing resolutions, then the ‘cmd’ attribute must be set to the appropriate string.

In this example the camera uses strings “qvga” and “vga” to represent the resolutions. <CmdParam id="Resolution" type="intxint" default="320x240" setcmd="getvideo"> <CmdParamEnumGroup> <CmdParamEnum cmd="qvga">320x240</CmdParamEnum> <CmdParamEnum cmd="vga">640x480</CmdParamEnum> </CmdParamEnumGroup>

</CmdParam>

Page 19: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 19 of 34

Example 6: ‘cmd’ Attribute

The Standard parameter represents the video standard (NTSC or PAL). Since the video resolution typically depends on the video standard, the Resolution parameter could use the ‘standard’ attribute to specify which resolutions apply to which video standards. The following example shows that two resolutions (320x240 and 640x480) are available for NTSC and two other resolutions (352x240 and 704x480) for PAL.

Example 7: Relationship between the Standard and Resolution parameters

3.5. Quality The Quality parameter represents the quality of compressed images. The higher the value of the parameter, the better the quality of the image produced. Some IP cameras use the opposite notion: compression. If compression is used, an enumeration must be used to convert high values to low and vice versa as in the following example.

Example 8: Conversion from Quality to Compression

3.6. Brightness, Contrast, Hue, Saturation, Sharpness, Gamma, WhiteBalance, BacklightComp, and Exposure

These parameters represent corresponding features.

4. PTZ Parameters PTZ operations are also available in the OpenVideo - Capture Standard API. If a list of camera parameters contains at least one parameter from the PTZ group, then the Video Player in Alarm Monitoring will display the PTZ toolbar while viewing live video from the camera. PTZ operations are designed to work in

<CmdParam id="Quality" type="int" default="50" setcmd="getvideo"> <CmdParamEnumGroup> <CmdParamEnum cmd="100">0</CmdParamEnum> <CmdParamEnum cmd="75">25</CmdParamEnum> <CmdParamEnum cmd="50">50</CmdParamEnum> <CmdParamEnum cmd="25">75</CmdParamEnum> <CmdParamEnum cmd="0">100</CmdParamEnum> </CmdParamEnumGroup> </CmdParam>

<CmdParam id="Standard" type="string" default="NTSC"> <CmdParamEnumGroup> <CmdParamEnum>NTSC</CmdParamEnum> <CmdParamEnum>PAL</CmdParamEnum> </CmdParamEnumGroup> </CmdParam> <CmdParam id="Resolution" type="intxint" default="320x240" setcmd="getvideo"> <CmdParamEnumGroup> <CmdParamEnum cmd="1CIF_NTSC" standard="NTSC">320x240</CmdParamEnum> <CmdParamEnum cmd="1CIF_PAL" standard="PAL">352x240</CmdParamEnum> <CmdParamEnum cmd="4CIF_NTSC" standard="NTSC">640x480</CmdParamEnum> <CmdParamEnum cmd="4CIF_PAL" standard="PAL">704x480</CmdParamEnum> </CmdParamEnumGroup> </CmdParam>

Page 20: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 20 of 34

continuous mode in OnGuard. Once the operation is initiated, the camera must perform the operation continuously until it reaches the physical end or the corresponding stop command is sent.

4.1. PanSpeed and TiltSpeed The PanSpeed and TiltSpeed parameters are used for defining Pan and Tilt operations on the camera. The values for the PanSpeed and TiltSpeed parameters represent both direction and speed. The lower half of the parameter range represents moving in a negative direction, while the upper part – in a positive direction. If a user wants to stop continuous pan and tilt, the command specified in the MoveStop parameter will be issued.

4.2. MoveStop, ZoomStop, FocusStop and IrisStop PTZ operations can be continuous: a user requests a camera to move (to the left for example) with a given speed by mouse clicking in the video player. When the mouse button is released, it means that user wants to stop continuous PTZ operation. The MoveStop, ZoomStop, FocusStop and IrisStop parameters are used to stop the corresponding operation. These parameters typically do not have values. The main reason they are needed is to specify the name of the command that will be used to stop the operation, as in the following example.

Example 9: Stop continuous zoom command

4.3. AutoFocus and AutoIris The AutoFocus and AutoIris parameters are used to turn on and off auto focus and auto iris on the camera, if the camera has this functionalities. If the parameters are listed, they must have an enumeration with values “1” and “0” that will specify the values in the command to correspondingly set the feature on or off.

Assuming a camera has the following command format to stop continuous zoom:

http://192.168.1.1/cgi-bin/com/ptz.cgi?continuouszoommove=0

Then describing it in XML could be following: <CmdParam id="ZoomStop" type="int" group="PTZ" setcmd="setZoomStop"/> … <Command id="setZoomStop" protocol="HTTP/1.1" mode="GET" subprotocol="CGI" body="cgi-bin/com/ptz.cgi" prefix="continuouszoommove=0"/>

<CmdParam id="AutoFocus" type="int" group="PTZ" setcmd="setFocusMode" default="1"> <CmdParamEnumGroup> <CmdParamEnum cmd="on">1</CmdParamEnum> <CmdParamEnum cmd="off">0</CmdParamEnum> </CmdParamEnumGroup> </CmdParam> … <Command id="setFocusMode" protocol="HTTP/1.0" mode="GET" subprotocol="CGI" body="cgi-bin/com/ptz.cgi" prefix="camera=1"> <ParamGroup> <Param type="in" paramid="AutoFocus" prefix="autofocus="/> </ParamGroup> </Command> Or if for example the IP camera has multiple video inputs then the command will have two parameters: <Command id="setFocusMode" protocol="HTTP/1.1" mode="GET" subprotocol="CGI" body="cgi-bin/com/ptz.cgi"> <ParamGroup> <Param type="in" paramid="InputNum" prefix="camera="/> <Param type="in" paramid="AutoFocus" prefix="autofocus="/> </ParamGroup> </Command>

Page 21: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 21 of 34

Example 10: PTZ command with and without an additional InputNum parameter

4.4. FocusNear and FocusFar These parameters are used to specify how the continuous focus operations can be performed on the camera. The parameter argument represents speed. The higher the value the faster the camera should change the focus. If a user wants to stop continuous focus operation, the command specified in the FocusStop parameter will be issued.

4.5. IrisOpen and IrisClose These parameters are used to specify how continuous iris operations can be performed on the camera. The parameter argument represents speed. The higher the value the faster the camera should change the iris. If a user wants to stop continuous iris operation, the command specified in the IrisStop parameter will be issued.

4.6. ZoomIn and ZoomOut These parameters are used to specify how continuous zoom operations can be performed on the camera. The parameter argument represents speed. The higher the value, the faster the camera should change the zoom. If user wants to stop continuous zoom operation, the command specified in the ZoomStop parameter will be issued.

4.7. Preset IP cameras often provide the ability to create, configure, and invoke presets. The Preset parameter specifies how the preset number will be passed to the camera to make the camera to go to the preset.

Example 11: Command to go to a PTZ Preset

5. OpenVideo - Capture Standard Simulator The simulator can be used to verify that the OpenVideo - Capture Standard engine generates commands properly. The simulator is named CamCapsTest.exe and can only run in environments preconfigured with OnGuard or LNVR. The tool has two files as inputs and one optional for setting default cameras. Once the XML file for the camera is completed, it can be opened in the simulator. The simulator will load all the camera types from the XML file, and after selecting the desired camera type, load all commands for the selected camera type. After selecting a command from the Command drop-down list, the simulator will search for all the parameters of the command and create the user interface controls below to allow the configuration of the parameters. Once you set the parameters to the desired values, click the [!] button (Generate) to see the

Assuming a camera has the following URL command to go to the presets:

http://192.168.1.1/cgi-bin/com/ptz.cgi?camera=1&gotoserverpresetname=1.

Then the following XML could be used to describe the presets: <CmdParam id="Preset" type="int" group="PTZ" setcmd="setPresetPos" default="1" start="1" end="10"/> … <Command id="setPresetPos" protocol="HTTP/1.0" mode="GET" subprotocol="CGI" body="cgi-bin/com/ptz.cgi" prefix="camera=1"> <ParamGroup> <Param type="in" paramid="Preset" prefix="gotoserverpresetname="/> </ParamGroup> </Command>

Page 22: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 22 of 34

resulting command in the edit box to the left of the [!] button. If the command is generated as needed, you can also run this command by clicking the [>] button (Run). However, you must first make sure that the correct camera address, port, user name, and password are typed. Note: The simulator is not a part of the OpenVideo - Capture Standard product. This is a developer’s tool that demonstrates some of the OpenVideo - Capture Standard operations. This tool is not fully supported. Any feedback on the tool would be appreciated. However, Lenel does not make any guarantees about the performance of the tool in general, and does not guarantee that any improvements will be made to the tool. Note: A sample XML file (Axis213.xml) that describes the integration of other cameras is installed during the SDK installation to \OpenCapture\ subfolder. Use it as an example for creating your XML file or experiment with it in the simulator to see how the OpenVideo - Capture Standard engine reacts to the example.

5.1. Files used from the simulator When the simulator opens, no default file is used. Use the “Open File” option to open the required “Brand.xml” file that describes the commands to be executed against the camera (where “Brand” is the name of the camera manufacturer). The CameraCaps.xsd file needs to be on the same directory as the “Brand.xml” file and provides the schema for the xml. An optional file “cameras.txt” can be created to include a list of camera that we will be working with in order to be automatically loaded with some values. This file contains the cameras that the camera manufacturer is working with (model number) and values that need to be added every time we change the camera model as shown below:

Axis 213 PTZ; 192.168.32.206 80 root pass 213 PTZ MPEG4; 192.168.32.206 80 root pass

The format is simple; Model name; IPAddress username password

The tool will read this file every time you select a new file to open (or the same file). The tool will search in the list of models and if the model is found, it will automatically fill in the IP Address, username and password for you so that you do not have to enter this information repeatedly.

5.2. Changing the camera configuration In order to change the camera configuration, select any of the commands that are listed in the setcmd attributes of the parameters of interest. The simulator will create user interface controls and put default values in them. You can adjust the parameter values as needed and generate the command by clicking the [!] button (Generate). You must make sure that the command is built as needed. You can run the command by clicking the [>] button (Run). The simulator will send the command to the camera and the camera in response must change the parameters as requested. The response from the camera will be shown in the large edit box on the left side. The following example illustrates the results of sending the setsensor command to an Axis 206 camera. As you can see, the command controls Brightness, Sharpness, White Balance and Exposure. Brightness and Sharpness are presented as ranges on the camera. White Balance and Exposure are presented as enumerations.

Page 23: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 23 of 34

5.3. Querying the camera configuration In order to query the camera configuration

1. Select a Command that does the query from the drop-down list.

2. Click the [!] button (Generate) in order to generate the command.

3. Verify the generated command.

4. Click the [>] button (Run) to execute it.

Although you will see the list of parameters for the command, you do not need to fill in the parameters, since those are output parameters from the command. After you receive a response from the command, click the “Parse” button and the simulator will parse the parameters from the camera’s response and fill in the corresponding parameter’s user interface controls.

5.4. Retrieving video stream from the camera The simulator can retrieve and display live video stream from the camera. To do this:

1. Select the “getvideo” command from the Command drop-down list.

2. Configure the parameters using the auto-generated UI controls.

3. Generate the command.

4. Verify the generated command.

5. Run the command.

To stop receiving video data, click the [] button. The following example shows the tool displaying live video from an Axis 206 camera. Note: Values for the current frame rate, bitrate and video resolution are displayed above the [Parse] button.

Generate Run

Response from the camera

Page 24: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 24 of 34

6. Final Testing

6.1. Overview Although the OpenVideo - Capture Standard SDK does not include the OnGuard video product, the final certification will be performed at a Lenel site to make sure the camera can work with the OnGuard Video product. The following checklist can help prepare for the certification. After the XML file is completed, use the OpenVideo - Capture Standard Simulator to perform each of the following tests.

6.2. Video capturing In order to test capturing video select the getvideo command from the command list, set all the parameters as needed, and generate the command by clicking the [!] button. Make sure the request is built correctly. Next, execute the command by clicking the [>] button and verify that the video is displayed and that the frame rate and the video resolution are correct by comparing the frame rate and the resolution displayed above the [Parse] button. Repeat the procedure for each combination of the parameters available for the getvideo command. See the sections describing the getvideo command within this document for more information.

Stop Current frame rate, bitrate and resolution

Page 25: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 25 of 34

6.3. Changing parameters on the fly In order to perform this set of tests, have two instances of the OpenVideo - Capture Standard Simulator application open. The first instance must continuously display live video as described in the previous section. The second instance will be used to change the parameters on the fly. The goal is to verify that changing the parameters from the second instance of the OpenVideo - Capture Standard Simulator actually changes the video stream displayed in the first OpenVideo - Capture Standard Simulator instance. Often these parameters will be Brightness, Sharpness, etc. For each of the parameters that can be changed on the fly repeat following using the second instance of the simulator. Select the command that sets the parameter on the camera, set the parameter value, and generate the command using the [!] button. Make sure the command is generated properly. Then execute the command by clicking the [>] button. Make sure the response from the camera, which is displayed in the large text box on the left, does not have any problems. Monitor the video stream, which is displayed in the first instance of the simulator, to make sure that the change in the parameter actually took effect. If the change does not take effect, but all the actions were correct, then it is possible that particular parameter cannot be changed on the fly. It is common that changes in some of the parameters do not take effect until the video stream is restarted. Such parameters must be listed in the ReconnectGroup/Reconnect elements of the getvideo command. The next section explains testing such parameters.

6.4. Changing parameters that require reconnection The parameters that cannot be changed on the fly and require restarting video capturing in order for changes to take effect must be listed in the ReconnectGroup/Reconnect elements of the getvideo command. Testing for these parameters is similar to the previous section with one exception. After the command to change the parameter is sent to the camera using the second instance of the simulator, the first instance, obviously, will not show the change. You have to restart the video stream manually. To do this, click the [] button, and then the [>] button to restart the video capturing. Make sure that the new video stream shows that the parameter changes indeed took effect.

6.5. Querying current parameter values The most important parameter that needs to be queried is the Version parameter. This is because users often configure Alarm Monitoring to display the firmware version of the IP cameras. All remaining parameters do not have to have the ability to query its current value from the camera. Although, if this functionality is available it might speed up changing the camera configuration in the case where multiple commands need to be send to a camera to change parameters and such commands are expensive/slow or require reconnection or rebooting the camera. In this case, the LNVR queries the camera for the current values of the parameters and if the values match then the command to change the value will not be sent to the camera. For each parameter that needs to be queried from the camera repeat the querying and parsing procedure described in section 5.3: Querying the camera configuration.

6.6. PTZ PTZ testing is easier when two instances of the simulator application are open simultaneously. The first instance constantly displays live video, while the second instance is used to generate and send the PTZ requests to the camera. For each of the PTZ commands that you have listed in the XML document perform following (from the second instance of the simulator): Select the command, set the parameters as needed, generate the command, and send it to the camera. Verify using the first instance of the simulator that the camera performs the PTZ operation as requested.

Page 26: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 26 of 34

Appendix A: RTP/RTSP Capture Standard Integration In order for a camera to work with the OpenVideo – Capture Standard module, the camera must implement RTSP as per RFC 2326. The first and most important test prior to testing any camera in order to make the camera work with the LNVR OpenVideo – Capture Standard RTP/RTSP is to use standard viewers to view video. The Panasonic 202A PTZ MPEG4 camera is used to illustrate this example. First download and install the latest Quicktime and VLC Player on the machine you will be developing the new camera implementation. The camera that supports RTSP needs to work with both players in order to be integrated in OnGuard. The following is the standard test for checking is the camera works with Quicktime.

1. Launch Quicktime and select “File” -> “Open URL”. 2. Enter the URL that will allow the camera to display video (the format is

“rtsp://IP_ADDRESS/RTSP_PATH”). For the Panasonic 202A PTZ MPEG4 the format is “rtsp://192.168.34.235/MediaInput/mpeg4”.

3. You should be able to view video from the camera.

Page 27: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 27 of 34

The following is the standard test for checking is the camera works with VLCPlayer.

1. Launch VLCPlayer and select “File” -> “Open Network Stream …”.

2. The following popup will appear:

3. Enter the RTSP URL that will allow the camera to display video (the format is “rtsp://IP_ADDRESS/RTSP_PATH”). For the Panasonic 202A PTZ MPEG4 the format is “rtsp://192.168.34.235/MediaInput/mpeg4”.

4. You should be able to view video from the camera.

Page 28: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 28 of 34

Once you verified that the camera can receive RTSP follow the instructions to complete the commands to set all the parameters on the camera. The RTSP cameras do not require a getVideo command in order to receive video (such as the MJPEG OpenCapture cameras). Finally, the following will allow the OpenVideo – Capture Standard module to read from the RTP OpenVideo – Capture Standard and specify the Media type that will be used. Add the following in the XML: <CameraCaps id="Panasonic MPEG4 RTP" isAbstract="true"> <CmdParamGroup> <CmdParam id="CaptureModule" type="string" default="LnrRTPOpenCap.LnrRTPCapSource"/> <CmdParam id="VideoEncoding" type="string" default="MPEG4"/> </CmdParamGroup> <CommandGroup> <Command id="BuildRtspPath" protocol="NONE" body="MediaInput/mpeg4"/> </CommandGroup> </CameraCaps> Rename the “Panasonic MPEG4 RTP” to have the new brand name (i.e. LENEL), the media type (i.e. MJPEG, MPEG4, H264). Assuming that we need to introduce a new LENEL H.264 camera, the test should read “LENEL H264 RTP”. Modify the “VideoEncoding” default string to contain either “MJPEG” or “MPEG4” or “H264”. This parameter specifies the RTSP payload type. Finally, add the path that is required by the RTSP command as you have used it in the previous screens to view video (i.e. MediaInput/mpeg4). Then add the following line inside the “CameraCaps” section :

<InheritsGroup> <Inherits>Panasonic MPEG4 RTP</Inherits> </InheritsGroup>

- At the time of this, the following protocol payloads were supported:

Page 29: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 29 of 34

• MJPEG as defined in RFC 2435 • MPEG-4 Elementary streams as defined in RFC 3640 • H264 as defined in RFC 3984.

- Basic Authentication is supported - Audio is not supported

Page 30: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 30 of 34

Index Altova XMLSPY ....................................................... 4 Attribute 'cmd' example ........................................... 19 Attributes

CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam ...................................................... 9

CameraCapsGroup/CameraCaps/CmdParamGroup/CmdParam/CmdParamEnumGroup/ CmdParamEnum ............................................ 13

CameraCapsGroup/CameraCaps/CommandGroup/Command ....................................................... 15

CameraCapsGroup/CameraCaps/CommandGroup/Command/ParamGroup/Param ...................... 17

AutoFocus................................................................ 20 AutoIris .................................................................... 20 BacklightComp ........................................................ 20 Brightness ................................................................ 20 Camera

configuration changes ................................... 22, 23 description document example ............................. 7 querying the camera configuration ............... 23, 25 retrieve video stream ........................................... 24 XML document description .................................. 5

CameraCapsGroup..................................................... 7 CameraCapsGroup/CameraCaps ............................... 8 CameraCapsGroup/CameraCaps/CmdParamGroup .. 8 CameraCapsGroup/CameraCaps/CmdParamGroup/

CmdParam ............................................................ 8 attributes

default ............................................................ 12 getcmd ............................................................ 11 id 9 setcmd ............................................................ 11 type ................................................................. 11

enumerations ....................................................... 12 example ............................................................... 12 ranges .................................................................. 12

CameraCapsGroup/CameraCaps/CmdParamGroup/ CmdParam/CmdParamEnumGroup .................... 12

CameraCapsGroup/CameraCaps/CmdParamGroup/ CmdParam/CmdParamEnumGroup/ CmdParamEnum ................................................. 12 attributes

cmd ................................................................. 13 standard .......................................................... 13

example of enumerated parameters ..................... 13 CameraCapsGroup/CameraCaps/CommandGroup . 14 CameraCapsGroup/CameraCaps/CommandGroup/

Command ............................................................ 14 attributes

body ............................................................... 15 controlRate ..................................................... 16 delauy ............................................................. 16

delay ............................................................... 16 id 15 mode ............................................................... 15 postfix ............................................................ 15 prefix .............................................................. 15 protocol .......................................................... 15 repeatRequest ................................................. 16

CameraCapsGroup/CameraCaps/CommandGroup/ Command/ParamGroup ...................................... 16

CameraCapsGroup/CameraCaps/CommandGroup/ Command/ParamGroup/Param ........................... 17 attributes

body ............................................................... 17 format ............................................................. 17 paramid .......................................................... 17 postfix ............................................................ 17 prefix .............................................................. 17 type ................................................................. 17

CameraCapsGroup/CameraCaps/CommandGroup/ Command/ReconnectGroup ................................ 17

CameraCapsGroup/CameraCaps/CommandGroup/ Command/ReconnectGroup/Reconnect .............. 18

Changing camera configuration .................................... 22, 23 parameters on the fly ........................................... 25 parameters that require reconnection .................. 25

Commands ................................................................. 5 getvideo................................................................. 5

Content-Length parameter ......................................... 5 Contrast.................................................................... 20 Conversion example ................................................ 19 Cookie ....................................................................... 6 Design ........................................................................ 5 Diagram notation ....................................................... 4 Examples

attribute 'cmd' ...................................................... 19 camera description document ............................... 7 CameraCapsGroup/CameraCaps/CmdParamGroup

/CmdParam .................................................... 12 CameraCapsGroup/CameraCaps/CmdParamGroup

/CmdParam/CmdParamEnumGroup/CmdParamEnum enumerated parameters ..................... 13

command to go to a PTZ preset .......................... 22 conversion from "Quality" to "Compression" ..... 19 parameters - enumerations .................................. 13 PTZ command - "InputNum" parameter ............. 21 relationship between "Standard" and "Resolution"

parameters ...................................................... 19 simplest parameters ............................................. 12 stop continuous zoom command ......................... 20 top level XML elements........................................ 8 XML document for integrating a camera .............. 6

Page 31: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 31 of 34

Exposure .................................................................. 20 Files installed with OpenCapture ............................... 4 Final testing

changing parameters on the fly ........................... 25 changing parameters that require reconnection ... 25 overview ............................................................. 24 PTZ ..................................................................... 26 querying current parameter values ...................... 25 video capturing ................................................... 25

FocusFar .................................................................. 21 FocusNear ................................................................ 21 FocusStop ................................................................ 20 FrameRate................................................................ 18 Gamma .................................................................... 20 getvideo command ..................................................... 5 Handshake rule .......................................................... 6 Hue .......................................................................... 20 InputNum ................................................................. 18 IrisClose ................................................................... 21 IrisOpen ................................................................... 21 IrisStop .................................................................... 20 JPEG image camera output ........................................ 5 MJPEG image camera output .................................... 5 MoveStop ................................................................ 20 OpenCapture

files installed ......................................................... 4 overview ............................................................... 4 purpose .................................................................. 4

OpenCapture Simulator ........................ See Simulator Overview

final testing ......................................................... 24 PanSpeed ................................................................. 20 Parameters ........................................................... 5, 18

Backlight Comp .................................................. 20 Brightness ........................................................... 20 changing on the fly ............................................. 25 changing parameters that require reconnection ... 25 Content-Length ..................................................... 5 Contrast ............................................................... 20 enumeration example .......................................... 13 Exposure ............................................................. 20 FrameRate ........................................................... 18 Gamma ................................................................ 20 Hue ...................................................................... 20 InputNum ............................................................ 18 PTZ ..................................................................... 20

AutoFocus ...................................................... 20 AutoIris .......................................................... 20 FocusFar ......................................................... 21 FocusNear ...................................................... 21 FocusStop ....................................................... 20 IrisClose ......................................................... 21 IrisOpen.......................................................... 21 IrisStop ........................................................... 20 MoveStop ....................................................... 20 PanSpeed ........................................................ 20

Preset .............................................................. 21 TiltSpeed ........................................................ 20 ZoomIn ........................................................... 21 ZoomOut ........................................................ 21 ZoomStop ....................................................... 20

Quality ................................................................ 19 querying current values ....................................... 25 resolution .............................................................. 6 Resolution ........................................................... 18 Saturation ............................................................ 20 Sharpness ............................................................ 20 simplest parameter example ................................ 12 Standard .............................................................. 18 version................................................................. 18 WhiteBalance ...................................................... 20

Preset ....................................................................... 21 PTZ

example of command to go to a PTZ preset ....... 22 example of command with and without

InputNum ....................................................... 21 final testing ......................................................... 26

Quality ..................................................................... 19 Querying

camera configuration .................................... 23, 25 current paramater values ..................................... 25

Reconnection rule ...................................................... 6 Resolution ................................................................ 18 Retrieving video stream from the camera ................ 24 Rules .......................................................................... 5

handshake ............................................................. 6 reconnection .......................................................... 6 set/query parameter ............................................... 6

Sample XML file ..................................................... 22 Saturation ................................................................. 20 Schema ...................................................................... 4

definition ........................................................... 4, 7 location ................................................................. 7

Set/query parameter rule ............................................ 6 Sharpness ................................................................. 20 Simulator ................................................................. 22

changing camera configuration ........................... 23 querying the camera configuration ............... 23, 25 retrieving video stream from the camera ............ 24

Standard ................................................................... 18 Stop continuous zoom command example .............. 20 Testing .............................................. See Final testing TiltSpeed.................................................................. 20 Version .................................................................... 18 Video capturing ....................................................... 25 Video stream ............................................................ 24 WhiteBalance .......................................................... 20 XML

camera description document ............................... 5 elements ................................................................ 4 example of document for integrating a camera ..... 6 sample Axis213.xml file ..................................... 22

Page 32: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 32 of 34

top level element example .................................... 8 XMLSPY ................................................................... 4 ZoomIn .................................................................... 21

ZoomOut.................................................................. 21 ZoomStop ................................................................ 20

Page 33: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 33 of 34

Page 34: OpenVideo - Capture: Standard€¦ · temporary parameters (parameters with name “param1” are used for this). The value of the parameter will then be embedded in all further commands

Copyright 2008 Lenel Systems International, Inc. OpenVideo - Capture Standard

Page 34 of 34


Recommended