JVC VN-E4 User Manual

4ch Network Encoder
VN-E4
API GUIDE
This document provides a description of protocols and API of VN-E4. Refer Readme file in the CD-ROM for updated information.
LST0288-001A

Custom Application Software Development Guide

o
Acquisition of JPEG from VN-E4.
Acquisition of audio from VN-E4.
Acquisition of alarm from VN-E4.
Acquiring or changing VN-E4 settings.
Multicast sending of JPEG/audio from VN-E4.
Reception of audio at VN-E4.
Control of external devices that are connected to the serial port of VN-E4.
Customization of VN-E4's built-in viewer.
Cust
2

Content

e
1. Acquiring JPEG from VN-E4 via HTTP 5
1.1. Basic Procedures .................................................................5
1.2. API Format..........................................................................6
Structure ............................................................................6
Parameter Description .......................................................6
1.3. Response .............................................................................7
When API is successfully received...................................7
When VN-E4 fails to realize the requested frame rate .....7
When the specified input channel and frame size
are not available ................................................................7
1.4. Restrictions .........................................................................8
1.5. JPEG File Format Sent Out by VN-E4 ...............................9
2. Acquiring Audio Data from VN-E4 via HTTP 10
2.1. Basic Procedures ...............................................................10
2.2. API Format........................................................................11
Structure ..........................................................................11
Parameter Description .....................................................11
2.3. Response ...........................................................................12
2.4. Restrictions .......................................................................13
3. Acquiring Alarm from VN-E4 14
3.1 Procedure ...........................................................................14
3.2. Restrictions .......................................................................15
4. Using API that Requires Basic Authentication 16
4.1. Procedure ..........................................................................16
4.2. Restrictions .......................................................................17
5. API for Acquiring/Changing Parameters of VN-E4 18
5.1. Explanatory Notes.............................................................18
5.2. Signal Input.......................................................................19
Acquiring Comment in JPEG from VN-E4 ....................19
Setting Comment in JPEG from VN-E4 .........................19
Acquiring Brightness from VN-E4 .................................19
Setting Brightness for VN-E4 .........................................20
Acquiring Contrast from VN-E4.....................................20
Setting Contrast for VN-E4.............................................20
Acquiring Saturation from VN-E4..................................20
Setting Saturation for VN-E4..........................................21
Acquiring Phase from VN-E4.........................................21
Setting Phase for VN-E4.................................................21
Acquiring Turnover from VN-E4 ...................................21
Setting Turnover for VN-E4 ...........................................22
Acquiring Echo Suppressor from VN-E4 .......................22
Setting Echo Suppressor for VN-E4 ...............................22
Acquiring Noise Suppressor from VN-E4 ......................22
Setting Noise Suppressor for VN-E4 ..............................22
5.3. JPEG Encoding .................................................................23
Acquiring JPEG Encoding On/Off from VN-E4 ............23
Setting JPEG Encoding On/Off for VN-E4 ....................23
Acquiring Frame Rate from VN-E4................................23
Setting JPEG Frame Rate for VN-E4 .............................24
Acquiring Rate Control Setting from VN-E4 .................24
Setting Rate Control for VN-E4......................................24
Acquiring File Size Setting from VN-E4........................25
Setting File Size for VN-E4 ............................................25
Acquiring Interpolation Setting from VN-E4 .................25
Setting Interpolation for VN-E4 .....................................26
5.4. Alarm Setting ....................................................................27
Acquiring Alarm On/Off Status from VN-E4.................27
Setting Alarm to Off for VN-E4 .....................................27
Acquiring JPEG Parameters Added to FTP
from VN-E4 ....................................................................27
Setting JPEG Parameters Added to FTP
from VN-E4 ....................................................................28
Acquiring Alarm Action from VN-E4 ............................28
Setting Alarm Action for VN-E4 ....................................29
Cont
Acquiring Alarm Trigger from VN-E4 ...........................30
Setting Alarm Trigger for VN-E4 ...................................30
5.5. Alarm Environment Setting ..............................................31
Acquiring SMTP Server Address Setting
from VN-E4.....................................................................31
Setting SMTP Server Address for VN-E4 ......................31
Acquiring SMTP Server Port Number Setting
from VN-E4.....................................................................31
Setting SMTP Server Port Number for VN-E4...............31
Acquiring "POP before SMTP" Setting from VN-E4.....32
Setting "POP before SMTP" for VN-E4 .........................32
Acquiring POP Server Address Setting from VN-E4 .....32
Setting POP Server Address for VN-E4 .........................32
Acquiring POP Server Port Number Setting
from VN-E4.....................................................................32
Setting POP Server Port Number for VN-E4 ..................33
Acquiring POP Server User Name Setting
from VN-E4.....................................................................33
Setting POP Server User Name for VN-E4 ....................33
Setting POP Server Password for VN-E4 .......................33
Acquiring FTP Server Address Setting from VN-E4......34
Setting FTP Server Address for VN-E4 ..........................34
Acquiring FTP Server Directory Setting from VN-E4 ...34
Setting FTP Server Directory for VN-E4........................34
Acquiring FTP Server User Name Setting
from VN-E4.....................................................................35
Setting FTP Server User Name for VN-E4 .....................35
Setting FTP Server Password for VN-E4........................35
Acquiring Chattering Guard Time Setting
of Alarm Input from VN-E4............................................35
Setting Chattering Guard Time of Alarm Input
for VN-E4........................................................................36
Acquiring Alarm Output Time Setting from VN-E4 ......36
Setting Alarm Output Time for VN-E4...........................36
Acquiring Alarm Output Status from VN-E4 .................36
Changing Alarm Output of VN-E4 .................................36
5.6. Motion Detect ...................................................................37
Acquiring Motion Detect On/Off Status from VN-E4....37
Setting Motion Detect to On/Off for VN-E4 ..................37
Acquiring Motion Detect Sensitivity from VN-E4.........37
Setting Motion Detect Sensitivity for VN-E4 .................37
Acquiring Motion Parameters of Motion Detect
from VN-E4.....................................................................38
Setting Motion Parameters of Motion Detect
for VN-E4........................................................................38
Acquiring Motion Detect Mask from VN-E4 .................38
Setting Motion Detect Mask for VN-E4 .........................39
5.7. Serial Port..........................................................................40
Acquiring Serial Port Baud Rate Setting from VN-E4 ...40
Setting Serial Port Baud Rate for VN-E4........................40
Acquiring Serial Port Data Length Setting
from VN-E4.....................................................................40
Setting Serial Port Data Length for VN-E4 ....................40
Acquiring Serial Port Parity Setting from VN-E4 ..........41
Setting Serial Port Parity for VN-E4 ...............................41
Acquiring Serial Port Stop Bit Setting from VN-E4.......41
Setting Serial Port Stop Bit for VN-E4 ...........................41
Acquiring Serial Port Comment from VN-E4.................42
Setting Serial Port Comment for VN-E4.........................42
5.8. Network Basics .................................................................43
Enabling Network Setting Changes ................................43
Acquiring DHCP Setting from VN-E4 ...........................43
Setting DHCP for VN-E4................................................43
Acquiring IP Address from VN-E4.................................43
Setting IP Address for VN-E4.........................................44
Acquiring Subnet Mask from VN-E4 .............................44
3
Content
o
Setting Subnet Mask for VN-E4 .....................................44
Acquiring Default Gateway from VN-E4 .......................44
Setting Default Gateway for VN-E4 ...............................45
Acquiring Host Name from VN-E4 ................................45
Setting Host Name for VN-E4 ........................................45
Acquiring Domain Name from VN-E4...........................45
Setting Domain Name for VN-E4...................................46
Acquiring DNS Server On/Off Status from VN-E4 .......46
Setting DNS Server Status to On/Off for VN-E4 ...........46
Acquiring DNS Server Type from VN-E4 .....................46
Setting DNS Server Type for VN-E4 .............................46
Acquiring DNS Server IP Address from VN-E4 ............47
Setting DNS Server IP Address for VN-E4 ....................47
Acquiring MAC Address from VN-E4 ...........................47
Acquiring IPv6 On/Off Status from VN-E4 ...................47
Setting IPv6 Status to On/Off for VN-E4 .......................47
Acquiring Link-local IPv6 Address from VN-E4...........48
Acquiring Site-local IPv6 Address from VN-E4 ............48
Acquiring Global IPv6 Address from VN-E4.................48
5.9. Network Details ................................................................49
Acquiring DSCP Value of Images from VN-E4 .............49
Setting DSCP Value of Images for VN-E4.....................49
Acquiring DSCP Value of Audio Data from VN-E4......49
Setting DSCP Value of Audio Data for VN-E4..............49
Acquiring MTU Value VN-E4 .......................................49
Setting MTU Value for VN-E4.......................................50
Acquiring Network Negotiation Setting from VN-E4....50
Setting Network Negotiation for VN-E4 ........................50
Acquiring PPPoE On/Off Status from VN-E4................50
Setting PPPoE Status to On/Off for VN-E4....................51
Acquiring PPPoE User Name from VN-E4 ....................51
Setting PPPoE User Name for VN-E4 ............................51
Setting PPPoE Password for VN-E4...............................51
5.10. Manual Transmission......................................................52
5.11. Access Restrictions .........................................................53
Acquiring Deny/Allow Setting of Client Restrictions
from VN-E4 ....................................................................53
Setting Client Restriction to Deny/Allow for VN-E4.....53
Acquiring IP Address Setting of Restricted Client
from VN-E4 ....................................................................53
Setting IP Address of Restricted Client for VN-E4 ........53
Acquiring Deny/Allow Setting of Audio Sender
Restrictions from VN-E4 ................................................54
Setting Audio Sender Restriction to Deny/Allow
for VN-E4 .......................................................................54
Acquiring IP Address Setting of Restricted Audio
Sender from VN-E4 ........................................................54
Setting IP Address of Audio Sender Restrictions
for VN-E4 .......................................................................54
5.12. Time ................................................................................56
Acquiring NTP Client Feature On/Off Status
from VN-E4 ....................................................................56
Setting NTP Client Feature Status to On/Off
for VN-E4 .......................................................................56
Acquiring NTP Server Address from VN-E4 .................56
Setting NTP Server Address for VN-E4 .........................56
Acquiring Access Interval to NTP Server
from VN-E4 ....................................................................56
Setting Access Interval to NTP Server for VN-E4 .........57
Acquiring Time from VN-E4..........................................57
Setting Time for VN-E4..................................................57
Acquiring Timezone from VN-E4 ..................................57
Setting Timezone for VN-E4 ..........................................58
5.13. Password .........................................................................59
Setting Password for VN-E4...........................................59
5.14. Maintenance ....................................................................60
C
Initialization ....................................................................60
Version Upgrade .............................................................60
5.15. Acquiring Status ............................................................. 61
Acquiring Sending Status ...............................................61
Acquiring Log................................................................. 62
5.16. Acquiring Settings ..........................................................63
Acquiring Model Name ..................................................63
Acquiring Firmware Revisions .......................................63
Acquiring DSP Firmware Revisions............................... 63
5.17. Others.............................................................................. 64
Restart VN-E4.................................................................64
Acquiring SNMP Agent Feature On/Off Status
from VN-E4 ....................................................................64
Setting SNMP Agent Feature Status to On/Off
for VN-E4 ....................................................................... 64
6. API for Sending JPEG/Audio from VN-E4 via UDP 65
6.1. Procedure .......................................................................... 65
6.2. List of APIs....................................................................... 66
(1) Sending JPEG from VN-E4 via RTP/UDP ............... 66
(2) Stopping JPEG/RTP/UDP Sending from VN-E4 .....67
(3) Sending Audio (u-Law) from VN-E4 via
RTP/UDP ........................................................................67
(4) Stopping Audio (u-Law) Sending from VN-E4........68
7. API for Audio Receiving by VN-E4 69
7.1. Audio Receiving via HTTP ..............................................69
7.2. Audio Receiving via RTP ................................................. 70
8. API for Controlling External Devices Connected to VN-E4 71
8.1. Control of Pelco-D Camera ..............................................71
(1) Pan Control................................................................71
(2) Tilt Control................................................................ 71
(3) Iris Control ................................................................72
(4) Focus Control ............................................................ 72
(5) Zoom Control ............................................................ 72
8.2. Control of External Devices via Pass-through ................. 73
(1) Reservation of Pass-through Feature via API ........... 73
(2) TCP Connection for Pass-through ............................74
(3) Sending Pass-through Data .......................................74
(4) Ending Pass-through .................................................74
9. List of Protocols and Port Numbers Used with VN-E4 75
10. Advanced Topics 76
11. Customizing VN-E4's Built-in Viewer 77
(1) HTML Sample .......................................................... 77
(2) Public Interface of ActiveX Control ......................... 78
4
1. Acquiring JPEG from VN-E4 via HTTP _ 1.1. Basic Procedures
q

1.1. Basic Procedures

1) The client establishes a TCP connection to port number 8009.
2) The client sends out API.
Example GET /api/video?input=1&framerate=30&framesize=vga HTTP/1.1<CRLF>
Host: 10.0.0.1<CRLF><CRLF>
Note <CRLF> denotes the line feed code (0x0A, 0x0D).
3) VN-E4 returns a response.
Example HTTP/1.1 200 OK<CRLF>
Connection: Keep-Alive<CRLF> Content-Length: 27616<CRLF> Content-Type: image/jpeg<CRLF> Date: Fri, 13 MAY 2005 07:33:12 GMT<CRLF> Server: VN-E4 Jpeg & Audio Server/1.0.0<CRLF> Keep-Alive: timeout=5, max=5<CRLF> x-vne4_response: input=1&framesize=vga&framerate=30&header=0&assured=0&sendbuffer=16<CRLF> <CRLF>
1. Ac
4) VN-E4 sends out JPEG data after returning the response.
JPEG files will be sent out continuously. Responses and JPEG data sent out by VN-E4 are as follows.
Responses
JPEG (No. 1)
JPEG (No. 2)
A 12-byte header will be added to the beginning of the JPEG file when header=1 is specified in the API parameter.
Responses
header (12-byte)
JPEG (No. 1)
header (12-byte)
JPEG (No. 2)
Details on the header structure and JPEG file format will be explained later.
5) When the client wants to stop current JPEG transmission, the client disconnects TCP8009.
VN-E4 does not accept further API via current TCP that is used for JPEG transmission. To change parameters, disconnect current TCP to stop the JPEG transmission, connect new TCP, and send API with new parameter.
5
1. Acquiring JPEG from VN-E4 via HTTP _ 1.2. API Format

1.2. API Format

Structure

GET Space API Character String Space HTTP/1.1 0x0D 0x0A
Host: Space IP Address of VN-E4 0x0D 0x0A 0x0D 0x0A
Unlike parameter acquisition/setting, Accept line is not required. Basic authentication is also not necessary.
Example GET
/api/video?input=1&framesize=vga&framerate=30&header=0&assured=0&send buffer=128 HTTP/1.1<CRLF> Host: 10.0.0.1<CRLF><CRLF>
Parameter values are indicated using =. Do not insert space before and after =. Example input=1 Parameters are segmented using &. Do not insert space before and after &. Example input=1&framesize=vga There is no need to specify all parameters. Default values will be used for parameters that are not specified.

Parameter Description

input For specifying the input video channel. For example, specify as input=4 when acquiring CH4. Specify as either
1, 2, 3 or 4.
framesize For specifying the frame size. Specify as framesize=vga when acquiring VGA and framesize=qvga when
acquiring QVGA.
framerate For specifying the frame rate. For example, specify as framerate=5 when acquiring at 5 fps. Specify as
framerate=-5 to acquire at 1/5 fps, or in other words, 1 frame in 5 seconds. Selection range is as follows.
VN-E4 and VN-E4U (NTSC)
30, 15, 10, 7.5, 6, 5, 3, 2, 1, 0, -2, -3, -5, -10, -15, -20, -30, -60
VN-E4E (PAL)
25, 12.5, 8.3, 6.25, 5, 4.1, 3, 2, 1, 0, -2, -3, -5, -10, -15, -20, -30, -60
Only 1 frame of the JPEG data will be sent when the parameter is specified as framerate=0. In this case, VN­E4 will disconnect TCP after 5 seconds if this is not disconnected by the client.
header For specifying whether to add a 12-byte header to the JPEG data. Default value is 0.
Header format is as follows. The first 4 bytes (0x00000001) indicate that the payload is a JPEG data.
0x00000001
JPEG size in bytes
Time stamp (Unit: 8 kHz)
assured VN-E4 temporarily saves up to 2.5 seconds of the compressed data. Specify as assured=0 to request for the
latest data that is temporarily saved and assured=1 to request for the oldest data. Specify as assured=0 to shorten the delay time. To acquire as many frames as possible in a network where delay fluctuates, it is recommended that this be specified as assured=1. Default value is 0.
sendbuffer Use this to increase the send buffer size. Default value is 16. Window scale will be enlarged upon increasing
the send buffer size, hence enhancing the transmission volume on networks with considerable delay. The send buffer size may be increased up to 1024. When the send buffer size has already been increased to 1024 by other clients, sendbuffer will remain as the default value even if a larger value is specified Refer to "10. Advanced Topics" on countermeasures against network delays.
6
1. Acquiring JPEG from VN-E4 via HTTP _ 1.3. Response

1.3. Response

When API is successfully received

VN-E4 will return 200 OK. Content-length indicates file size of first JPEG in bytes. The x-vne4_response line indicates current values of all parameters used for JPEG encoding.
Example HTTP/1.1 200 OK<CRLF>
Connection: Keep-Alive<CRLF> Content-Length: 27616<CRLF> Content-Type: image/jpeg<CRLF> Date: Fri, 13 MAY 2005 07:33:12 GMT<CRLF> Server: VN-E4 Jpeg & Audio Server/1.0.0<CRLF> Keep-Alive: timeout=5, max=5<CRLF> x-vne4_response: input=1&framesize=vga&framerate=30&header=0&assured=0&sendbuffer=16<CRLF> <CRLF>

When VN-E4 fails to realize the requested frame rate

Depending on the frame rate settings of VN-E4, transmission may not be possible at the frame rate requested by API. For example, when VN­E4 is set to 15 fps, transmission will only be possible at 15 fps even if the client requests for 30 fps. When VN-E4 is set to 15 fps and 10 fps is requested by the client, transmission will be carried out at 7.5 fps to enable transmission at equal time intervals. The actual transmission frame rate is stated in the x-vne4_response line.
Example HTTP/1.1 206 Partial Content<CRLF>
Connection: Keep-Alive<CRLF> Content-Length: 27616<CRLF> Content-Type: image/jpeg<CRLF> Date: Fri, 13 MAY 2005 07:33:12 GMT<CRLF> Server: VN-E4 Jpeg & Audio Server/1.0.0<CRLF> Keep-Alive: timeout=5, max=5<CRLF> x-vne4_response: input=1&framesize=vga&framerate=15&header=0&assured=0&sendbuffer=16<CRLF> <CRLF>
Frame rate encoded by VN-E4 can be changed using the web setting page or API for setting. Frame rate of data that are currently being transmitted will remain unchanged even if the frame rate to encode is increased. When the frame rate to encode is reduced, however, this value will become the upper limit of the transmission frame rate.

When the specified input channel and frame size are not available

For example, when QVGA encoding of CH4 is set to off at VN-E4, transmission will fail if the client requests for QVGA of CH4. When this occurs, VN-E4 will return an error response together with a PNG file. "Not Encoded" image is written in the PNG file.
Example HTTP/1.1 456 Header Field Not Valid for Resource<CRLF>
Connection: Keep-Alive<CRLF> Content-Length: 27616<CRLF> Content-Type: image/png<CRLF> Date: Fri, 13 MAY 2005 07:33:12 GMT<CRLF> Server: VN-E4 Jpeg & Audio Server/1.0.0<CRLF> Keep-Alive: timeout=5, max=5<CRLF><CRLF>
(This is followed by a PNG file which includes the "Not Encoded" message.)
7
1. Acquiring JPEG from VN-E4 via HTTP _ 1.4. Restrictions

1.4. Restrictions

Access restriction
VN-E4 comes with a feature that enables it to deny access from a specific IP address. If access from the IP address of the client is denied, VN-E4 will disconnect the TCP connection immediately after TCP is connected via the port number 8009.
Restriction by maximum bitrate of VN-E4
The maximum distribution capacity of VN-E4 is 40 Mbps. VN-E4 will return an error (503 Service Unavailable) when the distribution capacity is exceeded due to the API’s request. In this case, VN-E4 will disconnect TCP after 5 seconds if this is not disconnected by the client.
Number of clients
The maximum number of clients for which TCP can connect to 8009 is 10. When a connection is made to TCP8009 by an 11th client, this will be disconnected by VN-E4 immediately after the TCP connection is made.
8
1. Acquiring JPEG from VN-E4 via HTTP _

1.5. JPEG File Format Sent Out by VN-E4

1.5. JPEG File Format Sent Out by VN-E4
JPEG files sent out by VN-E4 are compliant with JFIF and consist of the following.
FFD8 Start Code
FFE0 Application Segment
FFFE Comment Segment
FFC0 SOF Frame Information
FFDB DQT Quantization Table
FFC4 DHT Huffman Table
FFDA Data Start Segment
FFD9 End Code
The following information is stored in the comment segment. Each item has a fixed length.
Item Size Example Description
Version Information 9 JVC V1.0 Indicates the version of information stored in the comment segment
File Size 18 size = 123456 The number of bytes of the JPEG file.
Width 13 width = 640 Width of JPEG.
Height 14 height = 480 Height of JPEG.
Model Name 18 type = VN-E4 Name of model that created the JPEG.
Invert Flag 12 Stores inversion
information set at VN-E4.
Time Stamp 70 timestamp =
20050214130509123JST
Alarm Information 13 alarm = 00000001 Indicates the alarm input status when the JPEG is created in a 4-byte
Camera ID 50 camera = input01 Stores camera information set at VN-E4. Character code is Shift-JIS
Motion Detect Setting 11 motion = 1 Specified as 1 when the motion detect feature is ON.
Motion Detect Result 7 md = 1 Specified as 1 if motion is detected at the time when JPEG is created.
Reserved 17
Reserved 32
Synchronization Time Stamp 26 sync_timestamp =
1FDC5A34
Video Signal Format 20 format = NTSCU Indicates the input video signal. Stated as NTSCJ for NTSC in Japan,
Input Channel 7 ch = 1 Indicates the signal source among the 4 inputs of VN-E4.
Picture Quality 9 intp = 0 Stated as 1 when this is set to field interpolation at VN-E4, and 0
Rate Control 16 size_cntl = VFS Describes the mode of rate control for JPEG. VFS (VariableFileSize),
Target Size 19 size = 23456 Target size of rate control.
Quantization Scale 14 q_scale = 45 Indicates the quantization scale. Up to 3 digits.
Firmware Version Information 12 ver = 01.00 Indicates version of the firmware that is used to create JPEG.
Item names and values, excluding the version information that does not include =, are stored in the following format.
Item names Space = Space values 0x00
Specified as reverse=1 in the case of a vertical inversion.
Indicates the time at which JPEG is created. This is made up of the year/month/day, hour/minute/second, millisecond and timezone code.
binary value. (Not ASCII code.) 4 alarm inputs are assigned to 4 bits from the LSB. For example, value is alarm = 00000001when changes occur with alarm input 1, alarm = 00000008 when changes occur with alarm input 4, and alarm = 00000009 when changes occur with alarm inputs 1 and 4.
when information is stored in Japanese.
Indicates the 8 kHz counter value in a 4-byte binary value. (Not ASCII code.) This can be used when synchronizing with audio.
and NTSCU for other NTSC formats. Stated as PAL for PAL format.
when this is set to frame processing.
AFS (AverageFileSize) or CFS (ConstantFileSize).
Defined fixed length by each item.
Example: When width=640, the 13-byte area will be written as follows.
w i d t h = 6 4 0 0x00 0x00
9
2. Acquiring Audio Data from VN-E4 via HTTP _ 2.1. Basic Procedures
q

2.1. Basic Procedures

1) The client establishes a TCP connection to port number 8009.
2) The client sends out API.
Example GET /api/audio?assured=1&lowdelay=0 HTTP/1.1<CRLF>
Host: 138.198.34.250<CRLF><CRLF>
3) VN-E4 returns a response.
Example HTTP/1.1 200 OK<CRLF>
Connection: Keep-Alive<CRLF> Content-Type: audio/ulaw<CRLF> Date: Fri, 13 MAY 2005 07:33:12 GMT<CRLF> Server: VN-E4 Jpeg & Audio Server/1.0.0<CRLF> Keep-Alive: timeout=5, max=5<CRLF> x-vne4_response: assured=0&lowdelay=0<CRLF><CRLF>
4) VN-E4 sends out audio data after returning the response.
A 512-byte u-Law data with a 12-byte header will be sent out repeatedly. Responses and u-Law data sent out by VN-E4 are as follows.
Responses
2. Ac
header (12-byte)
u-law (512-byte)
header (12-byte)
u-law (512-byte)
Format of the 12-byte header is as follows. The header is made up of 3 4-byte data. The first 4 bytes (0x00000080) indicate that the payload is an audio data.
0x00000080
No. of bytes of audio data (fixed as 512)
Time stamp (Unit: 8 kHz)
5) The client disconnects TCP8009 to end the audio transmission.
New APIs that are sent without disconnecting TCP will not be valid. To change the parameters, disconnect the current TCP to stop data distribution, followed by sending API upon establishing a new TCP connection.
10
2. Acquiring Audio Data from VN-E4 via HTTP _ 2.2. API Format

2.2. API Format

Structure

GET Space API Character String Space HTTP/1.1 0x0D 0x0A
Host: Space IP Address of VN-E4 0x0D 0x0A 0x0D 0x0A
Unlike parameter acquisition/setting, Accept line is not required. Basic authentication is also not necessary.
Example GET /api/audio?assured=1&lowdelay=0 HTTP/1.1<CRLF>
Host: 138.198.34.250<CRLF><CRLF>
Parameter values are indicated using =. Do not insert space before and after =. Example assured=1 Parameters are segmented using &. Do not insert space before and after &. Example assured=1&lowdelay=0 There is no need to specify all parameters. Default values will be used for parameters that are not specified.

Parameter Description

assured VN-E4 temporarily saves up to 2.5 seconds of the compressed data. Specify as assured=0 to request for the
latest data that is temporarily saved and assured=1 to request for the oldest data. Specify as assured=0 to shorten the audio delay time. To enable stable playback in a network where jitter occurs, it is recommended that this be specified as assured=1. Default value is 1.
lowdelay Specifying as lowdelay=1 disables the Nagle algorithm of TCP, and audio delay time will be shortened. When
lowdelay=0 is specified, the Nagle algorithm is enabled and audio delay time will be prolonged. However, transmission overhead will be enhanced. Default value is 1.
11
2. Acquiring Audio Data from VN-E4 via HTTP _ 2.3. Response

2.3. Response

Unlike JPEG acquisition, there is no Content-length. The last line indicates the actual parameters set at VN-E4.
Example HTTP/1.1 200 OK<CRLF>
Connection: Keep-Alive<CRLF> Content-Type: audio/ulaw<CRLF> Date: Fri, 13 MAY 2005 07:33:12 GMT<CRLF> Server: VN-E4 Jpeg & Audio Server/1.0.0<CRLF> Keep-Alive: timeout=5, max=5<CRLF> x-vne4_response: assured=0&lowdelay=0<CRLF><CRLF>
12
2. Acquiring Audio Data from VN-E4 via HTTP _ 2.4. Restrictions

2.4. Restrictions

Access restriction
VN-E4 comes with a feature that enables it to deny access from a specific IP address. If access from the IP address of the client is denied, VN-E4 will disconnect the TCP connection immediately after TCP is connected via the port number 8009.
Restriction by maximum bitrate of VN-E4
The maximum distribution capacity of VN-E4 is 40 Mbps. VN-E4 will return an error (503 Service Unavailable) when the distribution capacity is exceeded due to the API’s request. In this case, VN-E4 will disconnect TCP after 5 seconds if this is not disconnected by the client.
Number of clients
The maximum number of clients for which TCP can connect to 8009 is 10. When a connection is made to TCP8009 by an 11th client, this will be disconnected by VN-E4 immediately after the TCP connection is made.
13
3. Acquiring Alarm from VN-E4 _ 3.1 Procedure
q

3.1 Procedure

1) The client establishes a TCP connection to port number 32040.
2) When motion is detected from the video image of VN-E4, or when there are changes to the alarm input (make or break), VN-E4 will send out alarm information in the following format. The first 4 lines indicate the current alarm input status (make or break). The following 4 lines indicate whether motion has been detected at each of the video input channel.
peripheral.input_pin.pin(1).status=break<CRLF> peripheral.input_pin.pin(2).status=break<CRLF> peripheral.input_pin.pin(3).status=make<CRLF> peripheral.input_pin.pin(4).status=break<CRLF> video.input(1).detection(motion).status=on<CRLF> video.input(2).detection(motion).status=off<CRLF> video.input(3).detection(motion).status=off<CRLF> video.input(4).detection(motion).status=off<CRLF><CRLF>
3) The client can disconnect TCP32040 to end the alarm acquisition.
3. Ac
14
3. Acquiring Alarm from VN-E4 _ 3.2. Restrictions

3.2. Restrictions

Access restriction
VN-E4 comes with a feature that enables it to deny access from a specific IP address. If access from the IP address of the client is denied, VN-E4 will disconnect the TCP connection immediately after TCP is connected via the port number 32040.
Maximum number of clients
The maximum number of clients that may acquire alarm is 4. When a 5th client sends a SYN for TCP connection to port number 32040, VN-E4 will return an RST. Additionally, VN-E4 will also check whether the TCP connection is maintained at regular intervals. VN-E4 will disconnect the TCP connection if syn exchange is not performed in 10 minutes.
15
4. Using API that Requires Basic Authentication _ 4.1. Procedure
Basic authentication is required for APIs which are explained in Section 5. This section provides basic explanation of the uses of APIs that require basic authentication.

4.1. Procedure

1) The client establishes a TCP connection to port number 80.
2) The client sends out API via TCP.
Character strings of the following structure will be sent out.
GET Space API Character String Space HTTP/1.1 0x0D 0x0A
Accept Space text/plain or text/html 0x0D 0x0A
Host: Space IP Address of VN-E4 0x0D 0x0A
Authorization: Basic Space User Name and Password 0x0D 0x0A 0x0D 0x0A
The following is an example of API for acquiring the subnet mask of VN-E4.
Example GET /api/param?network.interface.subnetmask HTTP/1.1<CRLF>
Accept: text/palin<CRLF> Host: 10.0.0.1<CRLF> Authorization: Basic YWRtaW46dm4tZTQ=<CRLF><CRLF>
Specify the response format by Accept line. A plain text response is returned when this is specified as text/ plain. An HTML response will be returned when text/html is specified. An HTML response will be returned when Accept is not specified. Restrictions are imposed on clients via basic authentication in the case of API for acquiring/setting parameters of VN-E4. During basic authentication, user name and password shall be provided in the Authorization line. There are 3 types of user names, namely admin, operator and user. The type of user for which use is allowed is predetermined for each API. Join the user name and the password using a colon, Base64 encode this character string and enter this in the Authorization line. For example, when User name: admin Password: vn-e4 then the character string upon joining the user name and the password with a colon will be admin:vn-e4. Base64 encoding this string yields YWRtaW46dm4tZTQ=. Enter this in the Authorization line. Default passwords in the factory settings are as follows:
User Name Default Password
admin vn-e4
operator vn-e4
user vn-e4
4. Us
3) VN-E4 returns a response to the client. In the following example, current subnet mask is 255.0.0.0. In addition, 255.0.0.0 is followed by & and 200 OK, indicating that acquisition is successful.
Example HTTP/1.1 200 OK<CRLF>
Connection: Keep-Alive<CRLF> Content-Length: 80<CRLF> content-type: text/plain<CRLF> date: Fri, 13 MAY 2005 07:33:12 GMT<CRLF> server: VN-E4 API Server/1.0.0<CRLF> keep-alive: timeout=5, max=5<CRLF><CRLF> network.interface.subnetmask=255.0.0.0&200 OK<CRLF>
Note also that each of the content-type, date, server and keep-alive lines begin with a lower-case character.
4) The client can disconnect TCP80 to end the use of API.
16
4. Using API that Requires Basic Authentication _ 4.2. Restrictions

4.2. Restrictions

Access restriction
VN-E4 comes with a feature that enables it to deny access from a specific IP address. If access from the IP address of the client is denied, VN-E4 will disconnect the TCP connection immediately after TCP is connected via the port number 80.
17
5. API for Acquiring/Changing Parameters of VN-E4 _ 5.1. Explanatory Notes
P
This section provides a description of API for acquiring/changing the parameters of VN-E4. Make use of the API explained in this section in the way as mentioned in Section 4.

5.1. Explanatory Notes

(1) Acquiring parameters
Specify API in GET line according to the format below when acquiring a parameter from VN-E4.
/api/param?ParamA.ParamB.ParamC
It is possible to acquire multiple parameters at a time. Parameters are segmented using &. Do not insert space before and after &.
/api/param?ParamA.ParamB.ParamC&ParamA.ParamD.ParamE
The upper limit of this character string is 1024 bytes. The maximum number of parameters that can be acquired at a time is 5.
When acquisition is successfully completed, values will be shown in the Body of the response, followed by
returning a "&200 OK" response.
Example:
ParamA.ParamB.ParamC=Data&200 OK
When an error occurs, an error code will be returned instead of indicating a value in the Body of the response. Example:
ParamA.ParamB.ParamC&401 Unauthorized
5. A
(2) Setting parameters
When multiple acquirings are performed at one time, a response will be returned for each setting.
ParamA.ParamB.ParamC&200 OK<CRLF> ParamA.ParamB.ParamD&200 OK<CRLF>
Specify API in GET according to the format below when setting a parameter for VN-E4.
/api/param?ParamA.ParamB.ParamC=Data
Parameter values are indicated using =. Do not insert space before and after =.
It is possible to perform multiple settings at a time. Parameters are segmented using &. Do not insert space before and after &.
/api/param?ParamA.ParamB.ParamC=Data&ParamA.ParamB.ParamD=Data
The upper limit of this character string is 1024 bytes. The maximum number of parameters that can be set at a time is 5.
Response will be in the following format.
ParamA.ParamB.ParamC&200 OK
An error code will be returned when setting is not properly performed. Example:
ParamA.ParamB.ParamC&401 Unauthorized
When multiple settings are performed at one time, a response will be returned for each setting.
ParamA.ParamB.ParamC&200 OK<CRLF> ParamA.ParamB.ParamD&200 OK<CRLF>
18
5. API for Acquiring/Changing Parameters of VN-E4 _ 5.2. Signal Input

5.2. Signal Input

This API is related to signal input. This is equivalent to the feature on the Input page of the WEB setting page. Refer to the instruction manual for details on the Input page.

Acquiring Comment in JPEG from VN-E4

Format /api/param?video.input(Number).comment
Example When acquiring comment of video input channel 1
/api/param?video.input(1).comment
Example of response video.input(1).comment=input01&200 OK
Response example when setting field is left blank
Interpretation Acquire comment of the specified video input channel. This comment is stored in the JPEG header. Specify the
Allowed users admin, operator, user
video.input(1).comment=&200 OK
video input channel between the range of 1 to 4.

Setting Comment in JPEG from VN-E4

Format /api/param?video.input(Number).comment=data
Example When setting comment of video input channel 1
/api/param?video.input(1).comment=input01
Example when setting as blank
Example of response video.input(1).comment&200 OK
Interpretation Change the comment in JPEG of the specified video input channel. This comment is stored in the JPEG
/api/param?video.input(1).comment=%00
header. Specify the video input channel between the range of 1 to 4. Maximum size of comments is 40 bytes. To set as blank, specify as %00(0x25, 0x30, 0x30). To use space, specify as %20(0x25, 0x32, 0x30). If you want to set "Comment In JPEG" for example, specify as follows.
/api/param?video.input(1).comment=Comment%20In%20JPEG
Allowed users admin, operator

Acquiring Brightness from VN-E4

Format /api/param?video.input(Number).brightness
Example When acquiring Brightness of video input channel 1
/api/param?video.input(1).brightness
Example of response video.input(1).brightness=50&200 OK
Interpretation Acquire the Brightness set value of the specified video input channel. Specify the video input channel between
the range of 1 to 4. Range of Brightness is between 0 to 100. The larger the value, the brighter it will become.
Allowed users admin, operator, user
19
5. API for Acquiring/Changing Parameters of VN-E4 _ 5.2. Signal Input

Setting Brightness for VN-E4

Format /api/param?video.input(Number).brightness =data
Example When setting Brightness of video input channel 1
/api/param?video.input(1).brightness=50
Example of response video.input(1).brightness&200 OK
Interpretation Change the Brightness set value of the specified video input channel. Specify the video input channel between
the range of 1 to 4. Range of Brightness is between 0 to 100. The larger the value, the brighter it will become.
Allowed users admin, operator

Acquiring Contrast from VN-E4

Format /api/param?video.input(Number).contrast
Example When acquiring Contrast of video input channel 1
/api/param?video.input(1).contrast
Example of response video.input(1).contrast=50&200 OK
Interpretation Acquire the Contrast set value of the specified video input channel. Specify the video input channel between
the range of 1 to 4. Range of Contrast is between 0 to 100. The larger the value, the stronger will be the contrast.
Allowed users admin, operator, user

Setting Contrast for VN-E4

Format /api/param?video.input(Number).contrast=data
Example When setting Contrast of video input channel 1
/api/param?video.input(1).contrast=50
Example of response video.input(1).contrast&200 OK
Interpretation Change the Contrast set value of the specified video input channel. Specify the video input channel between
the range of 1 to 4. Range of Contrast is between 0 to 100. The larger the value, the stronger will be the contrast.
Allowed users admin, operator

Acquiring Saturation from VN-E4

Format /api/param?video.input(Number).saturation
Example When acquiring Saturation of video input channel 1
/api/param?video.input(1).saturation
Example of response video.input(1).saturation=50&200 OK
Interpretation Acquire the Saturation set value of the specified video input channel. Specify the video input channel between
the range of 1 to 4. Range of Saturation is between 0 to 100. The larger the value, the darker will be the color.
Allowed users admin, operator, user
20
5. API for Acquiring/Changing Parameters of VN-E4 _ 5.2. Signal Input

Setting Saturation for VN-E4

Format /api/param?video.input(Number).saturation=data
Example When setting Saturation of video input channel 1
/api/param?video.input(1).saturation=50
Example of response video.input(1).saturation&200 OK
Interpretation Change the Saturation set value of the specified video input channel. Specify the video input channel between
the range of 1 to 4. Range of Saturation is between 0 to 100. The larger the value, the darker will be the color.
Allowed users admin, operator

Acquiring Phase from VN-E4

Format /api/param?video.input(Number).phase
Example When acquiring Phase of video input channel 1
/api/param?video.input(1).phase
Example of response video.input(1).phase=50&200 OK
Interpretation Acquire the Phase set value of the specified video input channel. Specify the video input channel between the
range of 1 to 4. Range of Phase is between 0 to 100. -180 degrees when 0 is specified, 0 degree when 50 is specified, and +180 degrees when 100 is specified.
Allowed users admin, operator, user

Setting Phase for VN-E4

Format /api/param?video.input(Number).phase=data
Example When setting Phase of video input channel 1
/api/param?video.input(1).phase=50
Example of response video.input(1).phase&200 OK
Interpretation Change the Phase set value of the specified video input channel. Specify the video input channel between the
range of 1 to 4. Range of Phase is between 0 to 100. -180 degrees when 0 is specified, 0 degree when 50 is specified, and +180 degrees when 100 is specified.
Allowed users admin, operator

Acquiring Turnover from VN-E4

Format /api/param?video.input(Number).turnover
Example When acquiring Turnover of video input channel 1
/api/param?video.input(1).turnover
Example of response video.input(1).turnover=off&200 OK
Interpretation Acquire the Turnover set value of the specified video input channel. Turnover refers to flags that are stored in
the JPEG header. Specify the video input channel between the range of 1 to 4.
Allowed users admin, operator, user
21
5. API for Acquiring/Changing Parameters of VN-E4 _ 5.2. Signal Input

Setting Turnover for VN-E4

Format /api/param?video.input(Number).turnover=data
Example When setting Turnover of video input channel 1
/api/param?video.input(1).turnover=on
Example of response video.input(1).turnover&200 OK
Interpretation Change the Turnover set value of the specified video input channel. Turnover refers to flags that are stored in
the JPEG header. Specify the video input channel between the range of 1 to 4. Values that can be specified for Turnover are on or off.
Allowed users admin, operator, user
(Note: This item can also be set by users.)

Acquiring Echo Suppressor from VN-E4

Format /api/param?audio.input.echo_suppress
Example of response audio.input.echo_suppress=off&200 OK
Interpretation Acquire the Echo Suppressor setting of the audio input. Specify as high, mid, low or off.
Allowed users admin, operator, user

Setting Echo Suppressor for VN-E4

Format /api/param?audio.input.echo_suppress=data
Example /api/param?audio.input.echo_suppress=low
Example of response audio.input.echo_suppress&200 OK
Interpretation Change the Echo Suppressor setting of the audio input. Specify as high, mid, low or off.
Allowed users admin, operator

Acquiring Noise Suppressor from VN-E4

Format /api/param?audio.input.noise_suppress
Example of response audio.input.noise_suppress=off&200 OK
Interpretation Acquire the Noise Suppressor setting of the audio input. Specify as high, mid, low or off.
Allowed users admin, operator, user

Setting Noise Suppressor for VN-E4

Format /api/param?audio.input.noise_suppress=data
Example /api/param?audio.input.noise_suppress=low
Example of response audio.input.noise_suppress&200 OK
Interpretation Change the Noise Suppressor setting of the audio input. Specify as high, mid, low or off.
Allowed users admin, operator
22
5. API for Acquiring/Changing Parameters of VN-E4 _ 5.3. JPEG Encoding

5.3. JPEG Encoding

This API is related to JPEG encoding. This is equivalent to the feature on the Encoding page of the WEB setting page. Refer to the instruction manual for details on the Encoding page. Up to 8 types of JPEG data may be encoded according to the combination of the input channel and frame size. Specify a type from the 8 encoding numbers below when acquiring/changing settings via API.
Encoding No. Input Channel Frame Size
1 1 VGA
21QVGA
32VGA
4 2 QVGA
5 3 VGA
63QVGA
74VGA
8 4 QVGA

Acquiring JPEG Encoding On/Off from VN-E4

Format /api/param?encode(Number).status
Example When acquiring encoding on/off of Encoding No. 1
/api/param?encode(1).status
Example of response encode(1).status=on&200 OK
Interpretation Acquire the encoding on/off of the specified encoding number. Note that encoding numbers are different from
video input channels.
Allowed users admin, operator, user

Setting JPEG Encoding On/Off for VN-E4

Format /api/param?encode(Number).status=data
Example When setting encoding on/off of Encoding No. 1
/api/param?encode(1).status=off
Example of response encode(1).status&200 OK
Interpretation Change the encoding on/off of the specified encoding number. Specify as on to turn on and off to turn off. Note
that encoding numbers are different from video input channels.
Allowed users admin, operator

Acquiring Frame Rate from VN-E4

Format /api/param?encode(Number).framerate
Example When acquiring frame rate of Encoding No. 1
/api/param?encode(1).framerate
Example of response encode(1).framerate=15&200 OK
Interpretation Acquire frame rate of the specified encoding number. Note that encoding numbers are different from video
input channels.
Allowed users admin, operator, user
23
5. API for Acquiring/Changing Parameters of VN-E4 _ 5.3. JPEG Encoding

Setting JPEG Frame Rate for VN-E4

Format /api/param?encode(Number).framerate=data
Example When setting frame rate of Encoding No. 1
/api/param?encode(1).framerate=30
Example of response encode(1).framerate&200 OK
Interpretation Change frame rate of the specified encoding number. Note that encoding numbers are different from video
input channels. Frame rate can be set to 30, 15, 10, 7.5, 6, 5, 3, 2 or 1 in the case of VN-E4 and VN-E4U (NTSC). Frame rate can be set to 25, 12.5, 8, 6, 5, 4, 3, 2 or 1 in the case of VN-E4E (PAL).
Allowed users admin, operator

Acquiring Rate Control Setting from VN-E4

Format /api/param?encode(Number).cbr_mode
Example When acquiring rate control setting of Encoding No. 1
/api/param?encode(1).cbr_mode
Example of response encode(1).cbr_mode=afs&200 OK
Interpretation Acquire the rate control setting of the specified encoding number. Note that encoding numbers are different
from video input channels. Quantization table is fixed in the case of vfs (VariableFileSize). In the case of afs (AverageFileSize), bit rates are controlled such that the average size of multiple files remains constant. For cfs (ConstantFileSize), bit rates are controlled such that the size of each file remains constant. Upon setting to afs or vfs, the rate control processing load will increase and the maximum frame rate that can be realized will drop.
Allowed users admin, operator, user

Setting Rate Control for VN-E4

Format /api/param?encode(Number).cbr_mode=data
Example When setting rate control of Encoding No. 1
/api/param?encode(1).cbr_mode=vfs
Example of response encode(1).cbr_mode&200 OK
Interpretation Change rate control of the specified encoding number. Note that encoding numbers are different from video
input channels. Rate control can be set to vfs, afs, or cfs. In vfs (VariableFileSize), quantization table is fixed. In afs (AverageFileSize), average file size of multiple JPEGs is controlled to be constant. In cfs (ConstanFileSize), each file size is controlled to be constant. In cfs mode, maximum frame rate becomes a quater of the maximum frame rate of vfs/afs.
Allowed users admin, operator
24
Loading...
+ 56 hidden pages