100% found this document useful (1 vote)
11K views

Dahua HTTP API v2.63

This document provides recommendations for improving cybersecurity, including changing passwords regularly, updating firmware, enabling encryption and access controls, limiting guest accounts, disabling unused features, and physically securing devices. It also recommends isolating security networks and monitoring logs to detect unauthorized access.

Uploaded by

Wizzbit gxs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
11K views

Dahua HTTP API v2.63

This document provides recommendations for improving cybersecurity, including changing passwords regularly, updating firmware, enabling encryption and access controls, limiting guest accounts, disabling unused features, and physically securing devices. It also recommends isolating security networks and monitoring logs to detect unauthorized access.

Uploaded by

Wizzbit gxs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 301

Da

hu

API of HTTP Protocol Specification


a
HT
TP
AP
I
fo
r
We
st
Eu
ro
pe
Te
c
hn
ic
a
l

V2.63
2018-12-04
Cybersecurity Recommendations
Mandatory actions to be taken towards cybersecurity
1. Change Passwords and Use Strong Passwords:
The number one reason systems get "hacked" is due to having weak or default passwords. It is
recommended to change default passwords immediately and choose a strong password whenever
possible. A strong password should be made up of at least 8 characters and a combination of special
characters, numbers, and upper and lower case letters.
2. Update Firmware
Da

As is standard procedure in the tech-industry, we recommend keeping NVR, DVR, and IP camera
hu

firmware up-to-date to ensure the system is current with the latest security patches and fixes.
a

"Nice to have" recommendations to improve your network security


HT

1. Change Passwords Regularly


TP

Regularly change the credentials to your devices to help ensure that only authorized users are able to
access the system.
AP

2. Change Default HTTP and TCP Ports:


I

● Change default HTTP and TCP ports for systems. These are the two ports used to communicate and
fo

to view video feeds remotely.


r

● These ports can be changed to any set of numbers between 1025-65535. Avoiding the default ports
We

reduces the risk of outsiders being able to guess which ports you are using.
st

3. Enable HTTPS/SSL:
Set up an SSL Certificate to enable HTTPS. This will encrypt all communication between your devices
Eu

and recorder.
ro

4. Enable IP Filter:
pe

Enabling your IP filter will prevent everyone, except those with specified IP addresses, from accessing
the system.
Te

5. Change ONVIF Password:


c

On older IP Camera firmware, the ONVIF password does not change when you change the system's
hn

credentials. You will need to either update the camera's firmware to the latest revision or manually
ic

change the ONVIF password.


a

6. Forward Only Ports You Need:


l

● Only forward the HTTP and TCP ports that you need to use. Do not forward a huge range of numbers
to the device. Do not DMZ the device's IP address.
● You do not need to forward any ports for individual cameras if they are all connected to a recorder on
site; just the NVR is needed.
7. Limit Features of Guest Accounts:
If your system is set up for multiple users, ensure that each user only has rights to features and functions
they need to use to perform their job.
8. UPnP:

Cybersecurity Recommendations I
● UPnP will automatically try to forward ports in your router or modem. Normally this would be a good
thing. However, if your system automatically forwards the ports and you leave the credentials defaulted,
you may end up with unwanted visitors.
● If you manually forwarded the HTTP and TCP ports in your router/modem, this feature should be
turned off regardless. Disabling UPnP is recommended when the function is not used in real
applications.
9. SNMP:
Disable SNMP if you are not using it. If you are using SNMP, you should do so only temporarily, for
tracing and testing purposes only.
10. Multicast:
Multicast is used to share video streams between two recorders. Currently there are no known issues
involving Multicast, but if you are not using this feature, deactivation can enhance your network security.
Da

11. Check the Log:


hu

If you suspect that someone has gained unauthorized access to your system, you can check the system
log. The system log will show you which IP addresses were used to login to your system and what was
a

accessed.
HT

12. Physically Lock Down the Device:


TP

Ideally, you want to prevent any unauthorized physical access to your system. The best way to achieve
this is to install the recorder in a lockbox, locking server rack, or in a room that is behind a lock and key.
AP

13. Connect IP Cameras to the PoE Ports on the Back of an NVR:


I

Cameras connected to the PoE ports on the back of an NVR are isolated from the outside world and
fo

cannot be accessed directly.


r

14. Isolate NVR and IP Camera Network


We

The network your NVR and IP camera resides on should not be the same network as your public
st

computer network. This will prevent any visitors or unwanted guests from getting access to the same
network the security system needs in order to function properly.
Eu
ro
pe
Te
c hn
ic
a l

Cybersecurity Recommendations II
Foreword

Purpose

Welcome to use API of HTTP protocol specification.

Reader

 API software development engineers


Da

 Project managers
hu

 Product managers
a

Safety Instructions
HT
TP

The following categorized signal words with defined meaning might appear in the Manual.
AP

Signal Words Meaning


I

Indicates a high potential hazard which, if not avoided, will result


fo

DANGER in death or serious injury.


r

Indicates a medium or low potential hazard which, if not avoided,


We

WARNING could result in slight or moderate injury.


st

Indicates a potential risk which, if not avoided, could result in


Eu

property damage, data loss, lower performance, or unpredictable


CAUTION
ro

result.
pe

TIPS Provides methods to help you solve a problem or save you time.
Te

Provides additional information as the emphasis and supplement


NOTE
c

to the text.
hn
ic

Revision History
a l

No. Version Revision Content Release Time


1 V2.40 Based on the old version. August 8, 2018

2 V2.60 Add find media file with TrafficCar info. September 12, 2018

3 V2.61 Add the "16 AI APIs" chapter. October 24, 2018


4 V2.62 Add find media files with NonMotor info November 06, 2018
Add close door and access control custom
5 V2.63 November 27, 2018
password

Privacy Protection Notice

Foreword III
As the device user or data controller, you might collect personal data of other such as face,
fingerprints, car plate number, Email address, phone number, GPS and so on. You need to be
in compliance with the local privacy protection laws and regulations to protect the legitimate
rights and interests of other people by implementing measures include but not limited to:
providing clear and visible identification to inform data subject the existence of surveillance
area and providing related contact.

About the Manual

 The Manual is for reference only. If there is inconsistency between the Manual and the
actual product, the actual product shall prevail.
 We are not liable for any loss caused by the operations that do not comply with the Manual.
 The Manual would be updated according to the latest laws and regulations of related
Da

regions. For detailed information, see the paper manual, CD-ROM, QR code or our official
hu

website. If there is inconsistency between paper manual and the electronic version, the
electronic version shall prevail.
a

 All the designs and software are subject to change without prior written notice. The product
HT

updates might cause some differences between the actual product and the Manual. Please
TP

contact the customer service for the latest program and supplementary documentation.
 There still might be deviation in technical data, functions and operations description, or
AP

errors in print. If there is any doubt or dispute, please refer to our final explanation.
I

 Upgrade the reader software or try other mainstream reader software if the Manual (in PDF
fo

format) cannot be opened.


r

 All trademarks, registered trademarks and the company names in the Manual are the
We

properties of their respective owners.


 Please visit our website, contact the supplier or customer service if there is any problem
st

occurred when using the device.


Eu

 If there is any uncertainty or controversy, please refer to our final explanation.


ro
pe
Te
c hn
ic
a l

Foreword IV
Table of Contents
Cybersecurity Recommendations ........................................................................................................... I
Foreword .................................................................................................................................................. III
1 Overview................................................................................................................................................. 1
2 References........................................................................................................................................... 2
3 Definitions ........................................................................................................................................... 3
3.1 Abbreviations................................................................................................................................. 3
3.2 Syntax Convention ........................................................................................................................ 3
Da

3.3 API Request Format...................................................................................................................... 3


hu

3.4 Server Response Format .............................................................................................................. 4


3.5 Authentication................................................................................................................................ 5
a

4 General APIs........................................................................................................................................ 7
HT

4.1 APIs of RTSP ................................................................................................................................ 7


TP

4.1.1 Get Real-Time Stream ........................................................................................................ 7


4.1.2 Get Playback Stream .......................................................................................................... 7
AP

4.1.3 Get File Stream ................................................................................................................... 7


I

4.2 Get MJPG Stream ......................................................................................................................... 8


fo

4.3 Audio ............................................................................................................................................. 8


r

4.3.1 Get Audio Input Channel Numbers..................................................................................... 8


We

4.3.2 Get Audio Output Channel Numbers .................................................................................. 9


4.3.3 Post Audio Stream .............................................................................................................. 9
st

4.3.4 Get Audio Stream.............................................................................................................. 10


Eu

4.4 Snapshot ......................................................................................................................................11


4.4.1 Snap...................................................................................................................................11
ro

4.4.2 Get a Snapshot ................................................................................................................. 13


pe

4.4.3 Subscribe to Snapshot ..................................................................................................... 13


4.5 Video Attributes ........................................................................................................................... 14
Te

4.5.1 Get Max Extra Stream Numbers ...................................................................................... 14


c hn

4.5.2 Video Color Config............................................................................................................ 15


ic

4.5.3 Get Encode Capability ...................................................................................................... 16


4.5.4 Get Encode Config Capability .......................................................................................... 16
a l

4.5.5 Encode of Media ............................................................................................................... 19


4.5.6 Encode of Region Interested ............................................................................................ 24
4.5.7 Channel Title ..................................................................................................................... 25
4.5.8 Get Video Input Channels Device Supported .................................................................. 25
4.5.9 Get Video Output Channels Device Supported................................................................ 26
4.5.10 Get Max Remote Input Channels ................................................................................... 26
4.5.11 Video Standard................................................................................................................ 26
4.5.12 Video Widget................................................................................................................... 27
4.5.13 Get Video Input Capability .............................................................................................. 30
4.5.14 Adjust Focus ................................................................................................................... 33
4.5.15 Adjust Focus Continuously ............................................................................................. 33

Table of Contents V
4.5.16 Auto Focus ...................................................................................................................... 34
4.5.17 Get Focus Status ............................................................................................................ 34
4.5.18 Get Coordinates of Current Window .............................................................................. 34
4.5.19 Set Coordinates of Current Window ............................................................................... 35
4.5.20 Video in Options ............................................................................................................. 35
4.5.21 Video Out ........................................................................................................................ 44
4.5.22 Smart Code ..................................................................................................................... 45
4.6 System ........................................................................................................................................ 46
4.6.1 General ............................................................................................................................. 46
4.6.2 Get Current Time .............................................................................................................. 47
4.6.3 Set Current Time............................................................................................................... 47
4.6.4 Locales.............................................................................................................................. 47
4.6.5 Get Language Capability .................................................................................................. 49
Da

4.6.6 Language .......................................................................................................................... 50


hu

4.6.7 Get Client Access Filter .................................................................................................... 50


4.6.8 Auto Maintain .................................................................................................................... 51
a

4.6.9 Holiday Management ........................................................................................................ 52


HT

4.6.10 Get Device Type ............................................................................................................. 53


TP

4.6.11 Get Hardware Version..................................................................................................... 53


4.6.12 Get Serial Number of Device .......................................................................................... 54
AP

4.6.13 Get Machine Name ......................................................................................................... 54


I

4.6.14 Get System Information .................................................................................................. 54


fo

4.6.15 Get Vendor Information .................................................................................................. 54


r

4.6.16 Get Software Information................................................................................................ 55


We

4.6.17 Get Version of Onvif ....................................................................................................... 55


4.6.18 Get Version of HTTP API ................................................................................................ 55
st

4.6.19 Get Device Class ............................................................................................................ 55


Eu

4.6.20 Onvif Service Authorization ............................................................................................ 56


4.6.21 Backup of Config ............................................................................................................ 56
ro

4.6.22 Restore the Config .......................................................................................................... 57


pe

4.6.23 Restore except the Config .............................................................................................. 57


Te

4.6.24 Reboot ............................................................................................................................ 57


4.6.25 Shutdown ........................................................................................................................ 57
c hn

4.6.26 FactoryReset .................................................................................................................. 58


ic

4.6.27 Get Tracing Code of Device ........................................................................................... 58


4.7 Network ....................................................................................................................................... 58
a l

4.7.1 Get Network Interfaces ..................................................................................................... 58


4.7.2 Network Basic Config ....................................................................................................... 59
4.7.3 PPPoE .............................................................................................................................. 60
4.7.4 DDNS ................................................................................................................................ 61
4.7.5 Email ................................................................................................................................. 62
4.7.6 WLan................................................................................................................................. 64
4.7.7 Scan Wlan Devices........................................................................................................... 65
4.7.8 UPnP................................................................................................................................. 65
4.7.9 Get UPnP Status ............................................................................................................... 66
4.7.10 NTP ................................................................................................................................. 67
4.7.11 RTSP ............................................................................................................................... 67

Table of Contents VI
4.7.12 Alarm Server ................................................................................................................... 68
4.8 Motion Detection ......................................................................................................................... 69
4.8.1 Motion Detection Settings................................................................................................. 69
4.9 Event ........................................................................................................................................... 74
4.9.1 Event Handler ................................................................................................................... 74
4.9.2 Alarm Event ...................................................................................................................... 78
4.9.3 Alarm Out .......................................................................................................................... 79
4.9.4 Get Alarm Input Channels ................................................................................................ 80
4.9.5 Get Alarm Output Channels.............................................................................................. 80
4.9.6 Get States of Alarm Input Channels ................................................................................. 80
4.9.7 Get States of Alarm Output Channels .............................................................................. 81
4.9.8 Video Blind Event ............................................................................................................. 81
4.9.9 Video Loss Event .............................................................................................................. 82
Da

4.9.10 Login Failure Event ......................................................................................................... 83


hu

4.9.11 Storage Not Exist Event .................................................................................................. 83


4.9.12 Storage Access Failure Event ........................................................................................ 84
a

4.9.13 Storage Low Space Event .............................................................................................. 85


HT

4.9.14 Net Abort Event............................................................................................................... 85


TP

4.9.15 IP Conflict Event ............................................................................................................. 86


4.9.16 Get Channels Event Happened...................................................................................... 87
AP

4.9.17 Subscribe to Event Message .......................................................................................... 87


I

4.9.18 Get Capability of Event Management............................................................................. 94


fo

4.9.19 NetAlarm ......................................................................................................................... 95


r

4.9.20 GetSupportedEvents ...................................................................................................... 95


We

4.10 PTZ............................................................................................................................................ 95
4.10.1 PTZ Config ...................................................................................................................... 95
st

4.10.2 Get PTZ Protocol List ..................................................................................................... 97


Eu

4.10.3 Get PTZ Capability of Current Protocol .......................................................................... 97


4.10.4 Get PTZ Status ............................................................................................................... 98
ro

4.10.5 PTZ Control .................................................................................................................... 99


pe

4.10.6 Preset............................................................................................................................ 102


Te

4.10.7 Tour ............................................................................................................................... 103


4.10.8 Scan .............................................................................................................................. 105
c hn

4.10.9 Pattern .......................................................................................................................... 106


ic

4.10.10 Pan.............................................................................................................................. 107


4.10.11 PTZ Auto Movement ................................................................................................... 108
a l

4.10.12 PTZ Restart ................................................................................................................ 109


4.10.13 PTZ Reset....................................................................................................................110
4.10.14 OSD Menu ...................................................................................................................110
4.11 Record ...................................................................................................................................... 111
4.11.1 Get Capability of Recording ........................................................................................... 111
4.11.2 Record Config ................................................................................................................112
4.11.3 Record Mode..................................................................................................................113
4.11.4 Media Global ..................................................................................................................114
4.11.5 Find Media Files.............................................................................................................114
4.11.6 Find media files with FaceDetection info .......................................................................117
4.11.7 Find media files with FaceRecognition info ...................................................................119

Table of Contents VII


4.11.8 Find media files with HumanTrait info........................................................................... 123
4.11.9 Find media files with TrafficCar info .............................................................................. 126
4.11.10 Find media files with IVS info...................................................................................... 129
4.11.11 Find media files with NonMotor info ............................................................................ 131
4.11.12 Download Media File with the File Name ................................................................... 133
4.11.13 Download Media File between Times ......................................................................... 134
4.12 User management .................................................................................................................. 134
4.12.1 Get Information of a Particular User ............................................................................. 134
4.12.2 Get Information of All Users.......................................................................................... 135
4.12.3 Get Information of All Active Users ............................................................................... 135
4.12.4 Get Information of a Particular Group .......................................................................... 135
4.12.5 Get Information of All Groups ....................................................................................... 136
4.12.6 Add a New User ............................................................................................................ 136
Da

4.12.7 Delete a User ................................................................................................................ 136


hu

4.12.8 Modify User Information ............................................................................................... 137


4.12.9 Modify User's Password ............................................................................................... 137
a

4.13 Log .......................................................................................................................................... 137


HT

4.13.1 Find Logs ...................................................................................................................... 137


TP

4.13.2 Clear All the Logs.......................................................................................................... 139


4.13.3 Backup Logs ................................................................................................................. 139
AP

4.14 Upgrader ................................................................................................................................. 140


I

4.14.1 Strat to Upgrade............................................................................................................ 140


fo

4.14.2 Get Upgrade State ........................................................................................................ 140


r

5 SD Camera APIs ................................................................................................................................ 141


We

5.1 Video Attributes ......................................................................................................................... 141


5.1.1 Video in Focus ................................................................................................................ 141
st

5.1.2 Video in Zoom ................................................................................................................. 142


Eu

5.1.3 Video in Sharpness......................................................................................................... 143


5.1.4 Video in Mode ................................................................................................................. 144
ro

5.1.5 Video in Day Night Mode Shift........................................................................................ 146


pe

5.1.6 Lighting ........................................................................................................................... 147


Te

5.2 Wiper ......................................................................................................................................... 149


5.2.1 Move Continuously ......................................................................................................... 149
c hn

5.2.2 Stop Move ....................................................................................................................... 149


ic

5.2.3 Move Once...................................................................................................................... 149


6 Storage APIs ...................................................................................................................................... 150
a l

6.1 Storage Devices ........................................................................................................................ 150


6.1.1 Get Hard Disk Information .............................................................................................. 150
6.1.2 Get All the Names of Storage Devices ........................................................................... 150
6.1.3 Get Storage Device Information ..................................................................................... 150
6.1.4 Get Storage Capability .................................................................................................... 151
6.1.5 Format Camera SD-Card ............................................................................................... 151
6.2 NAS ........................................................................................................................................... 151
6.2.1 NAS Information ............................................................................................................. 151
6.3 Storage Point............................................................................................................................. 152
6.3.1 Record Storage Point ..................................................................................................... 152
6.3.2 Storage Group ................................................................................................................ 154

Table of Contents VIII


6.4 SDEncrypt ................................................................................................................................. 155
6.4.1 Encrypt SD Card ............................................................................................................. 155
6.4.2 Decrypt SD Card............................................................................................................. 155
6.4.3 Clear SD Card Password ............................................................................................... 156
6.4.4 Modify SD Card Password ............................................................................................. 156
6.4.5 Get SD Card Operate Error Policy ................................................................................. 156
6.4.6 Storage Health Alarm Settings ....................................................................................... 157
7 Display APIs ..................................................................................................................................... 158
7.1 GUI ............................................................................................................................................ 158
7.1.1 GUISet ............................................................................................................................ 158
7.2 Split Screen ............................................................................................................................... 159
7.2.1 Split Screen Mode........................................................................................................... 159
7.3 Moniter Tour .............................................................................................................................. 160
Da

7.3.1 Moniter Tour .................................................................................................................... 160


hu

7.3.2 Enable Tour ..................................................................................................................... 161


7.3.3 Monitor Collection ........................................................................................................... 161
a

8 Video Analyse APIs ........................................................................................................................... 163


HT

8.1 Video Analyse ........................................................................................................................... 163


TP

8.1.1 Get Video Analyse Capability ......................................................................................... 163


8.1.2 Video Analyse Global...................................................................................................... 164
AP

8.1.3 Video Analyse Rule......................................................................................................... 165


I

8.2 Number of People ..................................................................................................................... 167


fo

8.2.1 Video Widget Number Status ......................................................................................... 167


r

8.2.2 Get Heat MapInformation ............................................................................................... 168


We

8.3 FishEye ..................................................................................................................................... 169


8.3.1 Get FishEye Capability ................................................................................................... 169
st

8.3.2 FishEye Setting............................................................................................................... 170


Eu

8.4 CrowdDistriMap......................................................................................................................... 170


8.4.1 Get Channel Caps .......................................................................................................... 170
ro

8.4.2 Subscribe to Realtime Crowd Stat.................................................................................. 171


pe

8.4.3 Get Current Crowd Stat .................................................................................................. 172


Te

9 Intelligent Traffic APIs ....................................................................................................................... 174


9.1 Traffic Snap ............................................................................................................................... 174
c hn

9.1.1 Get the Specific Parking Space Status ........................................................................... 174


ic

9.1.2 Open Strobe.................................................................................................................... 174


9.1.3 Open/Close Unlicensed Vehicle Detection..................................................................... 175
a l

9.1.4 Snap................................................................................................................................ 175


9.2 Traffic Parking ........................................................................................................................... 176
9.2.1 Get All Status of Parking Spaces .................................................................................... 176
9.2.2 Parking Space Light State .............................................................................................. 176
9.2.3 Set Order State ............................................................................................................... 178
9.2.4 Set Light State ................................................................................................................ 178
9.2.5 [Config] Parking Space Access Filter Setting ................................................................. 178
9.2.6 Set OverLine State.......................................................................................................... 179
9.3 Traffic Record Import Export ..................................................................................................... 180
9.3.1 Traffic BlackList............................................................................................................... 180
9.3.2 Traffic Flow...................................................................................................................... 180

Table of Contents IX
10 Thermography and Radiometry APIs ............................................................................................ 182
10.1 Thermography Manager ......................................................................................................... 182
10.1.1 Get Capability of Thermography................................................................................... 182
10.1.2 Thermography Options ................................................................................................. 183
10.1.3 Get ExternSystem Information ..................................................................................... 185
10.1.4 Get Information of Preset Mode ................................................................................... 185
10.1.5 Get Optimized Region Information ............................................................................... 186
10.1.6 Enable Shutter .............................................................................................................. 186
10.1.7 Fix Focus ...................................................................................................................... 187
10.1.8 Do Flat Field Correction................................................................................................ 187
10.2 Radiometry .............................................................................................................................. 187
10.2.1 Get Capability of Radiometry........................................................................................ 187
10.2.2 Heat Image Thermometry............................................................................................. 188
Da

10.2.3 Thermometry Rule ........................................................................................................ 190


hu

10.2.4 Heat Image Temper Event ............................................................................................ 192


10.2.5 Get Temperature of Particular Point ............................................................................. 193
a

10.2.6 Get Temperature of Particular Condition ...................................................................... 193


HT

10.2.7 Query Temperature Information.................................................................................... 194


TP

10.2.8 Subscribe to Temperature Information ......................................................................... 195


10.2.9 Subscribe to Radiometry Data...................................................................................... 196
AP

10.2.10 To Fetch Radiometry Data .......................................................................................... 197


I

10.2.11 Get FireWarning Config .............................................................................................. 197


fo

10.2.12 Set FireWarning Config .............................................................................................. 198


r

10.2.13 Get FireWarningMode Config ..................................................................................... 198


We

10.2.14 Set FireWarningMode Config ..................................................................................... 199


11 Access Control APIs ...................................................................................................................... 200
st

11.1 Door ......................................................................................................................................... 200


Eu

11.1.1 Open Door..................................................................................................................... 200


11.1.2 Get Door Status ............................................................................................................ 200
ro

12 Intelligent Building APIs ................................................................................................................. 207


pe

12.1 Video Talk ................................................................................................................................ 207


Te

12.1.1 Subscribe Video Talk Status ......................................................................................... 207


12.1.2 Unsubscribe Video Talk Status ..................................................................................... 207
c hn

12.1.3 Invite Server on Video Talk ........................................................................................... 208


ic

12.1.4 Cancel the Video Talk ................................................................................................... 208


12.1.5 Answer the Invitation..................................................................................................... 208
a l

12.1.6 Refuse to Answer the Video Talk Invitation .................................................................. 209


12.1.7 Hang Up ........................................................................................................................ 209
12.2 Video Talk Log......................................................................................................................... 209
12.2.1 Query Video Talk Log ................................................................................................... 209
12.3 Announcement Record ........................................................................................................... 210
12.3.1 Insert Record ................................................................................................................ 210
12.4 Alarm Record .......................................................................................................................... 210
12.4.1 Query Alarm Record ..................................................................................................... 210
13 DVR Custom APIs............................................................................................................................ 212
13.1 File Finder ............................................................................................................................... 212
13.1.1 Create a File Finder ...................................................................................................... 212

Table of Contents X
13.1.2 Create a Motion File Finder .......................................................................................... 213
13.1.3 Get the File Information Found by the Finder .............................................................. 214
13.1.4 Stop the Finder ............................................................................................................. 214
13.1.5 Get Bound Files ............................................................................................................ 215
13.2 BandLimit ................................................................................................................................ 215
13.2.1 Get Bandwidth Limit State ............................................................................................ 215
13.3 Record Files Protection........................................................................................................... 216
13.3.1 Add Protection .............................................................................................................. 216
13.3.2 Cancel Protection ......................................................................................................... 216
13.3.3 Remove Protection ....................................................................................................... 217
13.4 Get Daylight ............................................................................................................................ 217
14 Comm .............................................................................................................................................. 218
14.1 Coaxial Control IO................................................................................................................... 218
Da

14.1.1 Control White Light or Speaker .................................................................................... 218


hu

14.2 Pir Alarm .................................................................................................................................. 218


14.2.1 Configure Pir Parameter ............................................................................................... 218
a

15 Other APIs ...................................................................................................................................... 223


HT

15.1 Discover Devices .................................................................................................................... 223


TP

15.1.1 Discover Devices on Internet........................................................................................ 223


15.2 Flashlight ................................................................................................................................. 223
AP

15.2.1 Flashlight Config ........................................................................................................... 223


I

15.3 Open Platform ......................................................................................................................... 225


fo

15.3.1 Application Start and Stop............................................................................................. 225


r

16 AI APIs .............................................................................................................................................. 226


We

16.1 Video Analyse APIs ................................................................................................................. 226


16.1.1 People Counting ........................................................................................................... 226
st

16.1.2 FaceRecognitionServer ................................................................................................ 233


Eu

16.1.3 Video Analyse Event ..................................................................................................... 255


16.2 Intelligent Traffic APIs ............................................................................................................. 261
ro

16.2.1 Traffic Record ............................................................................................................... 261


pe

16.2.2 Intelligent Traffic Event ................................................................................................. 264


Te

16.2.3 Traffic Flow.................................................................................................................... 269


16.3 Access Control APIs................................................................................................................ 271
c hn

16.3.1 Access User .................................................................................................................. 271


ic

16.3.2 Access control............................................................................................................... 286


a l

Table of Contents XI
1 Overview
This document specifies the HTTP-based application programming interface of video products.
The HTTP-based interface provides the functionality for requesting snapshot and media stream,
controlling camera functions (for example, PTZ and focus), and getting and setting internal
parameter values.
The video products serve as a server. The client sends requests to server, and then server
handles requests and returns resources accordingly.
Da
hu
a
HT
TP
AP
I
fo
r
We
st
Eu
ro
pe
Te
c hn
ic
a l

Overview 1
[1].RFC 2616 Hypertext Transfer Protocol-HTTP/1.1
2 References

[2].RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax and Semantics
[3].RFC 2617 HTTP Authentication: Basic and Digest Access Authentication
[4].RFC 3986: Uniform Resource Identifiers (URI) Generic Syntax
Da
hu
a
HT
TP
AP
I
fo
r
We
st
Eu
ro
pe
Te
c hn
ic
a l

References 2
3 Definitions
3.1 Abbreviations
The following abbreviations are used throughout this document.
Application Programming Interface. In the document, it especially presents
API
application programming interface of video products.

3.2 Syntax Convention


Da

 In URL syntax and in descriptions of API parameters, text in italic within angle brackets
hu

denotes content that should be replaced with either a value or a string. When replacing the
a

text string, the angle brackets must also be replaced. For example, <server> in URL syntax
HT

is replaced with the IP number of server, e.g., 192.168.1.108.


TP

 String shown in bold face denotes a brief explanatory note of the string close to it.
 Name-value pair in square brackets denotes content that is optional. For example,
AP

"http ://<server>/cgi-bin/snapshot.cgi[?channel=1]" can be like this


"http ://<server>/cgi-bin/snapshot.cgi".
I

 The API syntax must follow the standard of URI. (RFC 3986: Uniform Resource Identifiers
fo

(URI) Generic Syntax); that is, spaces and other reserved characters (e.g, ":", "/", "?", "@",
r

";", "=", "+", ",", "$", "&") within a name-value pair should be replaced with %< ASCII hex>.
We

For example, the blank should be replaced with %20.


st

 To describe the range of a variable, we use some symbols such as "[]" and "{}". For
example, "[0-100]" denotes an integer not less than 0 and not larger than 100. "{0, 1, 2, 3}"
Eu

denotes the valid value of an integer among 0, 1, 2 and 3.


ro

 "[]" following a string denotes an array. The index is an integer and starts from 0. For
pe

example, "Snap[channel] " may be "Snap[0] ".


 The variable may be different types: string, integer, bool or float. Integer is 32 bits. The
Te

range of bool is "true" and "false."


c

 "R/O"in parameters means this parameter is required or not, "R"means required,


hn

"O"means optional.
ic
a

3.3 API Request Format


l

This section defines the syntax and semantics for APIs.

<protocol> ://<server><abs_path> [?query]

protocol: URL scheme for the particular request. The http and https protocols are both
supported in this specification. So "http", as most of the APIs' default protocol except several
RTSP APIs, can be replaced by "https".
server: Server could be "hostname[: port] ". The hostname can be IP address or the fully
qualified domain name of an IP device. The port is the port number of server listening for TCP
connections. If the port is not given, the default port is assumed. For HTTP, the default port is
80. For HTTPS, the default port is 443.

Definitions 3
abs_path: The Request-URI for the resources is abs_path. The abs_path in this specification is
most often of the form "/cgi-bin/*.cgi".
query: The query field is a string of information to be interpreted by the resource. It consists of
resource-related parameters. And it must be listed in name-value pair syntax
(p1=v1&p2=v2&…&pn=vn).
For example: http://192.168.1.108/cgi-bin/snapshot.cgi?channel=1

3.4 Server Response Format


The server uses the standard HTTP status codes.
Return:
HTTP/1.1 <HTTP code> <HTTP text>\r\n
Da

With the following HTTP code and meanings


hu

Table 3-1
a

HTTP code HTTP text Description


HT

The request has succeeded. The requested


200 OK
resource will be returned in the HTTP text.
TP

The request had bad syntax or was inherently


400 Bad Request
AP

impossible to be satisfied.
I

The request requires user authentication or the


401 Unauthorized
authorization has been refused.
fo

The user does not have the right to access the


r

403 Forbidden
service.
We

The server has not found anything matching the


404 Not Found
st

request.
The server encountered an unexpected condition
Eu

500 Internal Server Error


that prevented it from fulfilling the request.
ro

501 Not Implemented The server has not implemented the service.
pe

If the HTTP code is 200, means the API execute success, and the response data in http body
( maybe multipart ) can be a multiline key=value data, or a json object, or just a line with a word
Te

"OK".
c hn

Example: success respose with multiline key=value


ic

HTTP/1.1 200 OK
Server: xxx
a l

Content-Length: <length>

status.Focus=0.5
status.Zoom=0.5

Example: success respose with a word "OK"
HTTP/1.1 200 OK
Server: xxx
Content-Length: <length>

OK

Definitions 4
If the HTTP code is not 200, means the API execute failed, and the response data in http body
maybe empty, or just two line, first line is a word "Error"to indicate error happened, the second
line contain error detail.
Example: request does not fit with syntax.
HTTP/1.1 404 Not Found
Server: xxxx
Example: Request spells wrong.
HTTP/1.1 400 Bad Request
Server: xxx
Content-Length: <length>

Error
Bad Request!
Da

Example: If the request fits with syntax but an error occurs while the server handles it, the
hu

response would like this:


a

HTTP/1.1 500 Internal Server Error


HT

Server: xxx
TP

Content-Length: <length>
AP

Error
I

Internal Server Error!


fo

3.5 Authentication
r
We

Video products support either basic authentication or digest authentication, see RFC 2617 for
st

detail. If the http request sent by client does not provide valid "Authorization" header information,
video products would return HTTP status code 401 and some information for authentication,
Eu

then client should calculate authentication information according RFC 2617, and sent request
ro

again with authentication information using “Authorization” header. Video products return the
pe

required resource only if authorization information correct.


For example:
Te

1. When basic authentication fails, response is:


c hn

HTTP/1.1 401 Unauthorized


ic

WWW-Authenticate: Basic realm="XXXXXX"


a

The client encodes the username and password with base64, and then sends it to server. A
l

valid Authorization like this:


Authorization: Basic VXZVXZ
2. When digest authentication fails, response is:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="DH_00408CA5EA04",
nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad", stale=FALSE, qop="auth"
The client calculates the digest authorization using information like username, password, nonce,
HTTP method and URI with MD5, and then sends it to server.
For example:

Definitions 5
Authorization: Digest username="admin", realm="DH_00408CA5EA04", nc=00000001,
cnonce="0a4f113b", qop="auth",
nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad",
uri="/cgi-bin/magicBox.cgi?action=getLanguageCaps",
response="65002de02df697e946b750590b44f8bf"
Da
hu
a
HT
TP
AP
I
fo
r
We
st
Eu
ro
pe
Te
c hn
ic
a l

Definitions 6
4 General APIs
The requests specified in this section are supported by all video products.

4.1 APIs of RTSP

4.1.1 Get Real-Time Stream


Table 4-1
rtsp://<username>:<password>@<ip>:<port>/cam/realmonitor?channel=<ChannelNo
Syntax
Da

>&subtype=<typeNo>
hu

Description Get real-time media stream.


We request the extra stream 1 of channel 1, the URL is:
a

Example
rtsp://admin:admin@10.7.6.67:554/cam/realmonitor?channel=1&subtype=1
HT

Success
TP

media stream data


Return
<username>: a valid user name.
AP

<password>: user's password.


I

< ip>: the IP address of the video product.


fo

<port >: the default port is 554. It can be omitted.


r

<ChannelNo>: integer, video channel index which starts from 1.


We

Comment <typeNo>: the stream type. The <typeNo> of main stream is 0, extra stream 1 is 1, extra
st

stream 2 is 2. The extra stream counts can be obtained in "4.5.1 Get Max Extra Stream
Numbers". If the stream does not exist or not enabled, response will be error.
Eu

The IP Camera supports both TCP and UDP transmission forms.


ro

It also supplies basic authentication and digest authentication ways. The authentication
process is similar with "3.5 Authentication".
pe
Te

4.1.2 Get Playback Stream


c hn

Table 4-2
ic

rtsp://<username>:<password>@<ip>:<port>/cam/playback?channel=<ChannelNo>
Syntax
a

&starttime=<starttime>&endtime=<endtime>
l

Description Get playback media stream.


rtsp://admin:admin@10.44.200.8:554/cam/playback?channel=1&starttime=2012_09_1
Example
5_12_37_05&endtime=2012_09_15_18_34_14
Success
media stream data
Return
It's similar with "4.1.1 Get Real-Time Stream". Except there are parameters "starttime"
Comment
and "endtime".

4.1.3 Get File Stream


Table 4-3

General APIs 7
Syntax rtsp://<username>:<password>@<ip>:<port>/<filename>
Description Get specific file stream.
rtsp://admin:admin@10.44.200.8:554//mnt/sd/2015-09-16/001/dav/20/20.32.08-20.32.
Example
28[M][0@0][0].dav
Success
media stream data
Return
It's similar with "4.1.1 Get Real-Time Stream".
Comment
filename: absolute path.

4.2 Get MJPG Stream


Table 4-4
Syntax http://<server>/cgi-bin/mjpg/video.cgi[?channel=<ChannelNo>&subtype=<typeNo>]
Da

Method GET
hu

Description Get a video stream encoded by mjpg.


a

To get a video stream of channel 1, main stream, the URL can be


HT

Example http://192.168.1.108/cgi-bin/mjpg/video.cgi or
http://192.168.1.108/cgi-bin/mjpg/video.cgi?channel=1&subtype=0
TP

Video stream encoded by MJPG.


AP

For example:
HTTP Code: 200 OK
I

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


fo

Body:
r

Success
--<boundary>
Return
We

Content-Type: image/jpeg
st

Content-Length:<image size>
Eu

<JPEG image data>


ro

--<boundary>
pe

ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.
typeNo: the stream type, default 0 if not specified. It can be the following value:
Te

Comment 0-Main Stream


c

1-Extra Stream 1
hn

2-Extra Stream 2
ic
a

4.3 Audio
l

4.3.1 Get Audio Input Channel Numbers


Table 4-5
Syntax http://<server>/cgi-bin/devAudioInput.cgi?action=getCollect
Method GET
Description Get audio input channel number.
Example http://192.168.1.108/cgi-bin/devAudioInput.cgi?action=getCollect
Success
result=1
Return

General APIs 8
Comment Above response means there are 2 audio input channels.

4.3.2 Get Audio Output Channel Numbers


Table 4-6
Syntax http://<server>/cgi-bin/devAudioOutput.cgi?action=getCollect
Method GET
Description Get audio output channel number.
Example http://192.168.1.108/cgi-bin/devAudioOutput.cgi?action=getCollect
Success
result=1
Return
Comment Above response means there are 2 audio output channels.
Da

4.3.3 Post Audio Stream


hu
a

Table 4-7
HT

http://<server>/cgi-bin/audio.cgi?action=postAudio&<paramName>=<paramValue>[&
Syntax
<paramName>=<paramValue>…]
TP

Method POST
AP

Description Post audio.


I

Example for single part


The URL of transmit a single part, channel 1 audio stream(encoded with G.711 A-law)
fo

is:
r

http://192.168.1.108/cgi-bin/audio.cgi?action=postAudio&httptype=singlepart&channel=
We

1
st

example:
POST /cgi-bin/audio.cgi?action=postAudio&httptype=singlepart&channel=1 HTTP/1.1
Eu

Content-Type: Audio/G.711A
ro

Content-Length: 9999999
pe

<Audio data>
Te

<Audio data>
c hn

Example Example for multipart


ic

The URL of transmit a multipart, channel 1 audio stream(encoded with G.711 A-law) is:
a

http://192.168.1.108/cgi-bin/audio.cgi?action=postAudio&httptype=multipart&channel=
l

example:
POST /cgi-bin/audio.cgi?action=postAudio&httptype=multipart&channel=1 HTTP/1.1
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
--<boundary>
Content-Type: Audio/G.711A
Content-Length: 800

<Audio data>
--<boundary>

General APIs 9
Success
OK
Return
Parameters in URL:
Comment
The paramName and paramValue are in the table below.

Appendix A: Parameters in URL

ParamName ParamValue type Description


singlepart: HTTP content is a continuous flow of audio packets
httptype string multipart: HTTP content type is multipart/x-mixed-replace, and
each audio packet ends with a boundary string
channel integer The audio channel index which starts from 1.

Appendix B: Audio Encode Type


Da

MIME Description
hu

Audio/PCM PCM
a

Audio/ADPCM ADPCM
HT

Audio/G.711A G.711 A Law


Audio/G.711Mu G.711 Mu Law
TP

Audio/G.726 G.726
AP

Audio/G.729 G.729
I

Audio/MPEG2 MPEG2
Audio/AMR AMR
fo

Audio/AAC AAC
r
We

4.3.4 Get Audio Stream


st

Table 4-8
Eu

http://<server>/cgi-bin/audio.cgi?action=getAudio&<paramName>=<paramValue>[&<
ro

Syntax
paramName>=<paramValue>…]
pe

Method GET
Description Get audio.
Te

Example for single part


c

The URL of Request a single part, channel 1 audio stream(encoded with G.711 A-law)
hn

is:
ic

http://192.168.1.108/cgi-bin/audio.cgi?action=getAudio&httptype=singlepart&channel=
a l

If the request was successful, the server returns a continuous flow of audio packets.
Example The content type is only set at the beginning of the connection.
Return:
HTTP Code: 200 OK
Content-Type: Audio/G.711A
Body:
<Audio data>
<Audio data>

General APIs 10
Example for multipart
The URL of Request a multipart, channel 1 audio stream(encoded with G.711 A-law) is:
http://192.168.1.108/cgi-bin/audio.cgi?action=getAudio&httptype=multipart&channel=1

If the request was successful, the server returns a continuous flow of audio packets.
The content type is "multipart/x-mixed-replace" and each audio packet ends with a
boundary string.
Return:
HTTP Code: 200 OK
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
--<boundary>
Content-Type: Audio/G.711A
Content-Length: 800
Da
hu

<Audio data>
--<boundary>
a

Success
HT

OK
Return
TP

Parameters in URL:
Comment
The paramName and paramValue are in the table below.
AP
I

Appendix:
fo

ParamName ParamValue type Description


r

httptype string singlepart: HTTP content is a continuous flow of audio packets


We

multipart: HTTP content type is multipart/x-mixed-replace, and


st

each audio packet ends with a boundary string


channel integer The audio channel index which starts from 1.
Eu
ro

4.4 Snapshot
pe

4.4.1 Snap
Te
c hn

 Get snap config


ic

Table 4-9
a

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Snap
l

Method GET
Description Get snap config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Snap
table.Snap[0].HolidayEnable=false
table.Snap[0].TimeSection[0][0]=6 00:00:00-23:59:59
table.Snap[0].TimeSection[0][1]=0 00:00:00-23:59:59
Success table.Snap[0].TimeSection[0][2]=0 00:00:00-23:59:59
Return table.Snap[0].TimeSection[0][3]=0 00:00:00-23:59:59
table.Snap[0].TimeSection[0][4]=0 00:00:00-23:59:59
table.Snap[0].TimeSection[0][5]=0 00:00:00-23:59:59
table.Snap[0].TimeSection[1][0]=6 00:00:00-23:59:59

General APIs 11
table.Snap[0].TimeSection[1][1]=0 00:00:00-23:59:59
table.Snap[0].TimeSection[1][2]=0 00:00:00-23:59:59
table.Snap[0].TimeSection[1][3]=0 00:00:00-23:59:59
table.Snap[0].TimeSection[1][4]=0 00:00:00-23:59:59
table.Snap[0].TimeSection[1][5]=0 00:00:00-23:59:59

Response format:
table. Snap[channelNo].TimeSection[weekday][configNo]=1 00:00:00-23:59:59
channelNo: integer, array index starts from 0, which means video channel (equals to
Comment
video channel index -1, and so 0 means channel 1).
weekday: range is [0—6] (Sunday — Saturday).
configNo: the index of time section config. There are many time sections each day.
 Set snap config
Da

Table 4-10
hu

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
a

Syntax
alue>[&<paramName>=<paramValue>…]
HT

Method GET
TP

Description Set snap config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Snap[0].TimeSection
AP

Example
[0][0]=1%2012:00:00-18:00:00
I

Success
OK
fo

Return
r

In table below,
ch: integer, array index starts from 0, which means video channel (equals to video
We

Comment channel index -1, and so 0 means channel 1).


st

wd: week day index, range is [0—6] (Sunday — Saturday).


ts: time section index, starts from 0.
Eu
ro

Appendix:
pe

ParamName ParamValue type Description


wd (week day) range is [0 — 6] (Sunday —
Te

Saturday)
chn

ts (time section) range is [0 — 23], it's time


section table index.
ic

Format: mask hh:mm:ss-hh:mm:ss


a l

Mask: [0—65535], hh: [0—24], mm: [0—59], ss:


Snap[ch].TimeSection[wd][ts] string
[0—59]
Mask indicates record type by bits:
Bit0: regular snapshot
Bit1: motion detection snapshot
Bit2: alarm snapshot
Bit3: card snapshot

General APIs 12
4.4.2 Get a Snapshot
Table 4-11
Syntax http://<server>/cgi-bin/ snapshot.cgi[?channel=<ChannelNo>]
Method GET
Description Get a snapshot of a video channel.
To get a snapshot of video channel 1, the URL can be
Example http://192.168.1.108/cgi-bin/snapshot.cgi or
http://192.168.1.108/cgi-bin/snapshot.cgi?channel=1
Success
Image of jpg format.
Return
Comment ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.
Da

4.4.3 Subscribe to Snapshot


hu
a

Table 4-12
HT

http://<server>/cgi-bin/snapManager.cgi?action=attachFileProc&Flags[0]=Event&Event
TP

Syntax s=[<eventCode>,<eventCode>...][&channel=<ChannelNo>][&heartbeat=<Heartbeat
>]
AP

Method GET
I

Description Subscribe pictures when event of code eventCode happens.


fo

http://192.168.1.108/cgi-bin/snapManager.cgi?action=attachFileProc&Flags[0]=Event&
Example
r

Events=[VideoMotion%2CVideoLoss]&heartbeat=5
--<boundary>\r\n
We

Content-Type: text/plain\r\n
st

Content-Length: <data length>\r\n


Eu

Events[0].Code=TrafficJunction
Events[0].CountInGroup=1
ro

Events[0].IndexInGroup=1
pe

Events[0].Lane=1
Events[0].Data.PTS= 42949485818.0
Te

Events[0].TrafficCar.PlateNumber=Z A12345
c hn

Events[0].TrafficCar. DeviceAddress=Hangzhou
Success ……
ic

Return Events[1].Code=TrafficJunction
a l

……
--<boundary>
Content-Type: image/jpeg
Content-Length:<image size>
<JPEG image data>
--<boundary>
Content-Type: text/plain
Content-Length:<data length>
Heartbeat
--<boundary>

General APIs 13
ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.
Heartbeat: integer,range is [1,60],unit is second.If the URL contains this parameter,
and the value is 5, it means every 5 seconds the device should send the heartbeat
message to the client,the heartbeat meaage is the string "Heartbeat".
eventCode: it can be any one of the standard codes defined in DHIIF.
eventCode includes:
VideoMotion: motion detection event
VideoLoss: video loss detection event
VideoBlind: video blind detection event.
AlarmLocal: alarm detection event.
TrafficJunction: vehicle passing event
TrafficRetrograde: retrograde event
TrafficParking: illegal parking event
Da

TrafficJam: traffic congestion event


hu

TrafficThrow: throw something out of the car event


Comment TrafficPedestrain: pedestrain enter traffic lane(driverway) event
a

TrafficParkingSpaceParking: a vehicle in the parking space event


HT

TrafficParkingSpaceNoParking: no vehicle in the parking space event


TP

TrafficParkingSpaceOverLine: a vehicle over the parking line event


TrafficManualSnap: manual snapshot event
AP

TrafficSuspiciousCar: when the vehicle is in the blacklist, it wiil produce this event.
I

FaceRecognition: face recognition event.


fo

Also, the eventCode can be All


r

All means all kinds of the eventcode.


We

Parameters in Response:
st

GroupID: string, the ID of the snapshot event


Eu

CountInGroup: integer, the number of the snapshots


IndexInGroup: integer, the index of the snapshots. For example, the CountInGroup is
ro

3, the IndexInGroup is 1,it means there are 3 pictures in this snapshot event, and this is
pe

the first picture.


Te

4.5 Video Attributes


c hn
ic

4.5.1 Get Max Extra Stream Numbers


a l

Table 4-13
http://<server>/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxExtraStre
Syntax
am
Method GET
Description Get max extra stream count.
http://192.168.1.108/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxExt
Example
raStream
Success
table.MaxExtraStream=1
Return
Comment MaxExtraStream: max extra stream numbers. It can be 1, 2 or 3.

General APIs 14
4.5.2 Video Color Config
 Get video color config

Table 4-14
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoColor
Method GET
Description Get video color config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoColor
Success head. Brightness=50
Return head. Contrast=50
head. Hue=50
head. Saturation=50
Da

head. TimeSection=1 00:00:00-24:00:00


hu

Comment Parameters in Response:


a

head= table.VideoColor[ChannelNo][ColorConfigNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
HT

video channel index -1, and so 0 means channel 1).


TP

colorConfigNo: color config index.


0 = Color Config 1
AP

1 = Color Config 2
I


fo

 Set video color config


r

Table 4-15
We

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
st

Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Eu

Description Set video color config.


ro

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoColor[1][0].Brig
pe

Example
htness=50
Success
Te

OK
Return
c
hn

In table below, head=VideoColor[ChannelNo][ColorConfigNo]


ChannelNo: integer, array index starts from 0, which means video channel (equals to
ic

video channel index -1, and so 0 means channel 1).


a l

Comment colorConfigNo: color config index,


0 = Color Config 1
1 = Color Config 2

Appendix:

ParamName ParamValue type Description


head.
integer Brightness, range is [0—100]
Brightness
head. Contrast integer Contrast, range is [0—100]
head. Hue integer Hue

General APIs 15
ParamName ParamValue type Description
head.
integer Saturation
Saturation
Effective time for this video color config.
Format is: mask starttime endtime
Mask range is {0, 1}.
Mask 0 —this video config is not effective
Mask 1 —this config is effective
head.
string Starttime/Endtime format like 11:00:00.
TimeSection

Example:
0 01:00:00-02:00:00, means this config is not effective.
1 01:00:00-02:00:00, means this config is effective between
Da

01:00:00 and 02:00:00


hu

4.5.3 Get Encode Capability


a
HT

Table 4-16
TP

Syntax http://<server>/cgi-bin/encode.cgi?action=getCaps
Method GET
AP

Description Get encode capabilities.


I

Example http://192.168.1.108/cgi-bin/encode.cgi?action=getCaps
fo

Success caps.PlaybackCompressSplitNumList[0]=1
r

Return caps.PlaybackCompressSplitNumList[1]=2
We

caps.PlaybackCompressSplitNumList[2]=4
st

caps.PreviewMode=SplitSnap
caps.VideoEncodeDevices[0].CoverAreaPercent=100
Eu

caps.VideoEncodeDevices[0].CoverCount=4
ro

caps.VideoEncodeDevices[0].LadenBitrate=162201600
pe

caps.VideoEncodeDevices[0].MaxCIFPFrameSize=40
caps.VideoEncodeDevices[0].MaxExtraStream=1
Te

caps.VideoEncodeDevices[0].MinCIFPFrameSize=7
c

caps.VideoEncodeDevices[0].RecordIndividualResolution=true
hn

caps.VideoEncodeDevices[0].SupportIndividualResolution=true
ic

caps.VideoEncodeDevices[0].TitleCount=4
a

Comment —
l

4.5.4 Get Encode Config Capability


Table 4-17
http://<server>/cgi-bin/encode.cgi?action=getConfigCaps[&channel=<ChannelNo>&<p
Syntax
aramName>=<paramValue>&<paramName>=<paramValue>...]
Method GET
Description Get encode config capabilities.
http://192.168.1.108/cgi-bin/encode.cgi?action=getConfigCaps&channel=1&Encode[0].
Example
MainFormat[0].Video.Width=1920&Encode[0].MainFormat[0].Video.Height=1080

General APIs 16
headMain.Video.BitRateOptions=448,2560
headMain.Video.CompressionTypes=H.264,MJPG
headMain.Video.FPSMax=25
headMain.Video.ResolutionTypes=2048 x 1536,1080,SXGA, 1280 x 960,720,D1,CIF
Success headExtra.Video.BitRateOptions=80,448
Return headExtra.Video.CompressionTypes=H.264,MJPG
headExtra.Video.FPSMax=25
headExtra.Video.ResolutionTypes=D1,CIF
headSnap.Video.CompressionTypes=H.264,MJPG
headSnap.Video.ResolutionTypes=2048 x 1536,1080,SXGA, 1280 x 960,720,D1,CIF
Parameters in URL:
ChannelNo: integer,video channel index which starts from 1.it is a optional parameter, if
it is not present in the URL, the value of the channelno will be regarded as 1.
Da

The description of <paramName> and <paramValue> is the same as 4.5.5(Set encode


hu

config).
Parameters in Response:
a

headMain= caps[Channel].MainFormat[RecordType]
HT

headExtra = caps[Channel].ExtraFormat[ExtraStream]
TP

headSnap = caps[Channel].SnapFormat[SnapType]
AP

Channel: integer, array index starts from 0, which means video channel (equals to video
I

channel index ChannelNo -1, and so 0 means channel 1).


fo

Comment
RecordType:
r

0 = regular record
We

1 = motion detection record


2 = alarm record
st

ExtraStream:
Eu

0 = extra stream 1
ro

1 = extra stream 2
2 = extra stream 3
pe

SnapType:
Te

0 = regular snapshot
1 = motion detection snapshot
c hn

2 = alarm snapshot
ic

Appendix A: Encode Config Capabilities


a l

Field in response Value range Description


Before comma is minimum bit rate. (kbps), after comma is
maximum bit rate.(kbps)
BitRateOptions string
BitRateOptions=80,448
80 is the minimum bitrates, 448 is maximum.

General APIs 17
Field in response Value range Description
To video, it contains all supported video compression types,
separated by comma. Range is {MPEG4, MPEG2, MPEG1,
MJPG, H.263, H.264, H.265}.
CompressionTypes string To audio, it contains all supported audio compression types,
separated by comma.
Range is {PCM, ADPCM, G.711A, G.711Mu, G.726, G.729,
MPEG2, AMR}
FPSMax integer Maximum FPS.
It contains all supported video resolutions.
ResolutionTypes string
Range is in below Resolution list.

Appendix B: Video Resolution


Da

Fixed Resolution Name Size in PAL Size in NTSC


hu

"D1" 704 x 576 704 x 480


a

"HD1" 352 x 576 352 x 480


HT

"BCIF"/"2CIF" 704 x 288 704 x 240


"CIF" 352 x 288 352 x 240
TP

"QCIF" 176 x 144 176 x 120


AP

"NHD" 640 x 360 —



I

"VGA" 640 x 480


"QVGA" 320 x 240 —
fo

"SVCD" 480 x 480 —


r

"QQVGA" 160 x 128 —


We

"SVGA" 800 x 592 —


st

"SVGA1" 800 x 600 —


"WVGA" 800 x 480 —
Eu

"FWVGA" 854 x 480 —


ro

"DVGA" 960 x 640 —


pe

"XVGA" 1024 x 768 —


"WXGA" 1280 x 800 —
Te

"WXGA2" 1280 x 768 —


c


hn

"WXGA3" 1280 x 854


"WXGA4" 1366 x 768 —
ic

"SXGA" 1280 x 1024 —


a l

"SXGA+" 1400 x 1050 —


"WSXGA" 1600 x 1024 —
"UXGA" 1600 x 1200 —
"WUXGA" 1920 x 1200 —
"ND1" 240 x 192 —
"720P" 1280 x 720 —
"1080P" 1920 x 1080 —
"QFHD" 3840 x 2160 —
"1_3M", "1280x960" 1280 x 960 (1.3 Mega Pixels) —
"2_5M", "1872x1408" 1872 x 1408 (2.5 Mega Pixels) —
"5M", "3744x1408" 3744 x 1408 (5 Mega Pixels) —

General APIs 18
Fixed Resolution Name Size in PAL Size in NTSC
"3M", "2048x1536" 2048 x 1536 (3 Mega Pixels) —
"5_0M", "2432x2048" 2432 x 2048 (5 Mega Pixels) —
"1_2M", "1216x1024" 1216 x 1024 (1.2 Mega Pixels) —
"1408x1024" 1408 x 1024 (1.5 Mega Pixels) —
"3296x2472" 3296 x 2472 (8 Mega Pixels) —
"5_1M", "2560x1920" 2560 x 1920 (5 Mega Pixels) —
"960H", 960 x 576 960 x 480
"DV720P" 960 x 720 —
"2560x1600" 2560 x 1600 (4 Mega Pixels) —
"2336x1752" 2336 x 1752 (4 Mega Pixels) —
"2592x2048" 2592 x 2048 —
"2448x2048" 2448 x 2048 —
Da

"1920x1440" 1920x1440 —
hu

"2752x2208" 2752x2208 —
a

"3840x2160" 3840x2160 —
HT

"4096x2160" 4096x2160 —
TP

"3072x2048" 3072x2048 —

Appendix C: Audio Compression Type


AP
I

Field in response Value range Description


fo

It contains all supported audio compression types, separated by


CompressionTypes string comma. Range is {PCM, ADPCM, G.711A, G.711Mu, G.726,
r

G.729, MPEG2, AMR}


We
st

4.5.5 Encode of Media


Eu

 Get encode config


ro

Table 4-18
pe

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Encode
Te

Method GET
c

Description Get video encode config.


hn

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Encode
ic

table.Encode[0].MainFormat[0].Audio.Bitrate=64
a

table.Encode[0].MainFormat[0].Audio.Channels[0]=0
l

table.Encode[0].MainFormat[0].Audio.Compression=G.711A
table.Encode[0].MainFormat[0].Audio.Depth=16
table.Encode[0].MainFormat[0].Audio.Frequency=8000
table.Encode[0].MainFormat[0].Audio.Mode=0
Success
table.Encode[0].MainFormat[0].Audio.Pack=DHAV
Return
table.Encode[0].MainFormat[0].AudioEnable=true
table.Encode[0].MainFormat[0].Video.resolution=1920x1080
table.Encode[0].MainFormat[0].Video.BitRate=4096
table.Encode[0].MainFormat[0].Video.BitRateControl=CBR
table.Encode[0].MainFormat[0].Video.Compression=H.264
table.Encode[0].MainFormat[0].Video.CustomResolutionName=1080P

General APIs 19
table.Encode[0].MainFormat[0].Video.FPS=18
table.Encode[0].MainFormat[0].Video.GOP=36
table.Encode[0].MainFormat[0].Video.Height=1080
table.Encode[0].MainFormat[0].Video.Pack=DHAV
table.Encode[0].MainFormat[0].Video.Profile=High
table.Encode[0].MainFormat[0].Video.Quality=4
table.Encode[0].MainFormat[0].Video.QualityRange=6
table.Encode[0].MainFormat[0].Video.SVCTLayer=1
table.Encode[0].MainFormat[0].Video.Width=1920
table.Encode[0].MainFormat[0].VideoEnable=true
table.Encode[0].MainFormat[1].Audio.Bitrate=64
table.Encode[0].MainFormat[1].Audio.Channels[0]=0
table.Encode[0].MainFormat[1].Audio.Compression=G.711A
Da

table.Encode[0].MainFormat[1].Audio.Depth=16
hu

table.Encode[0].MainFormat[1].Audio.Frequency=8000
table.Encode[0].MainFormat[1].Audio.Mode=0
a

table.Encode[0].MainFormat[1].Audio.Pack=DHAV
HT

table.Encode[0].MainFormat[1].AudioEnable=true
TP

table.Encode[0].MainFormat[1].Video.resolution=1920x1080
table.Encode[0].MainFormat[1].Video.BitRate=4096
AP

table.Encode[0].MainFormat[1].Video.BitRateControl=CBR
I

table.Encode[0].MainFormat[1].Video.Compression=H.264
fo

table.Encode[0].MainFormat[1].Video.CustomResolutionName=1080P
r

table.Encode[0].MainFormat[1].Video.FPS=18
We

table.Encode[0].MainFormat[1].Video.GOP=36
table.Encode[0].MainFormat[1].Video.Height=1080
st

table.Encode[0].MainFormat[1].Video.Pack=DHAV
Eu

table.Encode[0].MainFormat[1].Video.Profile=High
table.Encode[0].MainFormat[1].Video.Quality=4
ro

table.Encode[0].MainFormat[1].Video.QualityRange=6
pe

table.Encode[0].MainFormat[1].Video.SVCTLayer=1
Te

table.Encode[0].MainFormat[1].Video.Width=1920
table.Encode[0].MainFormat[1].VideoEnable=true
c hn

table.Encode[0].MainFormat[2].Audio.Bitrate=64
ic

table.Encode[0].MainFormat[2].Audio.Channels[0]=0
table.Encode[0].MainFormat[2].Audio.Compression=G.711A
a l

table.Encode[0].MainFormat[2].Audio.Depth=16
table.Encode[0].MainFormat[2].Audio.Frequency=8000
table.Encode[0].MainFormat[2].Audio.Mode=0
table.Encode[0].MainFormat[2].Audio.Pack=DHAV
table.Encode[0].MainFormat[2].AudioEnable=true
table.Encode[0].MainFormat[2].Video.resolution=1920x1080
table.Encode[0].MainFormat[2].Video.BitRate=4096
table.Encode[0].MainFormat[2].Video.BitRateControl=CBR
table.Encode[0].MainFormat[2].Video.Compression=H.264
table.Encode[0].MainFormat[2].Video.CustomResolutionName=1080P
table.Encode[0].MainFormat[2].Video.FPS=18

General APIs 20
table.Encode[0].MainFormat[2].Video.GOP=36
table.Encode[0].MainFormat[2].Video.Height=1080
table.Encode[0].MainFormat[2].Video.Pack=DHAV
table.Encode[0].MainFormat[2].Video.Profile=High
table.Encode[0].MainFormat[2].Video.Quality=4
table.Encode[0].MainFormat[2].Video.QualityRange=6
table.Encode[0].MainFormat[2].Video.SVCTLayer=1
table.Encode[0].MainFormat[2].Video.Width=1920
table.Encode[0].MainFormat[2].VideoEnable=true
table.Encode[0].MainFormat[3].Audio.Bitrate=64
table.Encode[0].MainFormat[3].Audio.Channels[0]=0
table.Encode[0].MainFormat[3].Audio.Compression=G.711A
table.Encode[0].MainFormat[3].Audio.Depth=16
Da

table.Encode[0].MainFormat[3].Audio.Frequency=8000
hu

table.Encode[0].MainFormat[3].Audio.Mode=0
table.Encode[0].MainFormat[3].Audio.Pack=DHAV
a

table.Encode[0].MainFormat[3].AudioEnable=true
HT

table.Encode[0].MainFormat[3].Video.resolution=704x576
TP

table.Encode[0].MainFormat[3].Video.BitRate=2048
table.Encode[0].MainFormat[3].Video.BitRateControl=VBR
AP

table.Encode[0].MainFormat[3].Video.Compression=H.264
I

table.Encode[0].MainFormat[3].Video.FPS=25
fo

table.Encode[0].MainFormat[3].Video.GOP=50
r

table.Encode[0].MainFormat[3].Video.Height=576
We

table.Encode[0].MainFormat[3].Video.Pack=DHAV
table.Encode[0].MainFormat[3].Video.Profile=Main
st

table.Encode[0].MainFormat[3].Video.Quality=4
Eu

table.Encode[0].MainFormat[3].Video.QualityRange=6
table.Encode[0].MainFormat[3].Video.SVCTLayer=1
ro

table.Encode[0].MainFormat[3].Video.Width=704
pe

table.Encode[0].MainFormat[3].VideoEnable=true
Te

table.Encode[0].ExtraFormat[0].Audio.Bitrate=64

c hn

table.Encode[0].SnapFormat[0].Audio.Bitrate=64
ic


a
l

General APIs 21
Parameters in Response:
The format of the config is head.configItems. The head can be:
headMain= table. Encode[Channel].MainFormat[Type]
headSnap = table. Encode[Channel].SnapFormat[Type]
headExtra =table. Encode[Channel].ExtraFormat[ExtraStream]

Channel: integer, array index starts from 0, which means video channel (equals to video
channel index -1, and so 0 means channel 1).
Type:
Comment
0 = regular encode
1 = motion detection encode
2 = alarm encode
3= emergency encode
Da

ExtraStream:
hu

0 = extra stream 1
1 = extra stream 2
a

2 = extra stream 3
HT

The configItems are list as bellow.


TP

 Set encode config


AP

Table 4-19
I

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
fo

alue>[&<paramName>=<paramValue>...]
Method GET
r

Description Set encode config.


We

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Encode[1].MainForm
st

Example
at[0].Video.Compression=MPEG4&
Success
Eu

OK
Return
ro

Parameters in URL:
pe

In table below,
head=Encode[Channel].MainFormat[RecordType] (or)
Te

Encode[Channel].ExtraFormat[ExtraStream]
c hn

Channel: integer, array index starts from 0, which means video channel(equals to video
ic

channel index -1, and so 0 means channel 1).


a l

Comment RecordType:
0 = regular record
1 = motion detection record
2 = alarm record
ExtraStream:
0 = extra stream 1
1 = extra stream 2
2 = extra stream 3

Appendix A: Video Encode Config

ParamName ParamValue type Description

General APIs 22
ParamName ParamValue type Description
Unit is Kbps
head.Video.BitRate integer
Range depends on capability in GetVideoConfigCaps
Range is {CBR, VBR}
head.Video.BitRateControl string CBR: constant bitrates
VBR: variable bitrates
Range is {MPEG4, MPEG2, MPEG1, MJPG, H.263,
head.Video.Compression String H.264, H.265}
Depends on capacity in GetVideoConfigCaps
Range is [0.2—30].
Frames per second.
<1.0: several seconds/frame, FPS=0.3333: 3 seconds
head.Video.FPS float
per frame.
Da

>1.0: several frames/second. FPS=3: 3 frames per


hu

second.
a

Range is [1—100].
Group of picture, it's the interval of I Frame,
HT

head.Video.GOP integer
Example: GOP=50, means there is one I frame every
TP

49 P or B frames
AP

head.Video.Height integer Video height


head.Video.Width integer Video Width
I

Range is { Baseline, Main , Extended , High }


fo

head.Video.Profile String
Only when video compression is H.264, it's effective.
r

Range is [1—6].
We

Image Quality, available when


st

head.Video.Quality integer Video.BitRateControl=VBR


1: worst quality
Eu

6: best quality
ro

head.VideoEnable bool True: enable video


pe

Appendix B: Audio Encode Config


Te

ParamName ParamValue type Description


c

Unit is kbps
hn

head.Audio.Bitrate integer Range depends on capacity in


ic

GetAudioConfigCaps
a

Range depends on capacity in


l

head.Audio.Compression string
GetAudioConfigCaps
head.Audio.Depth integer Audio sampling depth
head.Audio.Frequency integer Audio sampling frequency

General APIs 23
ParamName ParamValue type Description
Range is {0,1,2,3,4,5,6,7}
Audio encode mode.
0: 4.75kbps,
1: 5.15 kbps,
2: 5.9 kbps,
head.Audio.Mode integer
3: 6.7 kbps,
4: 7.4 kbps,
5: 7.95 kbps,
6: 10.2 kbps,
7: 12.2 kbps,
head.AudioEnable bool Enable/Disable audio
Da

4.5.6 Encode of Region Interested


hu
a

 Get encode config of region interested


HT

Table 4-20
TP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoEncodeROI
Method GET
AP

Description Get video encode config of region interested.


I

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoEncode
Example
fo

ROI
r

Success
head.DynamicTrack=false
Return
We

Parameters in Response:
st

head=table.VideoEncodeROI[ChannelNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
Eu

video channel index -1, and so 0 means channel 1).


ro

 Set encode config of region interested


pe

Table 4-21
Te

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
c

alue>[&<paramName>=<paramValue>…]
hn

Method GET
ic

Description Set video encode config of region interested.


a

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoEncodeROI[0].
l

Example
DynamicTrack=true
Success
OK
Return
Parameters in URL:
paramName and paramValue are as table below.
In table below,
Comment
head = VideoEncodeROI[ChannelNo]
ChannelNo: integer, array index starts from 0, which means video channel(equals to
video channel index -1, and so 0 means channel 1).
Appendix:

General APIs 24
ParamName ParamValue type Description
head. DynamicTrack bool Enable/Disable

4.5.7 Channel Title


 Get channel title

Table 4-22
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=ChannelTitle
Method GET
Description Get the title of the video channel.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=ChannelTitle
Success
table.ChannelTitle[Channel].Name=CAM1|123
Da

Return
hu

Parameters in Response:
Channel: integer, array index starts from 0, which means video channel (equals to
a

Comment
video channel index -1, and so 0 means channel 1).
HT

Name: string, which means title content. character '|' means newlines.
TP

 Set channel title


AP

Table 4-23
I

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>
fo

Method GET
r

Description Set the title of the channel.


We

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ChannelTitle[1].Nam
st

Example
e= test1|test2
Success
Eu

OK
Return
ro

If VideoWidget[Channel].ChannelTitle.EncodeBlend is true, this title is blended to the


pe

video frames.
Please refer to SetVideoWidgetConfig.
Te
c

Parameters in URL:
hn

Channel Name Format:


ic

Comment
ChannelTitle[Channel].Name
a

Channel: integer, array index starts from 0, which means video channel(equals to video
l

channel index -1, and so 0 means channel 1).


Name: string, which means title content. Character '|' means newlines.

Limit: Support 2 lines at most.

4.5.8 Get Video Input Channels Device Supported


Table 4-24
Syntax http://<server>/cgi-bin/devVideoInput.cgi?action=getCollect
Method GET

General APIs 25
Description Get the video input channel numbers.
Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCollect
Success
result=1
Return
Comment —

4.5.9 Get Video Output Channels Device Supported


Table 4-25
Syntax http://<server>/cgi-bin/devVideoOutput.cgi?action=getCollect
Method GET
Description Get the video output channel numbers.
Example http://192.168.1.108/cgi-bin/devVideoOutput.cgi?action=getCollect
Da

Success result=2
hu

Return
a

Comment —
HT

4.5.10 Get Max Remote Input Channels


TP
AP

Table 4-26
I

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxRemoteI
nputChannels
fo

Method GET
r

Description Get max remote input channels.


We

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxRe
st

moteInputChannels
Success table.MaxRemoteInputChannels=16
Eu

Return
ro

Comment MaxRemoteInputChannels: max remote input channels.


pe

4.5.11 Video Standard


Te
c

 Get video standard


hn
ic

Table 4-27
a

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoStandard
l

Method GET
Description Get video standard config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoStandar
d
Success table.VideoStandard=PAL
Return
Comment —
 Set video standard

Table 4-28
Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&VideoStandard=<paramV

General APIs 26
alue>
Method GET
Description Set video standard config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoStandard=PAL
Success OK
Return
Comment VideoStandard: string, range is {PAL, NTSC} Video Standard.

4.5.12 Video Widget


 Get video widget config

Table 4-29
Da

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidget
Method GET
hu

Description Video widget config contains Channel Title, User-defined Title, Covers and Time Title
a

parameters, defines the background color, front color and positions of channel title and
HT

time title, User-defined title and defines the regions which are not visible (cover).
TP

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidget
Success head.BackColor[0]=0
AP

Return head.BackColor[1]=0
I

head.BackColor[2]=0
fo

head.BackColor[3]=128
r

head.EncodeBlend=true
head.FrontColor[0]=255
We

head.FrontColor[1]=255
st

head.FrontColor[2]=255
Eu

head.FrontColor[3]=0
head.Rect[0]=0
ro

head.Rect[1]=8191
pe

head.Rect[2]=0
head.Rect[3]=8191
Te


c hn

Comment Parameters in Response:


head=table.VideoWidget[Channel].ChannelTitle (or)
ic

table.VideoWidget[Channel].Covers[CoReg] (or)
a l

table.VideoWidget[Channel].TimeTitle
table.VideoWidget[Channel].UserDefinedTitle[Index]

Channel: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
CoReg: Cover Region, Covers is an array which sustains multi- Cover regions
0 = region 1
1 = region 2
2 = region 3
3 = region 4
Index: integer, User-defined title index, now only index 0 is valid, others are reserved.

General APIs 27
 Set video widget config

Table 4-30
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set video widget config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[1].Cov
Example ers[0].BackColor[0]=128&VideoWidget[1].Covers[0].BackColor[1]=128&VideoWidget[1]
.Covers[0].BackColor[2]=128&VideoWidget[1].Covers[0].BackColor[3]=0
Success
OK
Return
Parameters in URL:
In table below,
Da

headChannelTitle = VideoWidget[Channel].ChannelTitle
hu

headCover = VideoWidget[Channel].Covers[CoReg]
a

headTimeTitle = VideoWidget[Channel].TimeTitle
HT

headUserDefinedTitle = VideoWidget[Channel].UserDefinedTitle[Index]
TP

Comment Channel: integer, array index starts from 0, which means video channel(equals to video
AP

channel index -1, and so 0 means channel 1).


I

CoReg: Cover region index. Covers is an array which contains multiple cover regions
fo

0 = region 1
1 = region 2
r

2 = region 3
We

3 = region 4
st

Index: integer, User-defined title index, now only index 0 is valid, others are reserved.
Eu

Appendix:
ro

ParamName ParamValue type Description


pe

Range is [0—255].
headCover.BackColor[0]
BackColor[0]:red value
Te

headCover.BackColor[1]
integer BackColor[1]:green value
c

headCover.BackColor[2]
hn

BackColor[2]:blue value
headCover.BackColor[3]
BackColor[3]: alpha value
ic

headCover.EncodeBlend bool false - widget blend is disabled.


a l

Range is [0—255].
headCover.FrontColor[0]
FrontColor[0]:red value
headCover.FrontColor[1]
integer FrontColor[1]:green value
headCover.FrontColor[2]
FrontColor[2]:blue value
headCover.FrontColor[3]
FrontColor[3]: alpha value
Range is [0—8191].
headCover.Rect[0] Rect[0]: top left corner x coordinate (left)
headCover.Rect[1] Rect[1]: top left corner y coordinate (top)
integer
headCover.Rect[2] Rect[2]: bottom right x coordinate (right)
headCover.Rect[3] Rect[3]: bottom right y coordinate
(bottom)

General APIs 28
ParamName ParamValue type Description
headChannelTitle.BackColor[0]
headChannelTitle.BackColor[1]
integer
headChannelTitle.BackColor[2]
headChannelTitle.BackColor[3]
headChannelTitle.EncodeBlend bool Range is the same with headCover.
headChannelTitle.FrontColor[0]
headChannelTitle.FrontColor[1]
integer
headChannelTitle.FrontColor[2]
headChannelTitle.FrontColor[3]
Only use the value of (left, top),the value
headChannelTitle.Rect[0]
of (right, bottom) is the same as (left, top)
headChannelTitle.Rect[1]
integer Rect[0], Rect[1] are used, and Rect[2]
headChannelTitle.Rect[2]
Da

must be same with Rect[0], Rect[3] must


headChannelTitle.Rect[3]
hu

be same with Rect[1].


a

Title content. Character '|' means


headUserDefinedTitle.Text string newlines.
HT

Limit: Support 2 lines at most.


TP

headUserDefinedTitle.TextAlign integer Range is the same with


AP

headUserDefinedTitle.BackColor[0] headChannelTitle
headUserDefinedTitle.BackColor[1] These are configs about User-defined
I

integer
headUserDefinedTitle.BackColor[2] title.
fo

headUserDefinedTitle.BackColor[3]
r

headUserDefinedTitle.EncodeBlend bool
We

headUserDefinedTitle.FrontColor[0]
st

headUserDefinedTitle.FrontColor[1]
integer
headUserDefinedTitle.FrontColor[2]
Eu

headUserDefinedTitle.FrontColor[3]
ro

headUserDefinedTitle.Rect[0]
pe

headUserDefinedTitle.Rect[1]
integer
headUserDefinedTitle.Rect[2]
Te

headUserDefinedTitle.Rect[3]
c

headTimeTitle.BackColor[0]
hn

headTimeTitle.BackColor[1]
integer
ic

headTimeTitle.BackColor[2]
a

headTimeTitle.BackColor[3]
l

headTimeTitle.EncodeBlend bool
headTimeTitle.FrontColor[0] Range is the same with
headTimeTitle.FrontColor[1] headChannelTitle.
integer
headTimeTitle.FrontColor[2] These are configs about time title.
headTimeTitle.FrontColor[3]
headTimeTitle.Rect[0]
headTimeTitle.Rect[1]
integer
headTimeTitle.Rect[2]
headTimeTitle.Rect[3]
headTimeTitle.ShowWeek bool True: Display week within the time title.

General APIs 29
4.5.13 Get Video Input Capability
Table 4-31
Syntax http://<server>/cgi-bin/devVideoInput.cgi?action=getCaps&channel=<ChannelNo>
Method GET
Description Get video input capabilities.
Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCaps&channel=1
caps. AutoSyncPhase=false
caps. Backlight=2
caps. BrightnessCompensation=true
caps. ChipID=0
caps. CoverCount=4
caps. CoverType=1
Da

caps. CustomManualExposure=true
hu

caps. DayNightColor=true
a

caps. DayNightColorIO=0
HT

caps. DoubleExposure=0
TP

caps. DownScaling=false
caps. EEModeRange=100
AP

caps. ElectricFocus=false
I

caps. Exposure=16
fo

caps. ExposureMode=31
caps. ExternalSyncInput=0
r

caps. FishEye=false
We

caps. FlashAdjust=false
st

caps. Flip=true
Success
caps. FormatCount=5
Eu

Return
caps. Gain=true
ro

caps. GainAuto=true
pe

caps. Gamma=true
caps. GammaModeRange=100
Te

caps. GlareInhibition=1
c

caps. HorizontalBinning=0
hn

caps. IRCUT=true
ic

caps. ImageEnhancement.LevelRange[0]=0
a

caps. ImageEnhancement.LevelRange[1]=100
l

caps. ImageEnhancement.Support=true
caps. InfraRed=true
caps. Iris=true
caps. IrisAuto=true
caps. LadenBitrate=972000
caps. LimitedAutoExposure=true
caps. MaxExposureTime=300
caps. MaxExposureTime1=0
caps. MaxHeight=1080
caps. MaxMultiProfile=3

General APIs 30
caps. MaxWidth=1920
caps. MeteringRegionCount=0
caps. MinExposureTime=1
caps. MinExposureTime1=0
caps. Mirror=true
caps. MultiOptions=false
caps. NightOptions=true
caps. ReferenceLevel=false
caps. Rotate90=true
caps. SetColor=true
caps. SignalFormats=Inside
caps. SignalType[0]=VGA
caps. SnapshotExposure=false
Da

caps. SupportProfile=false
hu

caps. SupportWhiteLevel=true
caps. SupportWriteLevel=false
a

caps. SyncChipChannels=false
HT

caps. SyncFocus=0
TP

caps. TitleCount=4
caps. TridimDenoise=2
AP

caps. TridimDenoiseDetails=0
I

caps. UTC=0
fo

caps. UpScaling=false
r

caps. Version=0
We

caps. VerticalBinning=0
caps. VideoInDenoise.2D.LevelRange[0]=0
st

caps. VideoInDenoise.2D.LevelRange[1]=100
Eu

caps. VideoInDenoise.2D.Support=true
caps. VideoInDenoise.3D.3DAutoType.ModRange[0]=0
ro

caps. VideoInDenoise.3D.3DAutoType.ModRange[1]=100
pe

caps. VideoInDenoise.3D.Support=true
Te

caps. VideoInDenoise.Support=true
caps. WhiteBalance=3
chn

caps. WideDynamicRange=1
ic

Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
a

Comment
l

Parameters in Response:
see table below

Appendix:

Field in response Value type Description


Backlight bool True: support backlight
ChipID String ID of chips in this channel
CoverCount integer The maximum cover region count.
0: don't support cover
CoverType integer 1: support realtime cover
2: support non-realtime cover

General APIs 31
Field in response Value type Description
CustomManualExposur
bool, true: support use defined manual exposure time
e
DayNightColor bool true: support color alternate between day and night.
DownScaling bool true: support down scaling, binning mode not included.
Exposure integer Exposure grade. 0 — don't support exposure control.
ExternalSyncInput bool true: support HD signal external synchronization.
FlashAdjust bool true: support flash adjust
Flip bool true: support picture flip.
Gain bool true: support gain control.
GainAuto bool true: support auto gain.
HorizontalBinning integer Horizontal/Vertical pixel binning mask,
1 — support 2 pixel binning,
Da

2 — support 3 pixel binning


hu

VerticalBinning integer 4 — support 4 pixel binning


a


HT

2^n — support n+2 pixel binning


InfraRed bool true: support Infra compensation
TP

Iris bool true: support Iris adjust


AP

IrisAuto bool true: support auto Iris adjust


I

Unit is Kbps.
LadenBitrate integer Maximum value of video stream bitrates, 16bpp, not in
fo

binning mode.
r

LimitedAutoExposure bool true: support auto exposure with time limit.


We

MaxHeight integer Maximum video height


st

MaxWidth integer Maximum video width


Mirror bool true: support picture mirror.
Eu

NightOptions bool true: support night options.


ro

ReferenceLevel bool true: support reference level.


pe

Rotate90 bool true: support clockwise/anticlockwise 90°rotate


SetColor bool true: support color set.
Te

It's a string contains supported video input signal formats


chn

for this channel. Signal formats are separated by comma.


Range is {Inside, BT656, 720p, 1080p, 1080i, 1080sF,
ic

SignalFormats string 1_3M}


a l

Inside — inside input.


1_3M — 1280*960
True: channels in same chip should be synchronized.
SyncChipChannels bool Synchronized means video resolution of these channels
should be the same.
TitleCount integer Maximum count of blending titles.
UpScaling bool true: support up scaling.

General APIs 32
Field in response Value type Description
Range is {0, 1, 2, 3}
0: don't support white balance.
1: support auto white balance
WhiteBalance integer
2: support auto and pre defined white balance.
3: support auto, pre defined and user defined white
balance

4.5.14 Adjust Focus


Table 4-32
http://<server>/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=<zoomNo>[&cha
Syntax
nnel=<ChannelNo>]
Da

Method GET
hu

Description Ajust magnification and the focus.


a

http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=0.5&zoom=
Example
-0.5
HT

Success
TP

OK
Return
AP

Parameters in URL:
focusNo : float, the range is between 0 and 1; -1 means reset to position 0.
I

Comment
zoomNo : float, the range is between 0 and 1; -1 means reset to position 0.
fo

ChannelNo: integer, video channel index which starts from 1.


r
We

4.5.15 Adjust Focus Continuously


st

Table 4-33
Eu

http://<server>/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously&focus=<fo
Syntax
ro

cusNo>&zoom=<zoomNo>[&channel=<ChannelNo>]
pe

Method GET
Description Adjust magnification and the focus continuously.
Te

If we want to adjust focus, the API like this:


c

http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously&focus
hn

=0.02&zoom=-1
ic

Example
and when the motor is moving, we send below command to let it stop:
a

http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously&focus
l

=0&zoom=-1
Success
OK
Return

General APIs 33
Parameters in URL:
focusNo: float, the range is -1 < focus < 1; 0 means stop.
zoomNo: float, the range is -1 < zoom < 1; 0 means stop.
ChannelNo: integer, video channel index which starts from 1.

The value means the moving speed of motor lens, positive value means move forwards,
Comment
negative value means move backwards.
This command is used to drive the lens move continuously, until it reaches end.
When the motor is moving, you can send this command again with "focus" or "zoom"
parameter as 0 to stop it immediately.
In this command, when you adjust the focus parameter, the zoom parameter should be
-1, and the focus parameter should be -1 when adjust the zoom parameter.
Da

4.5.16 Auto Focus


hu

Table 4-34
a

Syntax http://<server>/cgi-bin/devVideoInput.cgi?action=autoFocus[&channel=<ChannelNo>]
HT

Method GET
TP

Description Auto focus.


Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=autoFocus
AP

Success
I

OK
Return
fo

Parameters in URL:
r

Comment
ChannelNo: integer, video channel index which starts from 1.
We
st

4.5.17 Get Focus Status


Eu

Table 4-35
ro

http://<server>/cgi-bin/devVideoInput.cgi?action=getFocusStatus[&channel=<Channel
Syntax
pe

No>]
Method GET
Te

Description Get device focus status.


c

Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getFocusStatus
hn

status.Focus=0.5
ic

Success
status.Zoom=0.5
Return
a

status.Status=Normal
l

Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Comment Parameters in Response:
The range of status.Status is "Normal" and "Autofocus". This command must be
continual executed until status.Status is "Normal".

4.5.18 Get Coordinates of Current Window


Table 4-36
http://<server>/cgi-bin/devVideoInput.cgi?action=getCurrentWindow&channel=<Chann
Syntax
elNo>

General APIs 34
Method GET
Description Get the coordinates of the current window.
Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCurrentWindow&channel=1
rect[0]=500
Success rect[1]=500
Return rect[2]=5000
rect[3]=5000
Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Comment Parameters in Response:
rect[n] : relative coordinates, range is 0-8192.{0,0,0,0} top-left,
{8192,0,0,0} top-right, {0,8192,0,0} bottom-left, {8192,8192,0,0} bottom-right
Da

4.5.19 Set Coordinates of Current Window


hu
a

Table 4-37
http://<server>/cgi-bin/devVideoInput.cgi?action=setCurrentWindow&channel=<Chann
HT

Syntax
elNo>&rect[0]=<rect0>&rect[1]=<rect1>&rect[2]=<rect2>&rect[3]=<rect3>
TP

Method GET
AP

Description Set the coordinates of the current window.


http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=setCurrentWindow&channel=1&
I

Example
rect[0]=0&rect[1]=0&rect[2]=5000&rect[3]=5000
fo

Success
r

OK
Return
We

Parameters in URL:
st

ChannelNo: integer, video channel index which starts from 1.


Comment
rect0 & rect1 & rect2 & rect3: relative coordinates, range is 0-8192.{0,0,0,0} top-left,
Eu

{8192,0,0,0} top-right, {0,8192,0,0} bottom-left, {8192,8192,0,0} bottom-right


ro
pe

4.5.20 Video in Options


Te

 Get video in options


c hn

Table 4-38
ic

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInOptions
Method GET
a l

Get video in options config, such as Backlight, ExposureSpeed, DayNightColor,


Description
DayOptions, NightOptions, and NormalOptions.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInOptio
Example
ns
head. Backlight=0
head. DayNightColor=false
head. ExposureSpeed=0
Success
head. ExposureValue1=0.100000
Return
head. ExposureValue2=80.000000
head. ExternalSync=0
head. ExternalSyncPhase=0

General APIs 35
head. FlashControl.Mode=0
head. FlashControl.Pole=0
head. FlashControl.Value=0
head. FlashControl.PreValue=0
head. Flip=false
head. Gain=50
head. GainAuto=true
head. IrisAuto=false
head. Mirror=false
head. NightOptions.AntiFlicker=0
head. NightOptions.Backlight=0
head. NightOptions.BacklightRegion[0]=3096
head. NightOptions.BacklightRegion[1]=3096
Da

head. NightOptions.BacklightRegion[2]=5096
hu

head. NightOptions.BacklightRegion[3]=5096
head. NightOptions.BrightnessThreshold=50
a

head. NightOptions.DayNightColor=2
HT

head. NightOptions.ExposureMode=0
TP

head. NightOptions.ExposureSpeed=0
head. NightOptions.ExposureValue1=0
AP

head. NightOptions.ExposureValue2=40
I

head. NightOptions.ExternalSyncPhase=125
fo

head. NightOptions.Flip=false
r

head. NightOptions.Gain=50
We

head. NightOptions.GainAuto=true
head. NightOptions.GainBlue=50
st

head. NightOptions.GainGreen=50
Eu

head. NightOptions.GainMax=50
head. NightOptions.GainMin=0
ro

head. NightOptions.GainRed=50
pe

head. NightOptions.GlareInhibition=0
Te

head. NightOptions.IrisAuto=true
head. NightOptions.Mirror=false
c
hn

head. NightOptions.Profile=3
ic

head. NightOptions.ReferenceLevel=50
head. NightOptions.Rotate90=0
a l

head. NightOptions.SunriseHour=0
head. NightOptions.SunriseMinute=0
head. NightOptions.SunriseSecond=0
head. NightOptions.SunsetHour=23
head. NightOptions.SunsetMinute=59
head. NightOptions.SunsetSecond=59
head. NightOptions.SwitchMode=4
head. NightOptions.WhiteBalance=Auto
head. NightOptions.WideDynamicRange=0
head. NightOptions.WideDynamicRangeMode=0
head. NormalOptions.AntiFlicker=0

General APIs 36
head. NormalOptions.Backlight=0
head. NormalOptions.BacklightRegion[0]=3096
head. NormalOptions.BacklightRegion[1]=3096
head. NormalOptions.BacklightRegion[2]=5096
head. NormalOptions.BacklightRegion[3]=5096
head. NormalOptions.BrightnessThreshold=50
head. NormalOptions.DayNightColor=1
head. NormalOptions.ExposureMode=0
head. NormalOptions.ExposureSpeed=0
head. NormalOptions.ExposureValue1=0
head. NormalOptions.ExposureValue2=40
head. NormalOptions.ExternalSyncPhase=125
head. NormalOptions.Flip=false
Da

head. NormalOptions.Gain=50
hu

head. NormalOptions.GainAuto=true
head. NormalOptions.GainBlue=50
a

head. NormalOptions.GainGreen=50
HT

head. NormalOptions.GainMax=50
TP

head. NormalOptions.GainMin=0
head. NormalOptions.GainRed=50
AP

head. NormalOptions.GlareInhibition=0
I

head. NormalOptions.IrisAuto=true
fo

head. NormalOptions.Mirror=false
r

head. NormalOptions.Profile=0
We

head. NormalOptions.ReferenceLevel=50
head. NormalOptions.Rotate90=0
st

head. NormalOptions.SunriseHour=0
Eu

head. NormalOptions.SunriseMinute=0
head. NormalOptions.SunriseSecond=0
ro

head. NormalOptions.SunsetHour=23
pe

head. NormalOptions.SunsetMinute=59
Te

head. NormalOptions.SunsetSecond=59
head. NormalOptions.SwitchMode=0
c hn

head. ReferenceLevel=50
ic

head. ReferenceLevelEnable=false
head. Rotate90=0
a l

head. SignalFormat=BT656
head. WhiteBalance=Disable
Parameters in Response:
head = table.VideoInOptions[ChannelNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
 Set video in options

Table 4-39
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]

General APIs 37
Method GET
Set video in options config, such as Backlight, ExposureSpeed, DayNightColor,
Description
DayOptions, NightOptions, and NormalOptions.
Set Auto Exposure:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
xposureMode=0&VideoInOptions[0].ExposureSpeed=0

Set Low Noise:


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
xposureMode=1&VideoInOptions[0].ExposureSpeed=0&VideoInOptions[0].GainMin=0
&VideoInOptions[0].GainMax=60

Set Low Motion Blur:


Da

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
hu

xposureMode=2&VideoInOptions[0].ExposureSpeed=0&VideoInOptions[0].GainMin=0
a

&VideoInOptions[0].GainMax=50&VideoInOptions[0].ExposureValue1=0&VideoInOptio
ns[0].ExposureValue2=20
HT
TP

Set Manual:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
AP

xposureMode=4&VideoInOptions[0].ExposureSpeed=32&VideoInOptions[0].GainMin=
I

0&VideoInOptions[0].GainMax=50&VideoInOptions[0].ExposureValue1=40&VideoInOp
fo

tions[0].ExposureValue2=40
r
We

Set SmartIRExposure:
Example
st

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].S
martIRExposure=true
Eu
ro

Set Video Rotate:


Filp:
pe

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].Fli
Te

p=true
Mirror:
c hn

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].Mi
ic

rror=true
Or turn 90°:
a l

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].R
otate90=1

Set White Balance:


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].W
hiteBalance=Night
Or
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].W
hiteBalance=Custom&VideoInOptions[0].GainRed=50&VideoInOptions[0].GainBlue=50
&VideoInOptions[0].GainGreen=50
(Sometimes you should set mode first before set GainRed or GainBlue:

General APIs 38
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].W
hiteBalance=Custom )
Success
OK
Return
Parameters in URL:
In table below, head =VideoInOptions[ChannelNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).

Appendix:

ParamName ParamValue type Description


Range is [0—n]
n depends on capability in
Da

GetVideoInputCaps
hu

head. Backlight integer 0: backlight closed.


a

1: backlight grade 1
...
HT

n - backlight grade n
TP

Range is {0,1,2}
AP

0: always multicolor
head. DayNightColor integer
1: autoswitch along with brightness,
I

2: always monochrome
fo

Range is {0,1,2, 4}
r

0: AutoExposure
We

head. ExposureMode integer 1: Gain first


st

2: Exposure first
4: Manual.
Eu

Range is [0 — n+1]
ro

n depends on capability in
pe

GetVideoInputCaps
0: AutoExposure
head. ExposureSpeed integer
Te

1-n-1: manual Exposure grade


c

n: AutoExposure with time limit.


hn

n+1: manualExposure with user-defined time


ic

(n is supported maximum exposure grade )


a

Range is [0.1—80], unit is millisecond


l

If ExposureSpeed is 0(AutoExposure enable),


head. ExposureValue1 float
it's lower limit of AutoExposure time, otherwise
it's time of manualExposure
Range is [0.1-80], unit is millisecond
head. ExposureValue2 float Upper limit of AutoExposure time, should be
bigger than ExposureValue1
Range is {0,1}
External Synchronous
head. ExternalSync integer
0: Internal Synchronization
1: External Synchronous

General APIs 39
ParamName ParamValue type Description
Range is [0°—360°]
head. ExternalSyncPhase integer
External Synchronous Signal Phase
head. SmartIRExposure bool true: enable, false: disable
Range is {0,1,2}
0: forbid flash
head. FlashControl.Mode integer
1: always flash
2: auto flash
Range is {0,1, 2, 3}
Trigger mode:
0: low level
head. FlashControl.Pole integer
1: high level
2: rising-edge
Da

3: falling-edge
hu

Range is [0—15]
a

Flashlight time-unit:
0: 0us,
HT

1: 64us,
TP

head. FlashControl.Value integer


2: 128us,
3: 192us
AP


I

15 - 960us
fo

Range is [0—100]
r

It is threshold of brightness value: if brightness


head. FlashControl.PreValue integer
We

is less than this value, flash light will begin to


st

work.
true: enable video flip function
head. Flip bool
Eu

false: disable video flip function


ro

Range is [0—100]
pe

head. Gain integer If GainAuto is true, it's upper limit of auto gain,
else it's the fixed gain adjust value.
Te

Range is [0—100]
c

head. GainBlue integer Gain for blue value, Value is effective when
hn

WhiteBalance is "Custom."
ic

Range is [0—100]
a

head. GainRed integer Gain for red value, Value is effective when
l

WhiteBalance is "Custom."
Range is [0—100]
head. GainGreen integer Gain for green value, Value is effective when
WhiteBalance is "Custom."
true: GainAuto
head. GainAuto bool
false: No GainAuto
true: IrisAuto
head. IrisAuto bool
false: No IrisAuto
true: enable video mirror function
head. Mirror bool
false: disable video mirror function

General APIs 40
ParamName ParamValue type Description
White balance Mode.
Range is {Disable, Auto, Custom, Sunny,
Cloudy, Home, Office, Night}
Some IPC supports common modes:
"Disable", "Auto", "Sunny", "Night", "Outdoor",
head. WhiteBalance String "Custom"
Sometimes the device support other
advanced modes:
"CustomColorTemperature", "Indoor", "ATW",
"Manual", "AutoOutdoor", "ManualDatum" and
so on.
Range is [0—100]
Da

head. ReferenceLevel integer The expected average brightness level of


hu

video frames.
a

Range is {0,1,2}
Video rotation:
HT

head. Rotate90 integer 0: No rotate


TP

1: clockwise rotate 90°


2: anticlockwise rotate 90°
AP

Range is {Inside, BT656, 720p, 1080p, 1080i,


I

head. SignalFormat String 1080sF}


fo

Input Signal Mode


r

Range is {0,1,2}
We

AntiFlicker mode:
st

head. AntiFlicker integer 0: Outdoor


1: 50 Hz AntiFlicker
Eu

2: 60 Hz AntiFlicker
ro

Range is [0—100]
pe

head. GlareInhibition integer GlareInhibition:


0: Close GlareInhibition.
Te

NightOptions contain a set of parameters


c

used when brightness is not enough.


hn

head.
Range is [0—100]
NightOptions.BrightnessThre integer
ic

when brightness is less than the


shold
a

BrightnessThreshold, parameters change to


l

Nightoptions.
true: IrisAuto
head. NightOptions.IrisAuto bool
false: No IrisAuto
head. Range is [00—23]
integer
NightOptions.SunriseHour Sunrise hour.
head. Range is [00—59]
integer
NightOptions.SunriseMinute Sunrise minute
head. Range is [00—59]
integer
NightOptions.SunriseSecond Sunrise second
head. Sunset time. Its range is same with sunrise
integer
NightOptions.SunsetHour time, and it should be after sunrise time.

General APIs 41
ParamName ParamValue type Description
head. NightOptions are used if time is after sunset
integer
NightOptions.SunsetMinute time and before sunrise time.
head.
integer
NightOptions.SunsetSecond
Range is {0,1,2}
0: NoSwitch, always use day options.
1: Switch depends on brightness.
head. 2: Switch depends on time, switch to
integer
NightOptions.SwitchMode NightOptions when time is after sunset time
and before sunrise.
3: NoSwitch, always use NightOptions.
4: No switch, always use NormalOptions.
Da

Range is {0,1,2,3}
hu

0: use temporary day options.


a

1: use temporary NightOptions.


head. NightOptions.Profile integer
2: use temporary NormalOptions.
HT

3: depends on
TP

head.NightOptions.SwitchMode
head.
AP

integer
NightOptions.ExposureSpeed
I

head.
fo

NightOptions.ExposureValue float
r

1
We

head.
st

NightOptions.ExposureValue float
2
Eu

head. NightOptions.Gain integer


ro

head. NightOptions.GainAuto bool


pe

head. NightOptions.GainBlue integer Range is the same as relevant items of day


head. options in this table.
integer
Te

NightOptions.GainGreen Example:
c

head. NightOptions.GainRed integer Value range of


hn

head. head.NightOptions.ExposureSpeed is the


ic

String
NightOptions.WhiteBalance same with head. ExposureSpeed.
a

head.
l

integer
NightOptions.ReferenceLevel
head.
NightOptions.ExternalSyncP integer
hase
head.
integer
NightOptions.AntiFlicker
head. NightOptions.Backlight integer
head.
integer
NightOptions.DayNightColor

General APIs 42
ParamName ParamValue type Description
head.
integer
NightOptions.ExposureMode
head.
integer
NightOptions.GlareInhibition
head. NightOptions.Mirror integer
head. NightOptions.Flip integer
head. NightOptions.Rotate90 integer
head.
NomalOptions.BrightnessThr integer
eshold
head.
bool
NormalOptions.IrisAuto
Da

head.
integer
hu

NormalOptions.SunriseHour
a

head.
HT

NormalOptions.SunriseMinut integer
e
TP

head.
AP

NormalOptions.SunriseSeco integer
nd
I

head.
fo

integer
NormalOptions.SunsetHour
r

head.
We

integer
NormalOptions.SunsetMinute
st

head. NomalOptions contain a set of parameters


NormalOptions.SunsetSecon integer similar with NightOptions.
Eu

d Range is the same as relevant items of


ro

head. NightOptions in this table.


pe

NormalOptions.ExposureSpe integer
ed
Te

head.
c

NormalOptions.ExposureValu float
hn

e1
ic

head.
a

NormalOptions.ExposureValu float
l

e2
head. NormalOptions.Gain integer
head.
bool
NormalOptions.GainAuto
head.
integer
NormalOptions.GainBlue
head.
integer
NormalOptions.GainGreen
head.
integer
NormalOptions.GainRed

General APIs 43
ParamName ParamValue type Description
head.
String
NormalOptions.WhiteBalance
head.
NormalOptions.ReferenceLe integer
vel
head.
NormalOptions.ExternalSync integer
Phase
head.
integer
NormalOptions.AntiFlicker
head.
integer
NormalOptions.Backlight
Da

head.
hu

NormalOptions.DayNightColo integer
a

r
HT

head.
NormalOptions.ExposureMod integer
TP

e
AP

head.
NormalOptions.GlareInhibitio integer
I

n
fo

head. NormalOptions.Mirror integer


r

head. NormalOptions.Flip integer


We

head.
integer
st

NormalOptions.Rotate90
Eu

4.5.21 Video Out


ro
pe

 Get video out config

Table 4-40
Te

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoOut
c
hn

Method GET
ic

Description Get video out config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoOut
a l

head.Margin[0]=0
head.Margin[1]=0
head.Margin[2]=0
head.Margin[3]=0
head.Color.Brightness=50
Success
head.Color. Contrast =50
Return
head.Color. Satuation =50
head.Color. Hue =50
head.Mode. Width =800
head.Mode. Height=600
head.Mode. BPP =16

General APIs 44
head.Mode. Format ="Auto"
head.Mode. RefreshRate =60

Parameters in Response:
head = table.VideoOut[ChannelNo].
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
 Set video out config

Table 4-41
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set video out config.
Da

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&table.VideoOut[1].Co
hu

Example
lor.Brightness=50
a

Success
HT

OK
Return
TP

Parameters in URL:
In table below,
AP

Comment head = table.VideoOut[ChannelNo].


I

ChannelNo: integer, array index starts from 0, which means video channel (equals to
fo

video channel index -1, and so 0 means channel 1).


r

Appendix:
We

ParamName ParamValue type Description


st

head. Margin[0]
Eu

head. Margin[1]
integer Margin.
head. Margin[2]
ro

head. Margin[3]
pe

head. Color.Brightness integer Brightness.


head. Color.Contrast =50 integer Contrast.
Te

head.Color.Satuation =50 integer Satuation.


c hn

head. Color.Hue =50 integer Hue.


ic

head. Mode.Width =800


integer Resolution.
head. Mode.Height=600
a l

head. Mode.BPP =16 integer Bits per pixel.


head.Mode.Format="Auto" string The range is {"Auto", "TV", "VGA", "DVI"}.
head.Mode.RefreshRate=60 integer Refresh rate.

4.5.22 Smart Code


 Get Smart Code config

Table 4-42
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=SmartEncode
Method GET

General APIs 45
Description Get smart code config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=SmartEncode
Success head.Enbale=false
Return head.Extra[0]=false
Parameters in Response:
head = table.SmartEncode[ChannelNo].
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
 Set Smart Code config

Table 4-43
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Da

Method GET
Description Set smart code config.
hu

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&SmartEncode[0].Enb
a

Example
ale=true
HT

Success
OK
TP

Return
Parameters in URL:
AP

In table below,
I

Comment head = SmartEncode[ChannelNo].


fo

ChannelNo: integer, array index starts from 0, which means video channel(equals to
r

video channel index -1, and so 0 means channel 1).


We

Appendix:
st

ParamName ParamValue type Description


Eu

head.Enbale bool Open or close the smart code of the main stream.
head.Extra[0] bool Open or close the smart code of the extra stream.
ro
pe

4.6 System
Te
c

4.6.1 General
hn
ic

 Get general config


a l

Table 4-44
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=General
Method GET
Description Get general config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=General
table.General.MachineName=Test001
Success table.General.LocalNo=8
Return table.General.MachineAddress="binjiangqv jiangnandadao weiyelu"
table.General.MachineGroup="jiaojing yidui
Comment —
 Set general config

General APIs 46
Table 4-45
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set general config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&General.MachineNa
Example
me=MyIPC
Success
OK
Return
Comment —

Appendix:

ParamName ParamValue type Description


Da

General.MachineName string Device name or serial number.


hu

General. LocalNo integer Local number for remote controller


a

General. MachineAddress string Address machine places in


HT

General. MachineGroup string Group machine belongs to


TP

4.6.2 Get Current Time


AP
I

Table 4-46
Syntax http://<server>/cgi-bin/global.cgi?action=getCurrentTime
fo

Method GET
r

Description Get current time.


We

Example http://192.168.1.108/cgi-bin/global.cgi?action=getCurrentTime
st

Success
result = 2011-7-3 21:02:32
Return
Eu

The time format is "Y-M-D H-m-S". It's not be effected by Locales. TimeFormat in
ro

Comment
SetLocalesConfig.
pe

4.6.3 Set Current Time


Te
c

Table 4-47
hn

Syntax http://<server>/cgi-bin/global.cgi?action=setCurrentTime&time=2011-7-3%2021:02:32
ic

Method GET
a l

Description Set current time.


http://192.168.1.108/cgi-bin/global.cgi?action=setCurrentTime&time=2016-01-01%202
Example
1:02:32
Success
OK
Return
The time format is "Y-M-D H-m-S". It's not be effected by Locales. TimeFormat in
Comment
SetLocalesConfig.

4.6.4 Locales
 Get locales config

General APIs 47
Table 4-48
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Locales
Method GET
Description Get locales config
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Locales
table.Locales.DSTEnable=false
table.Locales.DSTEnd.Day=1
table.Locales.DSTEnd.Hour=0
table.Locales.DSTEnd.Minute=0
table.Locales.DSTEnd.Month=1
table.Locales.DSTEnd.Week=2
Success table.Locales.DSTEnd.Year=2011
Return table.Locales.DSTStart.Day=0
Da

table.Locales.DSTStart.Hour=0
hu

table.Locales.DSTStart.Minute=0
a

table.Locales.DSTStart.Month=1
table.Locales.DSTStart.Week=1
HT

table.Locales.DSTStart.Year=2011
TP

table.Locales.TimeFormat=yyyy-MM-dd HH:mm:ss
Comment —
AP

 Set locales config


I
fo

Table 4-49
r

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
We

Method GET
st

Description Set Locales config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Locales.DSTEnable
Eu

Example
=false
ro

Success
pe

OK
Return
Comment —
Te
c

Appendix:
hn
ic

ParamName ParamValue type Description


Locales.DSTEnable bool Enable/Disable DST (daylight saving time)
a l

Range is [0—6] or [1—31]


[0—6]: week day, 0 = Sunday, 6 = Saturday
Locales.DSTEnd.Day integer [1—31]: month day
If Locales.DSTEnd.Week is 0, use month day,
otherwise, use week day.
Locales.DSTEnd.Hour integer Range is [0—23]
Locales.DSTEnd.Minute integer Range is [0—59]
Locales.DSTEnd.Month integer Range is [1—12]

General APIs 48
ParamName ParamValue type Description
Range is {1, 2, 3, 4, -1, 0}.
0 = Use month day
Locales.DSTEnd.Week Integer [1, 2, 3, 4, -1]: use week day.
1 = first week, 2 = second, 3 = third, 4 = fourth, -1 =
last.
Locales.DSTEnd.Year Integer Range is [2000-2038]
Locales.DSTStart.Day
Locales.DSTStart.Hour
Range is the same with items in Locales.DSTEnd.
Locales.DSTStart.Minute
Integer Locales.DSTStart table and Locales.DSTEnd table
Locales.DSTStart.Month
define the time range of DST.
Locales.DSTStart.Week
Locales.DSTStart.Year
Da

Defines time format displayed in video time title.


hu

String form is: year-month-day hour:mm:ss.


a

Position of year, month and day can be exchanged.


HT

Range of year is {yy, yyyy}


TP

yy = year without century, yyyy = year with century.


AP

Range of month is {M, MM, MMMM}


M = 1 for January, MM = 01 for January, MMMM =
I

Jan for January


fo

Locales.TimeFormat string Range of day is {d, dd}


r

d = 1 for first day, dd = 01 for first day


We

Range of hour is {H, HH, h, hh}


st

H = 1 for 1:00, HH = 01 for 1:00, range is 0-23


h = 1 for 1:00, hh = 01 for 1:00, time range is 1-12
Eu
ro

Example:
pe

yyyy-MM-dd HH:mm:ss or
MM-dd-yyyy HH:mm:ss or
Te

dd-M-yy hh:mm:ss
c hn

4.6.5 Get Language Capability


ic
a

Table 4-50
l

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getLanguageCaps
Method GET
Description Get the list of supported languages.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getLanguageCaps
Success
Languages=SimpChinese,English,French
Return
response is a string contains languages with comma separated.
Languages include
Comment
{English, SimpChinese, TradChinese, Italian, Spanish, Japanese, Russian, French,
German}

General APIs 49
4.6.6 Language
 Get language config

Table 4-51
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Language
Method GET
Description Get system language config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Language
Success
table.Language=SimpChinese
Return
Comment —
 Set language config
Da

Table 4-52
hu

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
a

Syntax
alue>[&<paramName>=<paramValue>…]
HT

Method GET
TP

Description Set system language config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Language=SimpChi
AP

Example
nese
I

Success
OK
fo

Return
r

Comment NOTE: After changing language setting, system will automatically reboot!
We

Appendix:
st

ParamName ParamValue type Description


Eu

The language range is get from interface in


Language string
GetLanguageCaps
ro
pe

4.6.7 Get Client Access Filter


Te

Table 4-53
c hn

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AccessFilter
ic

Method GET
a

Description Get access filter config.


l

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AccessFilter
Success table.AccessFilter.Enable=false
Return table.AccessFilter.TrustList[0]=10.6.10.23
table.AccessFilter.TrustList[1]=10.6.10.62
table.AccessFilter.Type=TrustList
Comment Parameters in Response:
Type: Range is {TrustList, BannedList}. If Trustlist is supported, Bannedlist is not
supported.
More information in Appendix.

Appendix:

General APIs 50
ParamName ParamValue type Description
AccessFilter.BannedList[index] string Banned IP address list
AccessFilter.TrustList[index] string Trusted IP address list
AccessFilter.Enable bool Enable/Disable access filter function
Range is {TrustList, BannedList},
TrustList: Trust list is used, banned list
AccessFilter.Type string is not used.
BannedList: Banned list is used, trust
list is not used.

4.6.8 Auto Maintain


 Get auto maintain config
Da

Table 4-54
hu

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AutoMaintain
a

Method GET
HT

Description Get Auto Maintain config.


TP

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AutoMaintain
table.AutoMaintain. AutoRebootDay=3
AP

table.AutoMaintain. AutoRebootHour=0
I

table.AutoMaintain. AutoRebootMinute=0
fo

table.AutoMaintain. AutoShutdownDay=1
Success
r

table.AutoMaintain. AutoShutdownHour=0
Return
table.AutoMaintain. AutoShutdownMinute=0
We

table.AutoMaintain. AutoStartUpDay=1
st

table.AutoMaintain. AutoStartUpHour=2
table.AutoMaintain. AutoStartUpMinute=0
Eu

Comment —
ro

 Set auto maintain config


pe

Table 4-55
Te

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
c

alue>[&<paramName>=<paramValue>…]
hn

Method GET
ic

Description Set auto maintain config.


a

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AutoMaintain.AutoR
l

Example
ebootDay=7
Success
OK
Return
Comment —

Appendix:

ParamName ParamValue type Description

General APIs 51
ParamName ParamValue type Description
Range is [-1—7].
Auto restart day.
AutoMaintain. AutoRebootDay integer -1 = never auto restart
0—6 = Sunday—Saturday
7 = restart every day
AutoMaintain. Range is [0—23].
integer
AutoRebootHour Auto restart hour
AutoMaintain. Range is [0—59].
integer
AutoRebootMinute Auto restart minute
AutoMaintain.
AutoShutdownDay
auto reboot time
AutoMaintain.
integer Range is same with AutoOpenDay,
Da

AutoShutdownHour
AutoOpenHour and AutoOpenMinute.
hu

AutoMaintain.
a

AutoShutdownMinute
HT

AutoMaintain. AutoStartUpDay
AutoMaintain. Auto shutdown time.
TP

AutoStartUpHour integer Range is same with AutoOpenDay,


AP

AutoMaintain. AutoOpenHour, and AutoOpenMinute.


AutoStartUpMinute
I
fo

4.6.9 Holiday Management


r
We

 Get holiday config


st

Table 4-56
Eu

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Holiday
Method GET
ro

Description Get holiday config for record or snap.


pe

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Holiday
Te

table.Holiday.MonthMask[0]=3
table.Holiday.MonthMask[1]=0
c hn

table.Holiday.MonthMask[2]=0
ic

table.Holiday.MonthMask[3]=0
table.Holiday.MonthMask[4]=0
al

Success table.Holiday.MonthMask[5]=0
Return table.Holiday.MonthMask[6]=0
table.Holiday.MonthMask[7]=0
table.Holiday.MonthMask[8]=0
table.Holiday.MonthMask[9]=1610612739
table.Holiday.MonthMask[10]=0
table.Holiday.MonthMask[11]=0
Comment —
 Set holiday config

Table 4-57

General APIs 52
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set holiday config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Holiday.MonthMask[
Example
0]=3
Success
OK
Return
Parameters in URL:
In table below,
Comment
monthIndex presents the index of a month. 0 presents January, 1 presents February,
11 presents December.
Da

Appendix:
hu

ParamName ParamValue type Description


a

It is the mask of a month.Every bit present


HT

a day. For example, 0x0001 presents the


first day of a month is holiday. 0x0002
TP

Holiday.MonthMask[monthIndex] integer
presents the second day of a month is
AP

holiday, 0x0003 presents the first day and


second day of a month is holiday.
I
fo

4.6.10 Get Device Type


r
We

Table 4-58
st

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getDeviceType
Method GET
Eu

Description Get the device type displaying which is not the real type.
ro

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getDeviceType
pe

Success
type=DVR
Return
Te

Comment —
c hn

4.6.11 Get Hardware Version


ic
a

Table 4-59
l

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getHardwareVersion
Method GET
Description Get the device hardware version.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getHardwareVersion
Success
version=1.00
Return
Comment —

General APIs 53
4.6.12 Get Serial Number of Device
Table 4-60
Syntax http://<server>/cgi-bin/magicBox.cgi?action=getSerialNo
Method GET
Description Get the device serial number.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getSerialNo
Success
sn=YZC0GZ05100020
Return
Comment —

4.6.13 Get Machine Name


Da

Table 4-61
hu

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getMachineName
a

Method GET
HT

Description Get the device machine name.


TP

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getMachineName
Success
AP

name=YZC0GZ05100020
Return
I

Comment —
fo
r

4.6.14 Get System Information


We

Table 4-62
st

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getSystemInfo
Eu

Method GET
ro

Description Get the system information.


Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getSystemInfo
pe

serialNumber= PA1FQ15900207
Success
Te

deviceType=27
Return
processor= ST7108
c hn

Comment —
ic

4.6.15 Get Vendor Information


al

Table 4-63
Syntax http://<server>/cgi-bin/magicBox.cgi?action=getVendor
Method GET
Description Get the vendor information.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getVendor
Success
vendor=TTT
Return
Comment —

General APIs 54
4.6.16 Get Software Information
Table 4-64
Syntax http://<server>/cgi-bin/magicBox.cgi?action=getSoftwareVersion
Method GET
Description Get the software information.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getSoftwareVersion
Success
version=2.212.0000.0.R,build:2013-11-14
Return
Comment —

4.6.17 Get Version of Onvif


Da

Table 4-65
hu

Syntax http://<server>/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=Onvif
a

Method GET
HT

Description Get onvif version.


TP

Example http://192.168.1.108/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=Onvif
Success
AP

version=2.4.2
Return
I

Comment —
fo
r

4.6.18 Get Version of HTTP API


We

Table 4-66
st

Syntax http://<server>/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=CGI
Eu

Method GET
ro

Description Get CGI version.


Example http://192.168.1.108/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=CGI
pe

Success
version=2.0.0
Te

Return
Comment —
c hn
ic

4.6.19 Get Device Class


a l

Table 4-67
Syntax http://<server>/cgi-bin/magicBox.cgi?action=getDeviceClass
Method GET
Description Get the device class.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getDeviceClass
Success
class=HDVR
Return
Comment —

General APIs 55
4.6.20 Onvif Service Authorization
 Get config of Onvif service authorization

Table 4-68
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=UserGlobal
Method GET
Description Get user global config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=UserGlobal
Success
table.UserGlobal.OnvifLoginCheck=false
Return
If "OnvifLoginCheck" is false, you can get Onvif service directly; if true, you should enter
Comment
your ID/username and password.
Da

 Set config of Onvif service authorization


hu

Table 4-69
a

http://<server>/cgi-bin/configManager.cgi?action=setConfig&UserGlobal.OnvifLoginCh
HT

Syntax
eck=<flag>
TP

Method GET
Description Enable onvif login check or not.
AP

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&UserGlobal.OnvifLog
Example
I

inCheck=true
fo

Success
OK
r

Return
We

Parameters in URL:
Comment
flag : range is {true, false}.
st

4.6.21 Backup of Config


Eu
ro

Table 4-70
pe

Syntax http://<server>/cgi-bin/Config.backup?action=All
Te

Method GET
Description Download all the settings of a device as a file named Config.Backup by default.
c hn

Example http://192.168.1.108/cgi-bin/Config.backup?action=All
ic

Success HTTP/1.1 200 OK


a

Return CONTENT-LENGTH: 743087


l

CONNECTION: close
Content-type: application/binarytet-stream; charset=utf-8

{
"ATM" : {
"DataSource" : "RS232",
"DisplayPostion" : "lefttop",
"EncodeBlend" : true,
"PreviewBlend" : true,
"ProtocolAbility" : [ "POS" ],
"ProtocolName" : "ATM\/POS",

General APIs 56
"RecordChannels" : [ 0, 1, 2, 3 ]
}
……
}
Comment —

4.6.22 Restore the Config


Table 4-71
http://<server>/cgi-bin/configManager.cgi?action=restore&names[0]=<xxx>&names[1]=
Syntax
<yyy>[&…]
Method GET
Description Restore config.
Da

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=restore&names[0]=UPnP
hu

Success
OK
a

Return
HT

Parameters in URL:
Comment
xxx and yyy is config name which need to be restore
TP
AP

4.6.23 Restore except the Config


I

Table 4-72
fo

Syntax http://<server>/cgi-bin/configManager.cgi?action=restoreExcept&names[0]=<xxx>&na
r

mes[1]=<yyy>[&…]
We

Method GET
st

Description Restore all config except several.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=restoreExcept&names[0]=UPnP
Eu

Success OK
ro

Return
pe

Comment Parameters in URL:


All the config file but xxx and yyy will be restored.
Te
c

4.6.24 Reboot
hn
ic

Table 4-73
a

Syntax http://<server>/cgi-bin/magicBox.cgi?action=reboot[&delay=<paramValue>]
l

Method GET
Description Reboot the device.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=reboot
Success
OK
Return
Comment If successful, response OK. If fail, response Error.

4.6.25 Shutdown
Table 4-74

General APIs 57
Syntax http://<server>/cgi-bin/magicBox.cgi?action=shutdown
Method GET
Description Shutdown the device.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=shutdown
Success
OK
Return
Comment If successful, response OK. If fail, response Error.

4.6.26 FactoryReset
Table 4-75
Syntax http://<server>/cgi-bin/magicBox.cgi?action=resetSystemEx[&type=<type>]
Method GET
Da

Description Reset the configuration for the device to the factory default.
hu

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=resetSystemEx&type=0
a

Success
OK
HT

Return
Parameters in URL:
TP

Type: integer, it can be 0 or1.


AP

0 means all parameters are set to their factory default value;


I

1 means all parameters are set to their factory default value expect the specific
Comment parameters;
fo

The specific parameters of different device types are different. But it always contains the
r

network settings and user settings. After resetting, the device is reachable on the same
We

ip address as used before the reset.


st

When the Type parameter is not present in the URL, the default value of the Type is 0.
Eu

4.6.27 Get Tracing Code of Device


ro
pe

Table 4-76
Syntax http://<server>/cgi-bin/magicBox.cgi?action=getTracingCode
Te

Method GET
c

Description Get the tracing code of the device.


hn

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getTracingCode
ic

Success
a

tc=0001...1101
Return
l

Only system default admin can get it.


Comment
tc is a 64bit binary string.

4.7 Network

4.7.1 Get Network Interfaces


Table 4-77
Syntax http://<server>/cgi-bin/netApp.cgi?action=getInterfaces
Method GET

General APIs 58
Description Get all of the system network interfaces.
Example http://192.168.1.108/cgi-bin/netApp.cgi?action=getInterfaces
netInterface[0].Name=eth0
Success netInterface[0].Type=Normal
Return netInterface[0].Valid=true

result item value:
Name: network interface name.
"eth0" - wired network interface
"eth2" - wireless network interface
"3G" - 3G network interface

Comment
Type: "Normal" — wired network
Da

"Wireless" — wireless network


hu

"Auto", "TD-SCDMA", "WCDMA", "CDMA1x", "EDGE", "EVDO" — 3G network


a

types.
HT

Valid: network interface is valid if netInterface[n].Valid is true.


TP

4.7.2 Network Basic Config


AP
I

 Get network config


fo

Table 4-78
r

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Network
We

Method GET
st

Get network basic config. The basic config contains basic network parameters (default
Description
interface, domain name, host name), and configuration of each network interface.
Eu

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Network
ro

table.Network.DefaultInterface=eth0
pe

table.Network.Domain=ttt
table.Network.Hostname=badak
Te

table.Network.interface.DefaultGateway=10.7.0.1
c hn

table.Network.interface.DhcpEnable=false
Success
table.Network.interface.DnsServers[0]=221.123.33.228
ic

Return
table.Network.interface.DnsServers[1]=221.12.1.228
al

table.Network.interface.IPAddress=10.7.2.3
table.Network.interface.MTU=1500
table.Network.interface.PhysicalAddress=00:10:5c:f2:1c:b4
table.Network.interface.SubnetMask=255.255.0.0
Comment interface in response is network interface name, such as eth0, eth2…
 Set network config

Table 4-79
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set network basic config.

General APIs 59
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NetWork.Domain=ttt
Example
&NetWork.eth0.DhcpEnable=true
Success
OK
Return
Comment interface in below ParamName is network interface name, such as eth0 and eth2

Appendix:

ParamName ParamValue type Description


Set default network interface when multiple
interfaces exist.
Network. DefaultInterface string
Range of interfaces is depends on
GetInterfaces.
Network. Domain string Domain name.
Da

Hostname and Domain compose a network


Network. Hostname string
hu

address.
a

Network.
string IP address.
HT

interface.DefaultGateway
Network.
TP

bool Enable/Disable DHCP.


interface.DhcpEnable
AP

Network.
string IP address of first DNS server.
interface.DnsServers[0]
I

Network.
fo

string IP address of second DNS server.


interface.DnsServers[1]
r

Network.
We

string Interface IP address.


interface.IPAddress
st

Network. interface.MTU integer Interface MTU.


MAC address of interface.
Eu

HEX string in the form of:


ro

xx:xx:xx:xx:xx:xx.
Network.
pe

string Range of x is [0-9, a-f, A-F]


interface.PhysicalAddress
Example:
Te

00:10:5c:f2:1c:b4
c

00:10:5C:F2:1C:B5
hn

Network mask string:


ic

Network. In the form of x.x.x.x, range of x is [0-255]


string
a

interface.SubnetMask Example:
l

255.255.255.0

4.7.3 PPPoE
 Get PPPoE config

Table 4-80
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=PPPoE
Method GET
Description Get PPPoE config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=PPPoE

General APIs 60
table.PPPoE.Enable=false
Success
table.PPPoE.Password=123456
Return
table.PPPoE.UserName=123456
Comment —

 Set PPPoE config

Table 4-81
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set PPPoE config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&PPPoE.UserName=
Example
user1&PPPoE.Password=123456
Da

Success
OK
hu

Return
a

Comment —
HT

Appendix:
TP

ParamName ParamValue type Description


AP

PPPoE. Enable bool Enable/Disable PPPoE.


I

PPPoE. UserName string PPPoE user name.


PPPoE. Password string PPPoE user password.
fo
r

4.7.4 DDNS
We
st

 Get DDNS config


Eu

Table 4-82
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=DDNS
ro

Method GET
pe

Description Get DDNS config.


Te

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=DDNS
Success table.DDNS[index].Address=www.ttt.com
c hn

Return table.DDNS[index].Enable=true
ic

table.DDNS[index].HostName=www.ttt.com
a

table.DDNS[index].KeepAlive=10
l

table.DDNS[index].Password=none
table.DDNS[index].Port=5050
table.DDNS[index].Protocol= Quick DDNS
table.DDNS[index].UserName=user1
table.DDNS[index].DefaultHostName.Enable=false
table.DDNS[index].DefaultHostName.HostName=9002A9D77133.quickddns.com
Comment index in response is the DDNS protocol table index, start from 0.
The meaning of parameters can refer to SetDDNSConfig chapter.
 Set DDNS config

Table 4-83

General APIs 61
Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set DDNS config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&DDNS[0].Address=w
ww.ttt.com&DDNS[0].Enable=true
Success OK
Return
Comment index in below ParamName is the DDNS protocol table index, start from 0.

Appendix:

ParamName ParamValue type Description


DDNS[index].Address string DDNS server IP address or name.
Da

Multiple DDNS hostname can be configured,


hu

DDNS[index].Enable bool but Only one hostname can be enabled,


a

others should be disabled.


HT

DDNS[index].HostName String Hostname of this device.


Range is [1—65535].
TP

DDNS[index].KeepAlive integer
Unit is minutes.
AP

DDNS[index].Password string DDNS user password


I

Range is [1—65535].
DDNS[index].Port integer
Port of DDNS server
fo

DDNS protocol type.


r

Range is {"NO-IP DDNS", "Dyndns DDNS",


We

DDNS[index].Protocol string
"Private DDNS", "DHDDNS", "QUICK
st

DDNS"}.
DDNS[index].UserName string DDNS user name
Eu

Only protocol is in range {"Private DDNS",


ro

DDNS[index].DefaultHostName "DHDDNS", "QUICK DDNS"}, it effects.


bool
pe

.Enable true : use the DefaultHostName.HostName


false: use the HostName
Te

DDNS[index].DefaultHostName
string The default hostname. It cannot be modified.
c

.HostName
hn
ic

4.7.5 Email
a l

 Get email config

Table 4-84
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Email
Method GET
Description Get Email config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Email
table.Email.Address=www.ttt.com
Success table.Email.Anonymous=true
Return table.Email.AttachEnable=true
table.Email.AttachmentEnable=true

General APIs 62
table.Email.Enable=true
table.Email.HealthReport.Enable=false
table.Email.HealthReport.Interval=61
table.Email.Password=123456
table.Email.Port=26
table.Email.Receivers[0]=x@tttt.com
table.Email.Receivers[1]=y@ttt.com
table.Email.Receivers[2]=z@ttt.com
table.Email.SendAddress=x@ttt.com
table.Email.SslEnable=false
table.Email.Title=DVRMessage
table.Email.UserName=anonymity
Comment —
Da

 Set email config


hu

Table 4-85
a

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
HT

alue>[&<paramName>=<paramValue>…]
TP

Method GET
Description Set Email config.
AP

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Email.Address=mail.
Example
I

ttt.com&Email.Anonymous=false
fo

Success
OK
r

Return
Comment —
We
st

Appendix:

ParamName ParamValue type Description


Eu

Email. Address string SMTP server IP address or name.


ro

Email. Anonymous bool Enable/Disable anonymous email.


pe

Email. AttachEnable bool Enable/Disable email attachment


Email.
Te

bool Enable/Disable email attachment


AttachmentEnable
c hn

Email. Enable bool Enable/Disable email function


ic

Email. Enable/Disable report device status by


bool
HealthReport.Enable email.
a l

Email. Range is [30-1440].


integer
HealthReport.Interval Unit is minutes
Email. Password string User password of email account.
Email. Port integer Range is [1-65535]
Email. Receivers[0] string
Email. Receivers[1] string Email addresses of 3 receivers.
Email. Receivers[2] string
Email. SendAddress string Sender email address.
Email. SslEnable bool True: enable SSL email.
Email. Title string Title of email.
Email. UserName string User name of email account.

General APIs 63
4.7.6 WLan
 Get WLan config

Table 4-86
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=WLan
Method GET
Description Get Wlan config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=WLan
table.WLan.eth2.Enable=true
table.WLan.eth2.Encryption=off
table.WLan.eth2.KeyFlag=false
table.WLan.eth2.KeyID=0
Da

table.WLan.eth2.KeyType=Hex
Success
hu

table.WLan.eth2.Keys[0]=password1
Return
a

table.WLan.eth2.Keys[1]=password2
table.WLan.eth2.Keys[2]=password3
HT

table.WLan.eth2.Keys[3]=password4
TP

table.WLan.eth2.LinkMode=Auto
table.WLan.eth2.SSID=ttt
AP

Comment —
I

 Set WLan config


fo

Table 4-87
r

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
We

Syntax
alue>[&<paramName>=<paramValue>…]
st

Method GET
Description Set WLan config.
Eu

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&WLan.eth2.Enable=t
ro

Example
rue&WLan.eth2.KeyType=Hex
pe

Success
OK
Return
Te

Comment In below ParamName, interface is name of wireless interface.


c hn

Appendix:
ic

ParamName ParamValue type Description


a l

WLan.interface.Enable bool True: Enable WLan on this interface.


Range is {Off, On, WEP64Bits, WEP128Bits,
WLan.interface.Encryption string WPA-PSK-TKIP, WPA-PSK-CCMP}
Encryption mode.
WLan.interface.KeyFlag bool true: key is configured.
Range is [0—3]
WLan.interface.KeyID integer Indicates which key is used.
0: WLan.interface.Keys[0] is used.
WLan.interface.KeyType string Range is {Hex, ASCII]
WLan.interface.Keys[0] string For ASCII key type: 64bits encryption key length is 5,
WLan.interface.Keys[1] string 128bits encryption key length is 13, consists of [0—9,

General APIs 64
ParamName ParamValue type Description
WLan.interface.Keys[2] string a—z, A—Z]
For HEX key type: 64bits encryption key length is 10,
WLan.interface.Keys[3] string 128bits encryption key length is 26, consists of [0—9,
a—z, A—Z]
Range is {Auto, Ad-hoc, and Infrastructure}.
Auto – select suitable mode automatically.
Ad-hoc – Device with wireless network adapter can
WLan.interface.LinkMode string connect to each other without Access Point.
Infrastructure – Integrate wire and wireless LAN
together to share network resource, access point is
need in this mode.
WLan.interface.SSID string SSID.
Da
hu

4.7.7 Scan Wlan Devices


a

Table 4-88
HT

http://<server>/cgi-bin/wlan.cgi?action=scanWlanDevices&<paramName>=<paramVal
TP

Syntax
ue>[&<paramName>=<paramValue>…]
AP

Method GET
Description Search Wi-Fi device information.
I

http://192.168.1.108/cgi-bin/wlan.cgi?action=scanWlanDevices&SSID=xia_yuguo
fo

Example
13098 Internet
r

found=1
We

wlanDevice[0].ApConnected=0
st

wlanDevice[0].ApMaxBitRate=54000000
wlanDevice[0].ApNetWorkType=255
Eu

wlanDevice[0].AuthMode=7
Success
ro

wlanDevice[0].BSSID=28:2c:b2:5c:de:36
Return
pe

wlanDevice[0].EncrAlgr=3
wlanDevice[0].LinkMode=0
Te

wlanDevice[0].LinkQuality=31
c

wlanDevice[0].RSSIQuality=0
hn

wlanDevice[0].SSID=xia_yuguo 13098 Internet


ic

Comment —
a l

Appendix:

ParamName ParamValue type Description


Specified SSID, if not include any SSID, all Wi-Fi information
SSID string
will be searched and displayed.

4.7.8 UPnP
 Get UPnP config

Table 4-89
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=UPnP

General APIs 65
Method GET
Description Get UPnP config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=UPnP
Success table.UPnP.Enable=true
Return table.UPnP.MapTable[index].Enable=true
table.UPnP.MapTable[index].InnerPort=80
table.UPnP.MapTable[index].OuterPort=8080
table.UPnP.MapTable[index].Protocol=TCP
table.UPnP.MapTable[index].ServiceName=HTTP
Comment index in response is the UPNP map table index, start from 0.
 Set UPnP config

Table 4-90
Da

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
alue>[&<paramName>=<paramValue>…]
hu

Method GET
a

Description Set UPnP config.


HT

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&UPnP.Enable=true&
TP

UPnP.MapTable[0].Protocol=TCP
Success OK
AP

Return
I

Comment index in below ParamName is UPNP map table index, range is [0-255]
fo

Appendix:
r
We

ParamName ParamValue type Description


UPnP.Enable bool Enable/Disable UPNP feature.
st

UPnP.MapTable[index].Enable bool Enable/Disable this UPNP map.


Eu

Range is [1—65535].
UPnP.MapTable[index].InnerPort integer
ro

Inner port number


Range is [1—65535].
pe

UPnP.MapTable[index].OuterPort integer
Outer port number.
Te

UPnP.MapTable[index].Protocol string Range is {TCP, UDP]


UPnP.MapTable[index].ServiceName string User defined UPnP service name.
c hn
ic

4.7.9 Get UPnP Status


a l

Table 4-91
Syntax http://<server>/cgi-bin/netApp.cgi?action=getUPnPStatus
Method GET
Description Get UPnP Status.
Example http://192.168.1.108/cgi-bin/netApp.cgi?action=getUPnPStatus
status.InnerAddress=0.0.0.0
status.OuterAddress=0.0.0.0
Success status.PortMapStatus[0]=Failed
Return status.PortMapStatus[1]=Failed
status.PortMapStatus[2]=Failed
status.PortMapStatus[3]=Failed

General APIs 66
status.Status=Unknown
status.Working=false
Comment —

4.7.10 NTP
 Get NTP config

Table 4-92
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=NTP
Method GET
Description Get NTP config
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=NTP
Da

table.NTP.Address=clock.isc.org
table.NTP.Enable=false
hu

Success
table.NTP.Port=38
a

Return
table.NTP.TimeZone=9
HT

table.NTP.UpdatePeriod=31
TP

Comment —
 Set NTP config
AP

Table 4-93
I

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
fo

Syntax
Value>[&<paramName>=<paramValue>…]
r

Method GET
We

Description Set NTP config.


st

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NTP.Address=time.tt
Example
t.com&NTP.Enable=true
Eu

Success
OK
ro

Return
pe

Comment —
Te

4.7.11 RTSP
c hn

 Get RTSP config


ic

Table 4-94
a l

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=RTSP
Method GET
Description Get RTSP config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RTSP
table.RTSP.Enable=true
Success table.RTSP.Port=554
Return table.RTSP.RTP.EndPort=40000
table.RTSP.RTP.StartPort=20000
Comment —
 Set RTSP config

General APIs 67
Table 4-95
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
Syntax
Value>[&<paramName>=<paramValue>…]
Method GET
Description Set RTSP config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&RTSP.Enable=true&
Example
RTSP.Port=554
Success
OK
Return
Comment —

Appendix:

ParamName ParamValue type Description


Da

RTSP.Enable bool Enable/Disable RTSP.


hu

RTSP.Port integer RTSP port.


a

RTSP.RTP.StartPort integer RTP start port.


HT

RTSP.RTP.EndPort integer RTP end port.


TP

4.7.12 Alarm Server


AP
I

 Get alarm server config


fo

Table 4-96
r

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AlarmServer
We

Method GET
Description Get alarm server config.
st

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AlarmServer
Eu

table.AlarmServer.Address=10.7.8.9
ro

table.AlarmServer.Enable=false
table.AlarmServer.Password=
pe

Success table.AlarmServer.Port=8888
Te

Return table.AlarmServer.Protocol=ttt
table.AlarmServer.ReportTime=02:00:00
c hn

table.AlarmServer.ReportWeekDay=2
ic

table.AlarmServer.UserName=admin

a

Comment
l

 Set alarm server config

Table 4-97
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
Syntax
Value>[&<paramName>=<paramValue>…]
Method GET
Description Set Alarm Server config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AlarmServer.Addres
Example
s=as.ttt.com&AlarmServer.Enable=false
Success
OK
Return

General APIs 68
Comment —

Appendix:

ParamName ParamValue type Description


AlarmServer. Address string Alarm server IP address or name.
AlarmServer. Enable bool Enable/Disable Alarm server.
Range is [1—65535].
AlarmServer. Port integer
Port of Alarm server.

4.8 Motion Detection

4.8.1 Motion Detection Settings


Da

 Get motion detect config


hu
a

Table 4-98
HT

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect
Method GET
TP

Description Motion detect config of a video channel contains Enable, MotionDetectWindow and
AP

EventHandler.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect
I

Success table.MotionDetect[0].Enable=false
fo

Return table.MotionDetect[0].EventHandler.AlarmOut=1
r

table.MotionDetect[0].EventHandler.AlarmOutChannels[0]=0
We

table.MotionDetect[0].EventHandler.AlarmOutEnable=true
st

table.MotionDetect[0].EventHandler.AlarmOutLatch=10
table.MotionDetect[0].EventHandler.BeepEnable=false
Eu

table.MotionDetect[0].EventHandler.Dejitter=5
ro

table.MotionDetect[0].EventHandler.Delay=0
pe

table.MotionDetect[0].EventHandler.ExAlarmOut=1
table.MotionDetect[0].EventHandler.ExAlarmOutChannels[0]=0
Te

table.MotionDetect[0].EventHandler.ExAlarmOutEnable=false
c

table.MotionDetect[0].EventHandler.FlashEnable=false
hn

table.MotionDetect[0].EventHandler.FlashLatch=10
ic

table.MotionDetect[0].EventHandler.LogEnable=true
a

table.MotionDetect[0].EventHandler.MailEnable=false
l

table.MotionDetect[0].EventHandler.Matrix=1
table.MotionDetect[0].EventHandler.MatrixChannels[0]=0
table.MotionDetect[0].EventHandler.MatrixEnable=false
table.MotionDetect[0].EventHandler.MessageEnable=false
table.MotionDetect[0].EventHandler.PtzLink[0][0]=None
table.MotionDetect[0].EventHandler.PtzLink[0][1]=1
table.MotionDetect[0].EventHandler.PtzLinkEnable=false
table.MotionDetect[0].EventHandler.Record=1
table.MotionDetect[0].EventHandler.RecordChannels[0]=0
table.MotionDetect[0].EventHandler.RecordEnable=true
table.MotionDetect[0].EventHandler.RecordLatch=10

General APIs 69
table.MotionDetect[0].EventHandler.Snapshot=1
table.MotionDetect[0].EventHandler.SnapshotChannels[0]=0
table.MotionDetect[0].EventHandler.SnapshotEnable=false
table.MotionDetect[0].EventHandler.TimeSection[0][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][3]=0 00:00:00-23:59:59
Da

table.MotionDetect[0].EventHandler.TimeSection[1][4]=0 00:00:00-23:59:59
hu

table.MotionDetect[0].EventHandler.TimeSection[1][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][0]=1 00:00:00-23:59:59
a

table.MotionDetect[0].EventHandler.TimeSection[2][1]=0 00:00:00-23:59:59
HT

table.MotionDetect[0].EventHandler.TimeSection[2][2]=0 00:00:00-23:59:59
TP

table.MotionDetect[0].EventHandler.TimeSection[2][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][4]=0 00:00:00-23:59:59
AP

table.MotionDetect[0].EventHandler.TimeSection[2][5]=0 00:00:00-23:59:59
I

table.MotionDetect[0].EventHandler.TimeSection[3][0]=1 00:00:00-23:59:59
fo

table.MotionDetect[0].EventHandler.TimeSection[3][1]=0 00:00:00-23:59:59
r

table.MotionDetect[0].EventHandler.TimeSection[3][2]=0 00:00:00-23:59:59
We

table.MotionDetect[0].EventHandler.TimeSection[3][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][4]=0 00:00:00-23:59:59
st

table.MotionDetect[0].EventHandler.TimeSection[3][5]=0 00:00:00-23:59:59
Eu

table.MotionDetect[0].EventHandler.TimeSection[4][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][1]=0 00:00:00-23:59:59
ro

table.MotionDetect[0].EventHandler.TimeSection[4][2]=0 00:00:00-23:59:59
pe

table.MotionDetect[0].EventHandler.TimeSection[4][3]=0 00:00:00-23:59:59
Te

table.MotionDetect[0].EventHandler.TimeSection[4][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][5]=0 00:00:00-23:59:59
c hn

table.MotionDetect[0].EventHandler.TimeSection[5][0]=1 00:00:00-23:59:59
ic

table.MotionDetect[0].EventHandler.TimeSection[5][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][2]=0 00:00:00-23:59:59
a l

table.MotionDetect[0].EventHandler.TimeSection[5][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TipEnable=false
table.MotionDetect[0].EventHandler.Tour=1

General APIs 70
table.MotionDetect[0].EventHandler.TourChannels[0]=0
table.MotionDetect[0].EventHandler.TourEnable=false
table.MotionDetect[0].EventHandler.Voice.AudioFileName=
table.MotionDetect[0].EventHandler.VoiceEnable=false
table.MotionDetect[0].MotionDetectWindow[0].Id=0
table.MotionDetect[0].MotionDetectWindow[0].Name=Region1
table.MotionDetect[0].MotionDetectWindow[0].Region[0]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[1]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[2]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[3]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[4]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[5]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[6]=4194303
Da

table.MotionDetect[0].MotionDetectWindow[0].Region[7]=4194303
hu

table.MotionDetect[0].MotionDetectWindow[0].Region[8]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[9]=4194303
a

table.MotionDetect[0].MotionDetectWindow[0].Region[10]=4194303
HT

table.MotionDetect[0].MotionDetectWindow[0].Region[11]=4194303
TP

table.MotionDetect[0].MotionDetectWindow[0].Region[12]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[13]=4194303
AP

table.MotionDetect[0].MotionDetectWindow[0].Region[14]=4194303
I

table.MotionDetect[0].MotionDetectWindow[0].Region[15]=4194303
fo

table.MotionDetect[0].MotionDetectWindow[0].Region[16]=4194303
r

table.MotionDetect[0].MotionDetectWindow[0].Region[17]=4194303
We

table.MotionDetect[0].MotionDetectWindow[0].Sensitive=60
table.MotionDetect[0].MotionDetectWindow[0].Threshold=5
st

table.MotionDetect[0].MotionDetectWindow[0].Window[0]=0
Eu

table.MotionDetect[0].MotionDetectWindow[0].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[0].Window[2]=8191
ro

table.MotionDetect[0].MotionDetectWindow[0].Window[3]=8191
pe

table.MotionDetect[0].MotionDetectWindow[1].Id=1
Te

table.MotionDetect[0].MotionDetectWindow[1].Name=Region2
table.MotionDetect[0].MotionDetectWindow[1].Region[0]=0
c hn

table.MotionDetect[0].MotionDetectWindow[1].Region[1]=0
ic

table.MotionDetect[0].MotionDetectWindow[1].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[3]=0
a l

table.MotionDetect[0].MotionDetectWindow[1].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[9]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[14]=0

General APIs 71
table.MotionDetect[0].MotionDetectWindow[1].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[1].Sensitive=60
table.MotionDetect[0].MotionDetectWindow[1].Threshold=5
table.MotionDetect[0].MotionDetectWindow[1].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[3]=0
table.MotionDetect[0].MotionDetectWindow[2].Id=2
table.MotionDetect[0].MotionDetectWindow[2].Name=Region3
table.MotionDetect[0].MotionDetectWindow[2].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[1]=0
Da

table.MotionDetect[0].MotionDetectWindow[2].Region[2]=0
hu

table.MotionDetect[0].MotionDetectWindow[2].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[4]=0
a

table.MotionDetect[0].MotionDetectWindow[2].Region[5]=0
HT

table.MotionDetect[0].MotionDetectWindow[2].Region[6]=0
TP

table.MotionDetect[0].MotionDetectWindow[2].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[8]=0
AP

table.MotionDetect[0].MotionDetectWindow[2].Region[9]=0
I

table.MotionDetect[0].MotionDetectWindow[2].Region[10]=0
fo

table.MotionDetect[0].MotionDetectWindow[2].Region[11]=0
r

table.MotionDetect[0].MotionDetectWindow[2].Region[12]=0
We

table.MotionDetect[0].MotionDetectWindow[2].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[14]=0
st

table.MotionDetect[0].MotionDetectWindow[2].Region[15]=0
Eu

table.MotionDetect[0].MotionDetectWindow[2].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[17]=0
ro

table.MotionDetect[0].MotionDetectWindow[2].Sensitive=60
pe

table.MotionDetect[0].MotionDetectWindow[2].Threshold=5
Te

table.MotionDetect[0].MotionDetectWindow[2].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[2].Window[1]=0
c hn

table.MotionDetect[0].MotionDetectWindow[2].Window[2]=0
ic

table.MotionDetect[0].MotionDetectWindow[2].Window[3]=0
table.MotionDetect[0].MotionDetectWindow[3].Id=3
a l

table.MotionDetect[0].MotionDetectWindow[3].Name=Region4
table.MotionDetect[0].MotionDetectWindow[3].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[9]=0

General APIs 72
table.MotionDetect[0].MotionDetectWindow[3].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[14]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[3].Sensitive=60
table.MotionDetect[0].MotionDetectWindow[3].Threshold=5
table.MotionDetect[0].MotionDetectWindow[3].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[2]=0
Da

table.MotionDetect[0].MotionDetectWindow[3].Window[3]=0
hu

table.MotionDetect[0].OsdTwinkleEnable=false
table.MotionDetect[0].PirMotionLevel=3
a

Comment —
HT

 Set motion detect config


TP

Table 4-99
AP

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
I

alue>[&<paramName>=<paramValue>…]
fo

Method GET
Description Set motion detection config.
r

Enable motion detection:


We

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MotionDetect[0].Ena
st

ble=true
Eu

Set motion detection regions:


ro

Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MotionDetect[0].Moti
pe

onDetectWindow[0].Region[0]=1&MotionDetect[0].MotionDetectWindow[0].Region[1]=
1&MotionDetect[0].MotionDetectWindow[0].Region[2]=1&MotionDetect[0].MotionDetec
Te

tWindow[0].Region[3]=1&MotionDetect[0].MotionDetectWindow[0].Region[4]=1&Motion
c

Detect[0].DetectVersion=V3.0
hn

Success
ic

OK
Return
a l

In table below,
head = MotionDetect[ChannelNo]
ChannelNo: integer, array index starts from 0, which means video channel(equals to
video channel index -1, and so 0 means channel 1).
LineNum
Comment Index of region, region is divided into lines and each line has several blocks, a line is
described by a 32 bit integer, a bit for a block.
0=Line 1
1=Line 2

WinNum

General APIs 73
Index of detect window, there are 4 detect windows at present. Each window is divided
into 18 lines and 22 blocks per line.

Notice: When setting


"MotionDetect[ChannelNo].MotionDetectWindow[WinNum].Region", you need to
contain the parameter "MotionDetect[ChannelNo].DetectVersion=V3.0" along.

Appendix:

ParamName ParamValue type Description


head. Enable bool Enable/Disable motion detect feature in a channel.
Setting of EventHandler is described in
head. EventHandler —
SetEventHandler.
head.MotionDetectWin
Da

integer It is the Id of a detect window.


dow [WinNum].Id
hu

head.MotionDetectWin
string It is the name of a detect window.
a

dow [WinNum].Name
HT

head.MotionDetectWin Range is [0—100].


dow integer Sensitivity of motion detection.
TP

[WinNum].Sensitive It presents more sensitive if the value is larger.


AP

head.MotionDetectWin Range is [0—100].


I

dow integer It presents the threshold value when trigger motion


[WinNum].Threshold detect.
fo

It is similar with head.Region [LineNum].


r

Currently, a region is divided into 18 lines and 22 blocks


We

per line.
st

A bit describes a block in the line.


head.MotionDetectWin Bit = 1: motion in this block is monitored.
Eu

dow Example:
integer
ro

[WinNum].Region[Line MotionDetect [0].Region [0] = 4194303 (0x3FFFFF): the


pe

Num] 22 blocks in channel 0 line 0 is monitored.


MotionDetect [0].Region [1] =0: the 22 blocks in channel
Te

0 line 1 is not monitored.


c

MotionDetect [0].Region [17] = 3: the left two blocks in


hn

the last line of channel 0 is monitored.


ic
a

4.9 Event
l

4.9.1 Event Handler


 Get event handler config

Table 4-100
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=<handlerName>
Method GET
Description Get event handler settings.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Alarm[0].Eve

General APIs 74
ntHandler
handlerName.EventHandler.AlarmOutChannels[0]=1
handlerName.EventHandler.AlarmOutChannels[1]=1

handlerName.EventHandler.AlarmOutEnable=false
handlerName.EventHandler.AlarmOutLatch=10
handlerName.EventHandler.BeepEnable=true
handlerName.EventHandler.Dejitter=0
handlerName.EventHandler.Delay=30
handlerName.EventHandler.LogEnable=true
handlerName.EventHandler.MailEnable=true
handlerName.EventHandler.PtzLink[0][0]=None
handlerName.EventHandler.PtzLink[0][1]=0
Da

handlerName.EventHandler.PtzLink[1][0]=None
hu

handlerName.EventHandler.PtzLink[1][1]=0

a

handlerName.EventHandler.PtzLinkEnable=false
HT

handlerName.EventHandler.RecordChannels[0]=1
TP

Success handlerName.EventHandler.RecordChannels[1]=1
Return …
AP

handlerName.EventHandler.RecordEnable=true
I

handlerName.EventHandler.RecordLatch=10
fo

handlerName.EventHandler.SnapshotChannels[0]=1
r

handlerName.EventHandler.SnapshotChannels[1]=1
We


handlerName.EventHandler.SnapshotEnable=false
st

handlerName.EventHandler.SnapshotPeriod=3
Eu

handlerName.EventHandler.SnapshotTimes=0
ro

handlerName.EventHandler.TimeSection[0][0]=1 01:00:00-24:00:00
handlerName.EventHandler.TimeSection[0][1]=1 01:00:00-24:00:00…
pe


Te

handlerName.EventHandler.TimeSection[6][5]=1 01:00:00-24:00:00
handlerName.EventHandler.TipEnable=true
c hn

handlerName.EventHandler. ExAlarmOutEnable=true
ic

handlerName.ExAlarmOutChannels[0] =2
handlerName.ExAlarmOutChannels[1]=3
a l


Parameters in URL:
handlerName can be one of below four formats:
Alarm[ChannelNo].EventHandler
Comment
MotionDetect [ChannelNo]. EventHandler
BlindDetect [ChannelNo]. EventHandler
LossDetect [ChannelNo]. EventHandler
 Set event handler config

Table 4-101
Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV

General APIs 75
alue>[&<paramName>=<paramValue>…]
Method GET
Description Modify event handler settings.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Alarm[0].EventHandl
Example
er.AlarmOutChannels[0]=1&Alarm[0].EventHandler.AlarmOutEnable=true
Success
OK
Return
Comment In below paramName, Meaning of handlerName is the same with GetEventHandler.

Appendix:

paramName paramValue type Description


ch is alarm out channel
index which starts from 0.
Da

Range is {0, 1},


hu

handlerName.EventHandler.AlarmOutChannels[ch] integer 0 — do not output alarm at


a

alarm out channel ch


1 — output alarm at alarm
HT

out channel ch
TP

Enable/Disable alarm out


handlerName.EventHandler.AlarmOutEnable bool
AP

function.
Range is [10—300].
I

Unit is seconds, indicates


fo

handlerName.EventHandler.AlarmOutLatch Integer
the time to output alarm
r

after input alarm is cleared.


We

handlerName.EventHandler.BeepEnable bool Enable/Disable beep.


st

Range is [0—255].
Alarm signal dejitter
Eu

handlerName.EventHandler.Dejitter integer seconds. Alarm signal


ro

change during this period is


pe

ignored.
Range is [0—300].
Te

handlerName.EventHandler.Delay integer Delay seconds before


c

setting take effect.


hn

Enable/Disable log for


ic

handlerName.EventHandler.LogEnable bool
alarm.
a

Enable/Disable mail send


l

handlerName.EventHandler.MailEnable bool
for alarm.
Range is {None, Preset,
Tour, Pattern}
This is PTZ action linked
handlerName.EventHandler.PtzLink[ch][0] string
with events.
ch is PTZ channel index
which starts from 0.

General APIs 76
paramName paramValue type Description
This is the parameter of
PtzLink[ch][0],
If PtzLink[ch]][0] is
Preset: this is preset point.
handlerName.EventHandler.PtzLink[ch][1] integer
Tour: this is tour path
number.
Pattern: this is pattern
number.
handlerName.EventHandler.PtzLinkEnable Bool Enable/Disable PTZ link.
Range is {0, 1}
0 – do not record on video
handlerName.EventHandler.RecordChannels[ch] Integer channel ch
Da

1 – record. on video
hu

channel ch
a

Enable/Disable record
handlerName.EventHandler.RecordEnable bool
function.
HT

Range is [10—300].
TP

Unit is seconds, indicates


handlerName.EventHandler.RecordLatch integer
the time to record after
AP

input alarm is cleared.


I

Range is {0, 1}
fo

0 — do not snapshot on
r

handlerName.EventHandler.SnapshotChannels[ch] integer video channel ch


We

1 — snapshot on video
st

channel ch
Enable/Disable snapshot
handlerName.EventHandler.SnapshotEnable bool
Eu

function.
ro

Range is [0—255].
pe

Frames between
handlerName.EventHandler.SnapshotPeriod integer snapshots.
Te

0 means continuously
c

snapshot for every frame.


hn

Range is [0—65535]
ic

Snapshot times before


handlerName.EventHandler.SnapshotTimes integer
a

stop, 0 means don't stop


l

snapshot.

General APIs 77
paramName paramValue type Description
It's an effective time period
for eventHanlder everyday.
wd (week day) range is [0—
6] (Sunday—Saturday)
ts (time section) range is
[0-23], it's index of time
section table.

Format: mask
hh:mm:ss-hh:mm:ss
Mask: {0,1}, hh: [0 — 24],
handlerName.EventHandler.TimeSection[wd][ts] String mm: [00—59], ss: [00—59]
Da

Mask 0: this time section is


hu

not used.
Mask 1: this time section is
a

used.
HT
TP

Example:
TimeSection[1][0]=1
AP

12:00:00-18:00:00
I

Means EventHandler is
fo

effective between 12:00:00


r

and 18:00:00 at Monday.


We

Enable/Disable local
handlerName.EventHandler.TipEnable bool
st

message box tip.


Enable/Disable extend
handlerName.EventHandler.ExAlarmOutEnable bool
Eu

alarm out ability


ro

handlerName.ExAlarmOutChannels[ch] integer extend alarm out channels


pe

4.9.2 Alarm Event


Te
c

 Get alarm config


hn

Table 4-102
ic

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Alarm
a l

Method GET
Description Get alarm config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Alarm
table.Alarm[0].Enable=false
table.Alarm[0].EventHandler….(output of EventHandler is described in
GetEventHandler)
Success
table.Alarm[0].Name=Door1
Return
table.Alarm[0].SensorType=NC
table.Alarm[1]….

Comment —

General APIs 78
 Set alarm config

Table 4-103
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramVal
Syntax
ue>[&<paramName>=<paramValue>…]
Method GET
Description Set alarm config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Alarm[0].Enable=true
Success
OK
Return
In below ParamName, input is external alarm input channel which starts from 0.
Comment EventHandler defines parameter of relevant actions when alarm or event happens. It's
also used in following sections about events.
Da

Appendix:
hu

ParamName ParamValue type Description


a

Alarm[input].Enable bool Enable/Disable alarm from a input channel


HT

Setting of EventHandler is described in


Alarm[input].EventHandler —
TP

SetEventHandler.
Alarm[input].Name string Name of alarm input channel.
AP

Range is {NC, NO].


I

Alarm[input].SensorType string NC: normal close


fo

NO: normal open


r

4.9.3 Alarm Out


We
st

 Get alarm out config


Eu

Table 4-104
ro

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AlarmOut
pe

Method GET
Description Get alarm out config.
Te

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AlarmOut
c

Success table.AlarmOut[alarmOutChannel].Mode=0
hn

Return table.AlarmOut[alarmOutChannel].Name=Beep
ic

Parameters in Response:
a

Comment
alarmOutChannel: the alarm out channel index which starts from 0.
l

 Set alarm out config

Table 4-105
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set alarm out config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AlarmOut[0].Mode=0
Example
&AlarmOut[0].Name=port1
Success
OK
Return

General APIs 79
Comment port in below ParamName is alarm out port index, start form 0.

Appendix:

ParamName ParamValue type Description


Range is {0, 1, 2}
0: automatically alarm
AlarmOut[port].Mode integer
1: force alarm
2: close alarm
AlarmOut[port].Name string Alarm out port name.

4.9.4 Get Alarm Input Channels


Table 4-106
Da

Syntax http://<server>/cgi-bin/alarm.cgi?action=getInSlots
hu

Method GET
a

Description Get alarm input channel number.


HT

Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getInSlots
Success
TP

result=2
Return
AP

Comment —
I

4.9.5 Get Alarm Output Channels


fo
r

Table 4-107
We

Syntax http://<server>/cgi-bin/alarm.cgi?action=getOutSlots
st

Method GET
Description Get alarm output channel number.
Eu

Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getOutSlots
ro

Success
result=1
pe

Return
Comment —
Te
c

4.9.6 Get States of Alarm Input Channels


hn
ic

Table 4-108
a

Syntax http://<server>/cgi-bin/alarm.cgi?action=getInState
l

Method GET
Description Get alarm input state for all channels.
Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getInState
Success
result=3
Return
A bit in the response result indicates a channel alarm states, result 3 means alarm
Comment
channel 1 and channel 2 have alarm now.

General APIs 80
4.9.7 Get States of Alarm Output Channels
Table 4-109
Syntax http://<server>/cgi-bin/alarm.cgi?action=getOutState
Method GET
Description Get alarm output state for all channels.
Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getOutState
Success
result=0
Return
Comment A bit in the response result indicates a channel, result 1 means alarm is present.

4.9.8 Video Blind Event


Da

 Get video blind detect config


hu
a

Table 4-110
HT

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=BlindDetect
Method GET
TP

Description Get blind detect config.


AP

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=BlindDetect
I

head. Enable=false
Success
head. EventHandler= (output of EventHandler is described in GetEventHandler)
fo

Return
head. Level=3
r

Parameters in Response:
We

head= table.BlindDetect[ChannelNo]
Comment
st

ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
Eu

 Set video blind detect config


ro

Table 4-111
pe

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Te

Method GET
c hn

Description Set blind detect config.


ic

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&BlindDetect[0].Enabl
Example
e=true
a l

Success
OK
Return
Parameters in URL:
In table below,
Comment head= BlindDetect[ChannelNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).

Appendix:

ParamName ParamValue type Description


head. Enable bool Enable/Disable blind detect feature.

General APIs 81
ParamName ParamValue type Description
Setting of EventHandler is described in
head. EventHandler —
SetEventHandler.
Range is [1—6].
Sensitivity of blind detection.
head. Level integer
1: lowest sensitivity.
6: highest sensitivity.

4.9.9 Video Loss Event


 Get video loss detect config

Table 4-112
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=LossDetect
Da

Method GET
hu

Description Get video loss detect config.


a

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=LossDetect
HT

Success head. Enable=false


TP

Return head. EventHandler= (output of EventHandler is described in GetEventHandler)


Parameters in Response:
AP

head=table.LossDetect [ChannelNo]
Comment
I

ChannelNo: integer, array index starts from 0, which means video channel (equals to
fo

video channel index -1, and so 0 means channel 1).


r

 Set video loss detect config


We

Table 4-113
st

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Eu

Method GET
ro

Description Set video loss detection config.


pe

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&LossDetect[0].Enabl
Example
e=true
Te

Success
OK
c

Return
hn

Parameters in URL:
ic

In table below,
a

Comment head= LossDetect [ChannelNo]


l

ChannelNo: integer, array index starts from 0, which means video channel(equals to
video channel index -1, and so 0 means channel 1).

Appendix:

ParamName ParamValue type Description


head. Enable bool Enable/Disable loss detect feature.
Setting of EventHandler is described in
head. EventHandler —
SetEventHandler.

General APIs 82
4.9.10 Login Failure Event
 Get login failure event config

Table 4-114
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=LoginFailureAlarm
Method GET
Description Get login failure alarm config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=LoginFailureA
Example
larm
Success head. Enable=false
Return head. EventHandler= (output of EventHandler is described in GetEventHandler)
Parameters in Response:
Comment
Da

head= table.LoginFailureAlarm
hu

 Set login failure alarm config


a

Table 4-115
HT

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
TP

alue>[&<paramName>=<paramValue>…]
Method GET
AP

Description Set login failure alarm config.


I

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&LoginFailureAlarm.E
Example
fo

nable=true
r

Success
OK
Return
We

Parameters in URL:
st

Comment In table below,


Eu

head= LoginFailureAlarm
ro

Appendix:
pe

ParamName ParamValue type Description


Te

Enable/Disable to notify LoginFailure event. Now this


event can be linked with send email and alarm out.
c

head. Enable bool


hn

The max try login times can be configured in chapter


ic

SetGeneralConfig.
Setting of EventHandler is described in
a

head. EventHandler —
l

SetEventHandler.

4.9.11 Storage Not Exist Event


 Get storage not exist event config

Table 4-116
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageNotExist
Method GET
Description Get storage not exist event config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=StorageNotEx

General APIs 83
ist
StorageNotExist.Enable=false
Success
StorageNotExist.EventHandler= (output of EventHandler is described in
Return
GetEventHandler)
Comment —
 Set storage not exist event config

Table 4-117
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set storage not exist event config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageNotExist.Ena
Example
Da

ble=true
Success
hu

OK
Return
a

Comment —
HT

Appendix:
TP

ParamName ParamValue type Description


AP

StorageNotExist.Enable bool Enable/Disable loss detect feature.


I

Setting of EventHandler is described in



fo

StorageNotExist.EventHandler
SetEventHandler.
r
We

4.9.12 Storage Access Failure Event


st

 Get storage access failure event config


Eu

Table 4-118
ro

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageFailure
pe

Method GET
Description Get storage failure event config.
Te

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=StorageFailur
c

Example
hn

e
StorageFailure.Enable=false
ic

Success
StorageFailure.EventHandler= (output of EventHandler is described in
a

Return
l

GetEventHandler)
Comment —
 Set storage access failure event config

Table 4-119
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set storage failure event config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageFailure.Enabl
Example
e=true

General APIs 84
Success
OK
Return
Comment —

Appendix:

ParamName ParamValue type Description


StorageFailure.Enable bool Enable/Disable loss detect feature.
Setting of EventHandler is described in
StorageFailure.EventHandler —
SetEventHandler.

4.9.13 Storage Low Space Event


 Get storage low space event config
Da

Table 4-120
hu

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageLowSpace
a

Method GET
HT

Description Get storage low space event config.


TP

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=StorageLowS
Example
pace
AP

StorageLowSpace.Enable=false
I

Success
StorageLowSpace.EventHandler= (output of EventHandler is described in
Return
fo

GetEventHandler)
r

Comment —
We

 Set storage low space event config


st

Table 4-121
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Eu

Syntax
alue>[&<paramName>=<paramValue>…]
ro

Method GET
pe

Description Set storage low space event config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageLowSpace.E
Te

Example
nable=true
c hn

Success
OK
Return
ic

Comment —
a l

Appendix:

ParamName ParamValue type Description


StorageLowSpace.Enable bool Enable/Disable loss detect feature.
Setting of EventHandler is described in
StorageLowSpace.EventHandler —
SetEventHandler.

4.9.14 Net Abort Event


 Get net abort event config

Table 4-122

General APIs 85
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=NetAbort
Method GET
Description Get net abort event config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=NetAbort
Success NetAbort.Enable=false
Return NetAbort.EventHandler= (output of EventHandler is described in GetEventHandler)
Comment —
 Set net abort event config

Table 4-123
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Da

Description Set net abort event config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NetAbort.Enable=tru
hu

Example
e
a

Success
HT

OK
Return
TP

Comment —
AP

Appendix:
I

ParamName ParamValue type Description


fo

NetAbort.Enable bool Enable/Disable loss detect feature.


r

Setting of EventHandler is described in


NetAbort.EventHandler —
We

SetEventHandler.
st

4.9.15 IP Conflict Event


Eu
ro

 Get IP conflict event config


pe

Table 4-124
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=IPConflict
Te

Method GET
c hn

Description Get IP conflict event config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=IPConflict
ic

Success IPConflict.Enable=false
a l

Return IPConflict.EventHandler= (output of EventHandler is described in GetEventHandler)


Comment —
 Set IP conflict event config

Table 4-125
Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set IP Conflict event config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&IPConflict.Enable=tr
ue

General APIs 86
Success OK
Return
Comment —

Appendix:

ParamName ParamValue type Description


IPConflict.Enable bool Enable/Disable loss detect feature.
Setting of EventHandler is described in
IPConflict.EventHandler —
SetEventHandler.

4.9.16 Get Channels Event Happened


Table 4-126
Da

http://<server>/cgi-bin/eventManager.cgi?action=getEventIndexes&code=<eventCode
hu

Syntax
>
a

Method GET
HT

Get channels indexes that event of code eventCode happens.


TP

Description Not all events support this command. Do not recommend to use it, use Attach command
instead.
AP

http://192.168.1.108/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AlarmL
Example
I

ocal
channels[0]=0
fo

channels[1]=2
r

Success channels[2]=3
We

Return …
st

(This response means event happened on channel 0, channel 2 and channel 3 while
video channel index starts from 0)
Eu

Parameters in URL:
ro

eventCode includes:
pe

VideoMotion: motion detection event


VideoLoss: video loss detection event
Te

VideoBlind: video blind detection event.


Comment
c

AlarmLocal: alarm detection event.


hn

StorageNotExist: storage not exist event.


ic

StorageFailure: storage failure event.


a

StorageLowSpace: storage low space event.


l

AlarmOutput: alarm output event.

4.9.17 Subscribe to Event Message


Table 4-127
http://<server>/cgi-bin/eventManager.cgi?action=attach&codes=[<eventCode>,<event
Syntax
Code>,…][&keepalive = 20][&heartbeat=<Heartbeat>]
Method GET
Description Subscribe to messages that event of code eventCode happens.
Example http://192.168.1.108/cgi-bin/eventManager.cgi?action=attach&codes=[AlarmLocal%2C

General APIs 87
VideoMotion%2CVideoLoss%2CVideoBlind]

http://192.168.1.108/cgi-bin/eventManager.cgi?action=attach&codes=[All]&heartbeat=5
HTTP Code: 200 OK\r\n
Cache-Control: no-cache\r\n
Pragma: no-cache\r\n
Expires: Thu, 01 Dec 2099 16:00:00 GMT\r\n
Connection: close\r\n
Content-Type: multipart/x-mixed-replace; boundary=<boundary>\r\n
Body:
--<boundary>\r\n
Content-Type: text/plain\r\n
Content-Length: <data length>\r\n
Da

<eventInfo>\r\n\r\n
hu

--<boundary>\r\n
Content-Type: text/plain\r\n
a

Content-Length: <data length>\r\n


HT

<eventInfo>\r\n\r\n
TP

For example:
AP

HTTP Code: 200 OK\r\n


I

Success Cache-Control: no-cache\r\n


fo

Return Pragma: no-cache\r\n


r

Expires: Thu, 01 Dec 2099 16:00:00 GMT\r\n


We

Connection: close\r\n
Content-Type: multipart/x-mixed-replace; boundary=myboundary\r\n\r\n
st

Body:
Eu

--myboundary\r\n
ro

Content-Type: text/plain\r\n
Content-Length: 39\r\n
pe

Code=VideoMotion;action=Start;index=0\r\n\r\n
Te

--myboundary\r\n
Content-Type: text/plain\r\n
c hn

Content-Length: 38\r\n
ic

Code=VideoBlind;action=Start;index=0\r\n\r\n
--myboundary\r\n
a l

Content-Type: text/plain\r\n
Content-Length: 9\r\n
Heartbeat\r\n\r\n
--myboundary\r\n

eventCode can be any one of the standard codes defined in DHIIF, or "All".
All means all kinds of the eventcode.
eventcode include:
Comment
VideoMotion: motion detection event
VideoLoss: video loss detection event
VideoBlind: video blind detection event.

General APIs 88
AlarmLocal: alarm detection event.
CrossLineDetection: tripwire event
CrossRegionDetection: intrusion event
LeftDetection: abandoned object detection
TakenAwayDetection: missing object detection
VideoAbnormalDetection: scene change event
FaceDetection: face detect event
AudioMutation: intensity change
AudioAnomaly: input abnormal
VideoUnFocus: defocus detect event
WanderDetection: loitering detection event
RioterDetection: People Gathering event
ParkingDetection: parking detection event
Da

MoveDetection: fast moving event


hu

StorageNotExist: storage not exist event.


StorageFailure: storage failure event.
a

StorageLowSpace: storage low space event.


HT

AlarmOutput: alarm output event.


TP

MDResult: motion detection data reporting event. The motion detect window
contains 18 rows and 22 columns. The event info contains motion detect data with mask
AP

of every row.
I

HeatImagingTemper: temperature alarm event


fo

CrowdDetection: crowd density overrun event


r

FireWarning: fire warning event


We

FireWarningInfo: fire warning specific data info


In the example, you can see most event info is like "Code=eventcode; action=Start;
st

index=0", but for some specific events, they will contain an another parameter named
Eu

"data", the event info is like "Code=eventcode; action=Start; index=0; data=datainfo",


the datainfo's fomat is JSON(JavaScript Object Notation). The detail information about
ro

the specific events and datainfo are listed in the appendix below this table.
pe
Te

keepalive: If this param exist, the client must send any data to device by this
connection in cycle. The keepalive is in range
c hn

of [1,60] second.
ic

For example:
The keeplive data can be the string "keep alive".
a l

Notice: the keepalive parameter is not recommended to use. It is recommended to use


the Heartbeat parameter.
Heartbeat: integer, range is [1,60],unit is second.If the URL contains this parameter,
and the value is 5, it means every 5 seconds the device should send the heartbeat
message to the client,the heartbeat message are "Heartbeat".
Note: Heartbeat message must be sent before heartbeat timeout.

Appendix A: Coordinate system

General APIs 89
(0,0) 8191,0
X

(0,8191) (8191,8191)

Appendix B: CrossLineDetection

Sample ParamValue type Description


Da

"DetectLine":[ Array The line is a polyline, consist of two more


hu

points.
a

[1292,3469], Point Point info. the first element is the x's


value, and the second is the y's
HT

value.(they should obey the coordinate


TP

system mentioned in the appendix A)


[6535,3373], Point —
AP

"Direction" : "LeftToRight" string It can be "LeftToRight" and "RightToLeft"


I
fo

Example:
r

{
We

"DetectLine":[
st

[1292,3469],
Eu

[6535,3373],
ro

…..
pe

],
Te
c

"Direction" : "LeftToRight"
hn

}
ic
a

Appendix C: CrossRegionDetection
l

Sample ParamValue type Description


The region is a Polygon, consist of three
"DetectRegion":[ Array
more points.
Point info. the first element is the x's
value, and the second is the y's
[1893,2377], Point
value.(they should obey the coordinate
system mentioned in the appendix A)
[5734,2377], Point —
[5661,6296], Point —

General APIs 90
Sample ParamValue type Description
The value can be "Appear", "Disappear",
"Action": "Cross", string
"Cross","Inside"
Ony if the "Action" is "Cross", this element
"Direction" : "Enter" string is valid.
It can be "Enter", "Leave", "Both".

Example:

"DetectRegion":[

[1893,2377],

[5734,2377],
Da
hu

[5661,6296],
a

…..
HT

],
TP

"Action": "Cross",
AP

"Direction" : "Enter"
I
fo

}
r

Appendix D: WanderDetection, RioterDetection, MoveDetection, ParkingDetection


We

Sample ParamValue type Description


st

The region is a Polygon, consist of three


"DetectRegion":[ Array
more points
Eu

Point info. the first element is the x value,


ro

and the second is the y value.(they should


pe

[1893,2377], Point
obey the coordinate system mentioned in
the appendix A)
Te

[5734,2377], Point —
c


hn

[5661,6296], Point
ic

Example:
a l

"DetectRegion":[

[1893,2377],

[5734,2377],

…..

Appendix E: NumberStat

General APIs 91
Sample ParamValue type Description
"Number" : 120, int The number in the region
"EnteredNumber" : 180, int The number enter the region
"ExitedNumber" : 60, int The number leave the region
"Type" : "EnterOver" string It can be "EnterOver", "ExitOver", "InsideOver".

Example:

"Number" : 120,

"EnteredNumber" : 180,

"ExitedNumber" : 60,
Da

"Type" : "EnterOver"
hu

}
a

Appendix F: FaceDetection
HT
TP

Table 4-128
Sample ParamValue type Description
AP

"Faces":[{ Array —
I

It is a rectangle, contains two points, one


fo

means left-top, one means right-bottom.


r

The first element is x's value of the left-top


point.
We

"BoundingBox": The second is y's value of the left-top


st

Rectangle
[2992,136,6960,8192] point.
The third is the x's value of the
Eu

right-bottom point.
ro

The fourth is the y's value of the


pe

right-bottom point
Te

Example:
c hn

{
ic

"Faces":[{
a l

"BoundingBox": [2992,136,6960,8192]

},…{}]

Appendix G: ManNumDetection

Sample ParamValue type Description


"ManList":[{ Array —

General APIs 92
Sample ParamValue type Description
It is a rectangle, contains two points, one
means left-top,one means right-bottom.
The first element is x's value of the left-top
point.
"BoundingBox": The second is y's value of the left-top
Rectangle
[2992,136,6960,8192], point.
The third is the x's value of the
right-bottom point.
The fourth is the y's value of the
right-bottom point
"Stature":175 int The unit is cm.

Example:
Da
hu

{
a

"ManList":[{
HT

"BoundingBox": [2992,136,6960,8192],
TP

"Stature":175
AP

},…{}]
I
fo

}
r

Appendix H: FaceFeatureAbstract
We

Sample ParamValue type Description


st

"Infos":[{ Array —
It can be
Eu

"Success": Abstract success,


ro

"State": "Success", string


"False": Failed to abstract;
pe

"Process":In Process;
"Process" : 20, int The process of the abstract
Te

"UID" : "1234", string the identity of the person


c hn

"GroupID" : "00001", string the identity of the face group


ic

Example:
a l

"Infos":[{

"State": "Success",

"Process": 20,

"UID": "1234",

"GroupID": "00001",

},…{}]

General APIs 93
Appendix I: CrowdDetection

Sample ParamValue type Description


"CrowdList" : [{ Array Global Crowd density overrun list
"Center" : [5734,2377],, Point Center point position
"Radius" : 10 int Radius length
"RegionList" : [ { Array People num overrun region list
"RegionID" : 0, int Region index
"PeopleNum" : 100 int People count in region

Example:

"CrowdList" : [{
Da

"Center" : [5734,2377],,
hu
a

"Radius" : 10
HT

},…{}]
TP

"RegionList" : [ {
AP

"RegionID" : 0,
I

"PeopleNum" : 100
fo
r

},…{}]
We

}
st

4.9.18 Get Capability of Event Management


Eu
ro

Table 4-129
pe

Syntax http://<server>/cgi-bin/eventManager.cgi?action=getCaps
Method GET
Te

Description Get event manager capabilities.


c

Example http://192.168.1.108/cgi-bin/eventManager.cgi?action=getCaps
hn

caps.AlarmOutEnable=true
ic

caps.BeepEnable=true
a

caps.DejitterEnable=true
l

caps.MMSEnable=true
caps.MailEnable=true
Success
caps.MonitorTourEnable=true
Return
caps.PtzLinkEnable=true
caps.RecordEnable=true
caps.SnapshotEnable=true
caps.TimeSectionEnable=true
caps.TipEnable=true
Comment —

General APIs 94
4.9.19 NetAlarm
Table 4-130
http://<server>/cgi-bin/netAlarm.cgi?action=setState&channel=<ChannelNo>&alarm=<A
Syntax
larm>[&name=<Name>&trigger=<Trigger>&desc=<Desc>]
Method GET
Description Set the netalarm state.
http://192.168.1.108/cgi-bin/netAlarm.cgi?action=setState&channel=1&alarm=true&nam
Example
e=somke&trigger=SmokingSensor&desc=Zone8
Success
OK
Return
Parameters in URL:
ChannelNo: integer, alarm channel index which starts from 1
Da

Alarm: bool, the state of the alarm, the value can be true and false, true means the alarm
hu

is start.
a

Name: string, the name of the alarm, optional parameter, the length of this value should
HT

Comment less than 32.


TP

Trigger:string, the trigger of the alarm,for example, it can be Infrared, WaterSensor or


Manual and so on.
AP

Optional parameter, the length of this value should less than 32.
I

Desc: string, the description of the alarm, optional parameter, the length of this value
fo

should less than 128.


r

4.9.20 GetSupportedEvents
We
st

Table 4-131
Syntax http://<server>/cgi-bin/eventManager.cgi?action=getExposureEvents
Eu

Method GET
ro

Description Get the event list which the device supports.


pe

Example http://192.168.1.108/cgi-bin/eventManager.cgi?action=getExposureEvents
events[0]=VideoMotion
Te

events[1]=AlarmLocal
c

Success
hn

events[2]=FaceDetection
Return
events[3]=VideoMotion
ic


a l

Comment —

4.10 PTZ

4.10.1 PTZ Config


 Get PTZ config

Table 4-132
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Ptz
Method GET

General APIs 95
Description Get PTZ config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Ptz
table.Ptz[port].Address=8
table.Ptz[port].Attribute[0]=115200
table.Ptz[port].Attribute[1]=8
table.Ptz[port].Attribute[2]=Even
Success
table.Ptz[port].Attribute[3]=1
Return
table.Ptz[port].Homing[0]=0
table.Ptz[port].Homing[1]=30
table.Ptz[port].NumberInMatrixs=0
table.Ptz[port].ProtocolName=NONE
Parameters in Response:
Comment
port is PTZ port index, start form 0.
Da

 Set PTZ config


hu

Table 4-133
a

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
HT

alue>[&<paramName>=<paramValue>…]
TP

Method GET
Description Set PTZ config.
AP

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Ptz[0].Address=192.
I

168.0.1&Ptz[0].Attribute[0]=9600
fo

Success OK
r

Return
Comment port in below ParamName is PTZ port index, start form 0.
We
st

Appendix:
Eu

ParamName ParamValue type Description


Range is [0—255].
ro

Device address, if there are more than one device


pe

Ptz[port].Address integer
connected to this port, distinguish them by this
address.
Te

The baud rate. Range is {1200, 2400, 4800, 9600,


c

Ptz[port].Attribute[0] integer
hn

19200, 38400, 57600, 115200}.


ic

Range is {4, 5, 6, 7, 8}.


Ptz[port].Attribute[1] integer
Data bit.
a
l

Range is {Even, Mark, None, Odd, Space}.


Ptz[port].Attribute[2] string
Parity verification mode.
Range is {1, 1.5, 2}.
Ptz[port].Attribute[3] float
Stop bit.
Range is {-1,0—255}
Ptz[port].Homing[0] integer -1: homing is disabled.
[0—255]: preset point number
Range is [0—65535].
No operation timeout, unit is seconds.
Ptz[port].Homing[1] integer
After no operation timeout, PTZ go to preset point
set in Ptz[port].Homing[0].

General APIs 96
ParamName ParamValue type Description
PTZ protocol name depends on PTZ capability.
Ptz[port].ProtocolName string
Refer to GetProtocolList to get the protocol list.

4.10.2 Get PTZ Protocol List


Table 4-134
Syntax http://<server>/cgi-bin/ptz.cgi?action=getProtocolList[&channel=<ChannelNo>]
Method GET
Description Get the protocol list that PTZ can support. Unsupported now.
Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getProtocolList&channel=1
info.RS[0]=Pelco
Success info.RS[1]=DH-SD1
Da

Return info.Coaxial[0]=HD-CVI
hu

info.Coaxial[1]=HD-CVI2.0
a

Response contains all support PTZ protocols of the server.


Comment
HT

ChannelNo: integer, video channel index which starts from 1.


TP

4.10.3 Get PTZ Capability of Current Protocol


AP

Table 4-135
I

Syntax http://<server>/cgi-bin/ptz.cgi?action=getCurrentProtocolCaps[&channel=<ChannelNo>]
fo

Method GET
r

Description Get PTZ channel protocol capabilities.


We

Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getCurrentProtocolCaps&channel=1
st

caps.AlarmLen=0
caps.AuxMax=8
Eu

caps.AuxMin=1
ro

caps.CamAddrMax=255
pe

caps.CamAddrMin=1
caps.Flip=false
Te

caps.Focus=false
c

caps.Interval=200
hn

caps.Iris=false
ic

caps.Menu=false
a

Success caps.MonAddrMax=255
l

Return caps.MonAddrMin=0
caps.Name=DH-SD1
caps.Pan=false
caps.PanSpeedMax=255
caps.PanSpeedMin=1
caps.PatternMax=5
caps.PatternMin=1
caps.PresetMax=80
caps.PresetMin=1
caps.Tile=false
caps.TileSpeedMax=255

General APIs 97
caps.TileSpeedMin=1
caps.TourMax=7
caps.TourMin=0
caps.Type=1
caps.Zoom=false
Parameters in URL:
Comment
ChannelNo: PTZ channel index which starts from 1.

Appendix:

Field in response Description


AlarmLen Alarm length in protocol.
AuxMax
Maximum/Minimum number for auxiliary functions.
AuxMin
Da

CamAddrMax
Maximum/Minimum channel address.
hu

CamAddrMin
a

Flip True or false, support picture flip or not.


HT

Focus True or false, support focus or not.


Iris True or false, support Iris adjusts or not.
TP

Menu True or false, support internal menu of the PTZ or not.


AP

MonAddrMax
Maximum/Minimum monitor address.
I

MonAddrMin
Name Name of the operation protocol.
fo

Pan True or false, support pan or not.


r

PanSpeedMax
We

Maximum/Minimum pan speed.


PanSpeedMin
st

PatternMax
Maximum/Minimum pattern path number.
PatternMin
Eu

PresetMax
ro

Maximum/Minimum preset point number.


PresetMin
pe

Tile True or false, support tilt or not.


Zoom True or false, support zoom or not.
Te

TileSpeedMax
c

Maximum/Minimum tile speed.


hn

TileSpeedMin
TourMax
ic

Maximum/Minimum tour path number.


TourMin
a l

Type Type of PTZ protocol.

4.10.4 Get PTZ Status


Table 4-136
Syntax http://<server>/cgi-bin/ptz.cgi?action=getStatus[&channel=<ChannelNo>]
Method GET
Description Get PTZ status.
Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getStatus&channel=1
Success status.UTC=6538920
Return status.MoveStatus=Idle

General APIs 98
status.ZoomStatus=Idle
status.PresetID=10
status.Position=120,12,2
Comment ChannelNo: integer, video channel index which starts from 1.

4.10.5 PTZ Control


 Basic movement

Table 4-137
http://<server>/cgi-bin/ptz.cgi?action=<action>&channel=<ch>&code=<code>&arg1=<a
Syntax
rg1>&arg2=<arg2>&arg3=<arg3>
Method GET
Description PTZ basic movement.
Da

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Up&arg1=0&arg2=1
hu

&arg3=0
a

Example
http://192.168.1.108/cgi-bin/ptz.cgi?action=stop&channel=1&code=Up&arg1=0&arg2=1&
HT

arg3=0
TP

Success
OK
Return
AP

Parameters in URL:
I

action is PTZ control command, it can be start or stop.


fo

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


r

code is PTZ operation, and arg1, arg2, arg3 are arguments of operation.
code and argN values are listed in table below.
We

The default exposure mode of PTZ is auto-exposure, aperture adjustment (Aperture


st

larger 、Aperture smaller) would take effects temporarily, PTZ will auto—adjust the
aperture after the auto—exposure recovery time (15 mins)
Eu

Comment The default focus mode of PTZ is semi—auto, PTZ control or other operations will trigger
ro

the auto focus


pe

There is no zoom times parameter for ZoomWide and ZoomTele command, if you need to
change zoom times, see "5.1.2 Video in Zoom".
Te
c

Appendix:
hn

Code Code description arg1 arg2 arg3


ic

Vertical speed, range is [1—


a

Up Tile up 0 0
l

8]
Vertical speed, range is [1—
Down Tile down 0 0
8]
Horizontal speed, range is
Left Pan left 0 0
[1—8]
Horizontal speed, range is
Right Pan right 0 0
[1—8]
Vertical speed, range is Horizontal speed, range is
LeftUp Pan left and tile up 0
[1—8] [1—8]
Vertical speed, range is Horizontal speed, range is
RightUp Pan right and tile up 0
[1—8] [1—8]

General APIs 99
Code Code description arg1 arg2 arg3
Vertical speed, range is Horizontal speed, range is
LeftDown Pan left and tile down 0
[1—8] [1—8]
Vertical speed, range is Horizontal speed, range is
RightDown Pan right and tile down 0
[1—8] [1—8]
ZoomWide Zoom out 0 0 0
ZoomTele Zoom in 0 0 0
FocusNear Focus near 0 0 0
FocusFar Focus far 0 0 0
IrisLarge Aperture larger 0 0 0
IrisSmall Aperture smaller 0 0 0
 Start the continuous movement
Da

Table 4-138
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Continuously&arg1=<a
hu

Syntax
rg1>&arg2=<arg2>&arg3=<arg3>&arg4=<arg4>
a

Method GET
HT

Description Start the continuous movement.


TP

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Continuously&arg1=
Example
5&arg2=5&arg3=5&arg4=60
AP

Success
I

OK
Return
fo

Parameters in URL:
r

ch is PTZ channel index which starts from 1. Range is [1 — n].


We

arg1 is horizontal speed, range is [-8—8];


arg2 is vertical speed, range is [-8—8];
st

Comment
arg3 is zoom speed, range is [-100—100];
Eu

arg4 is timeout value,the measurement unit is second, it's an integer greater than 0,the
PTZ will stop moving automatically if timeout value reached and no"stop"command
ro

received. The maximum timeout value is 3600 seconds.


pe

 Stop the continuous movement


Te

Table 4-139
c

http://<server>/cgi-bin/ptz.cgi?action=stop&channel=<ch>&code=Continuously&arg1=0&
hn

Syntax
arg2=0&arg3=0&arg4=0
ic

Method GET
a

Description Immediately stop the continuous movement.


l

http://192.168.1.108/cgi-bin/ptz.cgi?action=stop&channel=1&code=Continuously&arg1=
Example
0&arg2=0&arg3=0&arg4=0
Success
OK
Return
Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
 3D positioning

Table 4-140
http://<server>/cgi-bin/ptzBase.cgi?action=moveDirectly&channel=<ChannelNo>&start
Syntax
Point[0]=<startX>&startPoint[1]=<startY>&endPoint[0]=<endX>&endPoint[1]=<endY>

General APIs 100


Method GET
Three-dimensional orientation. Move to the rectangle with screen coordinate [startX,
Description
startY], [endX, endY] .
http://192.168.1.108/cgi-bin/ptzBase.cgi?action=moveDirectly&channel=1&startPoint[0]
Example
=7253&startPoint[1]=2275&endPoint[0]=7893&endPoint[1]=3034
Success
OK
Return
ChannelNo: integer, video channel index which starts from 1.
Comment startX, startY, endX, endY: relative coordinates, range is 0-8192. The two points
[startX, startY] and [endX, endY] makes the destination rectangle.
 PTZ relative movement

Table 4-141
Da

http://<server>/cgi-bin/ptz.cgi?action=moveRelatively&channel=<ch>&arg1=<arg1>&arg2
Syntax
=<arg2>&arg3=<arg3>
hu

Method GET
a

Description PTZ relative movement.


HT

http://192.168.1.108/cgi-bin/ptz.cgi?action=moveRelatively&channel=1&arg1=1&arg2=1&
TP

Example
arg3=1
Success
AP

OK
Return
I

Parameters in URL:
fo

ch is PTZ channel index which starts from 1. Range is [1 — n].


r

arg1 is relative horizontal coordinate


Comment
We

arg2 is relative vertical coordinate


arg3 is relative zoom coordinate
st

The normalization of above three values is[-1,1]


Eu

 PTZ accurate positioning


ro

Table 4-142
pe

http://<server>/cgi-bin/ptz.cgi?action=moveAbsolutely&channel=<ch>&arg1=<arg1>&arg
Syntax
2=<arg2>&arg3=<arg3>
Te

Method GET
c

Description Accurate positioning.


hn

http://192.168.1.108/cgi-bin/ptz.cgi?action=moveAbsolutely&channel=1&arg1=1&arg2=1&
ic

Example
arg3=1
a l

Success
OK
Return
Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is absolute horizontal coordinate
Comment
arg2 is absolute vertical coordinate
arg3 is absolute zoom coordinate
The normalization of above three values is[-1,1]

General APIs 101


4.10.6 Preset
 Get preset information

Table 4-143
Syntax http://<server>/cgi-bin/ptz.cgi?action=getPresets[&channel=<ChannelNo>]
Method GET
Description Get preset of PTZ control.
Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getPresets&channel=1
presets[0].Index=1
Success presets[0].Name=Preset 1
Return presets[0].Type=0

Da

Parameters in URL:
hu

Comment ChannelNo: integer, video channel index which starts from 1.


a

The size of presets-array is the number of presets.


 Go to preset
HT
TP

Table 4-144
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=GotoPreset&arg1=0&a
AP

Syntax
rg2=<index>&arg3=0
I

Method GET
fo

Description Go to preset.
r

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=GotoPreset&arg1=0&
Example
arg2=1&arg3=0
We

Success
st

OK
Return
Eu

Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
ro

arg2 is number of preset


pe

 Set preset
Te

Table 4-145
c

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetPreset&arg1=0&ar
hn

Syntax
g2=<index>&arg3=0
ic

Method GET
a

Description Set preset.


l

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetPreset&arg1=0&a
Example
rg2=2&arg3=0
Success
OK
Return
Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg2 is preset number
 Set the name for specified preset

Table 4-146
Syntax http://<server>/cgi-bin/ptz.cgi?action=setPreset&channel=<ch>&arg1=<index>&arg2=<

General APIs 102


name>
Method GET
Description Set the name for specified preset.
Example http://192.168.1.108/cgi-bin/ptz.cgi?action=setPreset&channel=1&arg1=2&arg2=2
Success
OK
Return
Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
Comment
arg1 is preset number
arg2 is preset name, could be letter,number or Chinese
 Delete specified preset

Table 4-147
Da

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=ClearPreset&arg1=0&
Syntax
arg2=<index>&arg3=0
hu

Method GET
a

Description Delete the specified preset.


HT

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=ClearPreset&arg1=0
Example
TP

&arg2=1&arg3=0
Success
AP

OK
Return
I

Parameters in URL:
fo

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


r

arg2 is preset number


We

4.10.7 Tour
st
Eu

 Start the tour


ro

Table 4-148
pe

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StartTour&arg1=<index
Syntax
>&arg2=0&arg3=0
Te

Method GET
c

Description Start the tour.


hn

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StartTour&arg1=1&arg
ic

Example
2=0&arg3=0
a

Success
l

OK
Return
Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is the number of tour route
 Stop the tour

Table 4-149
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StopTour&arg1=<index
Syntax
>&arg2=0&arg3=0
Method GET
Description Stop the tour.

General APIs 103


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StopTour&arg1=1&arg
Example
2=0&arg3=0
Success
OK
Return
Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is the number of tour route
 Add tour group

Table 4-150
http://<server>/cgi-bin/ptz.cgi?action=setTour&channel=<ch>&arg1=<index>&arg2=<nam
Syntax
e>
Method GET
Da

Descriptio Add tour group, including set the tour route and name. Frequently used with add tour
n preset.
hu

Example http://192.168.1.108/cgi-bin/ptz.cgi?action=setTour&channel=1&arg1=1&arg2=1
a

Success
HT

OK
Return
TP

Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
AP

Comment
arg1 is the number of tour route
I

arg2 is tour name


fo

 Delete tour group


r

Table 4-151
We

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=ClearTour&arg1=<inde
Syntax
st

x>&arg2=0&arg3=0
Method GET
Eu

Description Delete the tour group with specified number.


ro

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=ClearTour&arg1=1&ar
Example
pe

g2=0&arg3=0
Success
Te

OK
Return
c

Parameters in URL:
hn

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


ic

arg1 is the number of tour group


a

 Add tour preset


l

Table 4-152
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AddTour&arg1=<index
Syntax
1>&arg2=<index2>&arg3=0
Method GET
Description Add preset to tour group.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AddTour&arg1=1&arg
Example
2=2&arg3=0
Success
OK
Return
Comment Parameters in URL:

General APIs 104


ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is the number of tour route
arg2 is the number of preset
 Delete tour preset

Table 4-153
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=DelTour&arg1=<index1
Syntax
>&arg2=<index2>&arg3=0
Method GET
Description Delete the specified preset from a particular tour group.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=DelTour&arg1=1&arg2
Example
=2&arg3=0
Success
OK
Da

Return
Parameters in URL:
hu

ch is PTZ channel index which starts from 1. Range is [1 — n].


a

Comment
arg1 is the number of tour route
HT

arg2 is the number of preset


TP

4.10.8 Scan
AP
I

 Set left boundary


fo

Table 4-154
r

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetLeftLimit&arg1=<ind
Syntax
We

ex>&arg2=0&arg3=0
st

Method GET
Description Set left boundary.
Eu

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetLeftLimit&arg1=1&
Example
ro

arg2=0&arg3=0
pe

Success
OK
Return
Te

Parameters in URL:
c

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


hn

arg1 is the scan number


ic

 Set right boundary


a l

Table 4-155
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetRightLimit&arg1=<in
Syntax
dex>&arg2=0&arg3=0
Method GET
Description Set right boundary.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetRightLimit&arg1=1
Example
&arg2=0&arg3=0
Success
OK
Return
Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].

General APIs 105


arg1 is the scan number
 Start scan

Table 4-156
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoScanOn&arg1=<in
Syntax
dex>&arg2=0&arg3=0
Method GET
Description Start scanning.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoScanOn&arg1=1
Example
&arg2=0&arg3=0
Success
OK
Return
Parameters in URL:
Da

Comment ch is PTZ channel index which starts from 1. Range is [1—n].


arg1 is scan number
hu

 Stop scan
a
HT

Table 4-157
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoScanOff&arg1=<in
TP

Syntax
dex>&arg2=0&arg3=0
AP

Method GET
I

Description Stop scanning.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoScanOff&arg1=1
fo

Example
&arg2=0&arg3=0
r

Success
We

OK
Return
st

Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
Eu

arg1 is scan number


ro
pe

4.10.9 Pattern
Te

 Start pattern record


c hn

Table 4-158
ic

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetPatternBegin&arg1=
Syntax
<index>&arg2=0&arg3=0
al

Method GET
Description Start pattern record.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetPatternBegin&arg1
Example
=1&arg2=0&arg3=0
Success
OK
Return
Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is pattern number
 Stop pattern record

General APIs 106


Table 4-159
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetPatternEnd&arg1=<i
Syntax
ndex>&arg2=0&arg3=0
Method GET
Description Stop pattern record.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetPatternEnd&arg1=
Example
1&arg2=0&arg3=0
Success
OK
Return
Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is pattern number
 Start pattern
Da

Table 4-160
hu

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StartPattern&arg1=<ind
a

Syntax
ex>&arg2=0&arg3=0
HT

Method GET
TP

Description Start pattern.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StartPattern&arg1=1&
AP

Example
arg2=0&arg3=0
I

Success
OK
fo

Return
r

Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
We

Comment
arg1 is pattern number
st

 Stop pattern
Eu

Table 4-161
ro

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StopPattern&arg1=<ind
Syntax
pe

ex>&arg2=0&arg3=0
Method GET
Te

Description Stop pattern.


c

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StopPattern&arg1=1&
hn

Example
arg2=0&arg3=0
ic

Success
a

OK
Return
l

Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is pattern number

4.10.10 Pan
 Start pan

Table 4-162
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoPanOn&arg1=0&ar
Syntax
g2=0&arg3=0

General APIs 107


Method GET
Description Start pan.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoPanOn&arg1=0&
Example
arg2=0&arg3=0
Success
OK
Return
Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
 Stop pan

Table 4-163
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoPanOff&arg1=0&ar
Syntax
g2=0&arg3=0
Da

Method GET
Description Stop pan.
hu

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoPanOff&arg1=0&
a

Example
arg2=0&arg3=0
HT

Success
OK
TP

Return
AP

Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
I
fo

4.10.11 PTZ Auto Movement


r
We

 Get PTZ auto movement configuration


st

Table 4-164
Eu

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=PtzAutoMovement
ro

Method GET
pe

Description Get PTZ auto movement configuration.


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=PtzAutoMove
Example
Te

ment
c

table.PtzAutoMovement[port][Task].Enable = true
hn

table.PtzAutoMovement[port][Task].TimeSection[week][section] = 0 00:00:00-23:59:59
ic


a

table.PtzAutoMovement[port][Task].Fuction = None
l

table.PtzAutoMovement[port][Task].ScanId = 0
Success
table.PtzAutoMovement[port][Task].PresetId = 0
Return
table.PtzAutoMovement[port][Task].PatternId = 0
table.PtzAutoMovement[port][Task].TourId = 0
table.PtzAutoMovement[port][Task].AutoHoming.Time = 30
table.PtzAutoMovement[port][Task].SnapshotEnable = false
table.PtzAutoMovement[port][Task].SnapshotDelayTime = 30
Parameters in Response:
port is PTZ port index, start from 0.
Comment
Task is the number of task, start from 0.
week: from 1 to 7.

General APIs 108


section: time section, from 0 to 5.
 Set PTZ auto movement

Table 4-165
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set PTZ auto movement.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&PtzAutoMovement[0]
Example
[0].Function=Preset&PtzAutoMovement[0][0].PresetId=1
Success
OK
Return
Parameters in URL:
Da

In table below,
head=PtzAutoMovement[port][task]
hu

Comment port is PTZ port index, start from 0.


a

task is the number of task, start from 0.


HT

week: from 1 to 7.
TP

section: time section, from 0 to 5.


AP

Appendix:
I

ParamName ParamValue type Description


fo

head. Enable bool Enable/Disable PtzAutoMovement


r

timeSchedule[week][section]=1 10:00:00-11:00:00
head. TimeSection timeSchedule
We


head. Fuction string Range is {Scan, Preset, Pattern, Tour}.
st

head. ScanId integer Scan Id, start from 1


Eu

head. PresetId integer Preset Id, start from 1


ro

head. PatternId integer Pattern Id, start from 1


pe

head. TourId integer Tour Id, start from 1


head. AutoHoming.Time integer Recover time, unit is second.
Te

head. SnapshotEnable bool Enable/Disable Snap, when "Fuction" is "Preset".


c

head. SnapshotDelayTime integer Delay time of snap, when "Fuction" is "Preset".


hn
ic

4.10.12 PTZ Restart


a l

Table 4-166
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Restart&arg1=0&arg
Syntax
2=0&arg3=0
Method GET
Description PTZ restart.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Restart&arg1=0&ar
Example
g2=0&arg3=0
Success
OK
Return
Comment Parameters in URL:

General APIs 109


ch is PTZ channel index which starts from 1. Range is [1 — n].

4.10.13 PTZ Reset


Table 4-167
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Reset&arg1=0&arg2
Syntax
=0&arg3=0
Method GET
Description PTZ reset.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Reset&arg1=0&arg
Example
2=0&arg3=0
Success
OK
Return
Da

Parameters in URL:
Comment
hu

ch is PTZ channel index which starts from 1. Range is [1 — n].


a

4.10.14 OSD Menu


HT
TP

 Enter the menu


AP

Table 4-168
I

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Menu&arg1=0&arg2
Syntax
fo

=0&arg3=0
r

Method GET
Description Enter the menu.
We

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Menu&arg1=0&arg
st

Example
2=0&arg3=0
Eu

Success
OK
Return
ro

Parameters in URL:
pe

Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
Te

 Exit the menu


c

Table 4-169
hn

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Exit&arg1=0&arg2=0&
ic

Syntax
arg3=0
a

Method GET
l

Description Exit the menu.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Exit&arg1=0&arg2=0
Example
&arg3=0
Success
OK
Return
Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
 Confirm

Table 4-170
Syntax http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Enter&arg1=0&arg2=0

General APIs 110


&arg3=0
Method GET
Description Confirm the menu.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Enter&arg1=0&arg2=
Example
0&arg3=0
Success
OK
Return
Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
 Start the basic operation of menu

Table 4-171
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=<code>&arg1=<arg1
Syntax
Da

>&arg2=<arg2>&arg3=<arg3>
Method GET
hu

Description Start the basic operation of menu.


a

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=MenuUp&arg1=0&
HT

Example
arg2=0&arg3=0
TP

Success
OK
Return
AP

Parameters in URL:
I

ch is PTZ channel index which starts from 1. Range is [1 — n].


Comment
fo

code is PTZ operation, and arg1, arg2, arg3 are arguments of operation.
r

code and argN values are listed in table below.


We

Appendix:
st

Code Code description arg1 arg2 arg3


Eu

MenuUp MenuUp 0 0 0
ro

MenuDown MenuDown 0 0 0
pe

MenuLeft MenuLeft 0 0 0
MenuRight MenuRight 0 0 0
Te
c

4.11 Record
hn
ic

4.11.1 Get Capability of Recording


a l

Table 4-172
Syntax http://<server>/cgi-bin/recordManager.cgi?action=getCaps
Method GET
Description Get record manager capabilities.
Example http://192.168.1.108/cgi-bin/recordManager.cgi?action=getCaps
caps.MaxPreRecordTime=30
caps.PacketLengthRange[0]=1
Success
caps.PacketLengthRange[1]=60
Return
caps.PacketSizeRange[0]=131072
caps.PacketSizeRange[1]=2097152

General APIs 111


caps.SupportExtraRecordMode=true
caps.SupportHoliday=true
caps.SupportPacketType[0]=Time
caps.SupportPacketType[1]=Size
caps.SupportResumeTransmit=false
Comment —

4.11.2 Record Config


 Get record config

Table 4-173
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Record
Method GET
Da

Description Get record config.


hu

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Record
a

table.Record[channel].PreRecord=6
HT

table.Record[channel].TimeSection[weekday][0]=1 00:00:00-24:00:00
TP

table.Record[channel].TimeSection[weekday][1]=0 02:00:00-24:00:00
Success
table.Record[channel].TimeSection[weekday][2]=0 03:00:00-24:00:00
AP

Return
table.Record[channel].TimeSection[weekday][3]=0 04:00:00-24:00:00
I

table.Record[channel].TimeSection[weekday][4]=0 05:00:00-24:00:00
fo

table.Record[channel].TimeSection[weekday][5]=0 06:00:00-24:00:00
r

Parameters in Response:
channel: integer, array index starts from 0, which means video channel(equals to video
We

Comment channel index -1, and so 0 means channel 1).


st

weekday: range is [0-6] (Sunday - Saturday).


Record config contains pre record time and record time sections of every day.
Eu

 Set record config


ro
pe

Table 4-174
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
Te

alue>[&<paramName>=<paramValue>…]
c

Method GET
hn

Description Set record config.


ic

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Record[0].TimeSecti
a

on[0][0]=6 00:00:00-23:59:59
l

Example Set record time to every Sunday all day. Record type is motion detection and alarm.
In this example, "6 00:00:00-23:59:59" means motion detection and alarm record all day
(6 = 4 & 2, alarm is 4, motion detection is 2.).
Success
OK
Return
Parameters in URL:
In table below,
ch: integer, array index starts from 0, which means video channel (equals to video
Comment
channel index -1, and so 0 means channel 1).
wd: week day index
ts: time section index

General APIs 112


Appendix:

ParamName ParamValue type Description


Range is [0—300].
Record[ch].PreRecord integer Prerecord seconds, 0 means no prerecord.
ch (Channel number) starts form 0
wd (week day) range is [0 — 6] (Sunday -
Saturday)
ts (time section) range is [0—23], time section
table index.

Format: mask hh:mm:ss-hh:mm:ss


Record[ch].TimeSection[wd][ts] string Mask: [0—65535], hh: [0—24], mm: [0—59],
ss: [0—59]
Da

Mask indicates record type by bits:


hu

Bit0: regular record


a

Bit1: motion detection record


HT

Bit2: alarm record


TP

Bit3: card record


AP

4.11.3 Record Mode


I
fo

 Get record mode config


r

Table 4-175
We

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=RecordMode
st

Method GET
Description Get record mode config.
Eu

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RecordMode
ro

Success
table.RecordMode[Channel].Mode=0
pe

Return
Parameters in Response:
Te

Comment Channel: integer, array index starts from 0, which means video channel (equals to
c

video channel index -1, and so 0 means channel 1).


hn

 Set record mode config


ic

Table 4-176
a l

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>
Method GET
Description Set record mode config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&RecordMode[0].Mod
Example
e=0
Success
OK
Return
Parameters in URL:
Comment In table below,
Channel: integer, array index starts from 0, which means video channel (equals to

General APIs 113


video channel index -1, and so 0 means channel 1).

Appendix:

ParamName ParamValue type Description


Range is {0, 1, 2 }.
0: automatically record
RecordMode[Channel].Mode integer
1: manually record
2: stop record.

4.11.4 Media Global


 Get media global config

Table 4-177
Da

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MediaGlobal
hu

Method GET
a

Description Get media global config.


HT

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MediaGlobal
TP

Success
table.MediaGlobal.SnapFormatAs=MainFormat
Return
AP

Comment —
I

 Set media global config


fo

Table 4-178
r

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
We

Syntax
alue>
st

Method GET
Description Set media global config.
Eu

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MediaGlobal.SnapF
Example
ro

ormatAs=MainFormat
pe

Success
OK
Return
Te

Comment —
c hn

Appendix:
ic

ParamName ParamValue type Description


a

MediaGlobal.SnapFormatAs string The range is {"MainFormat", "ExtraFormat"}.


l

4.11.5 Find Media Files


Step 1 Create a media files finder.

Table 4-179
Syntax http://<server>/cgi-bin/mediaFileFind.cgi?action=factory.create
Method GET
Description Create a media file finder.
Example http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=factory.create
Success result=08137

General APIs 114


Return
Comment The result is the finder's objectId, needed by the following API.
Step 2 Start to find media files satisfied the conditions with the finder.

Table 4-180
http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile&object=<objectId>&condition
.Channel=<ChannelNo>&condition.StartTime=<start>&condition.EndTime=<end>[&c
Syntax
ondition.Dirs[0]=<dir>&condition.Types[0]=<type>&condition.Flags[0]=<flags>&conditi
on.Events[0]=<event>&condition.VideoStream=<stream>]
Method GET
Description Check if there are files that satisfy all the conditions.
Find a file in channel 1, in directory "/mnt/dvr/sda0",event type is "AlarmLocal" or
"VideoMotion", file type is "dav", and time between 2014-1-1 12:00:00 and 2015-1-10
Da

12:00:00 , URL is:


Example http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&conditio
hu

n.Channel=1&condition.Dirs[0] =/mnt/dvr/sda0&condition.Types[0]=dav&condition.Eve
a

nts[0]=AlarmLocal&condition.Events[1]=VideoMotion&condition.StartTime=2014-1-1%2
HT

012:00:00&condition.EndTime=2015-1-10%2012:00:00&condition.VideoStream=Main
TP

Success
OK
Return
AP

Start to find a file with the above condition. If files exist, return OK, else return Error.
I

Parameters in URL:
fo

objecteId: The object Id is the finder created before. You must create a finder before
r

finding files.
ChannelNo: integer, video channel index which starts from 1.
We

start / end: the start/end time when recording.


st

dir : in which directories you want to find the file. It is an array. The index starts from 0.
The range of dir is {"/mnt/dvr/sda0", "/mnt/dvr/sda1"}. This condition can be omitted. If
Eu

omitted, find files in all the directories.


ro

Comment type : which types of the file you want to find. It is an array. The index starts from 0. The
pe

range of type is {"dav", "jpg", "mp4"}. If omitted, find files with all the types.
flags : which flags of the file you want to find. It is an array. The index starts from 0. The
Te

range of flag is {"Timing", "Manual", "Marker", "Event", "Mosaic", "Cutout"}. If omitted,


c hn

find files with all the flags.


event : by which event the record file is triggered. It is an array. The index starts from 0.
ic

The range of event is {"AlarmLocal", "VideoMotion", "VideoLoss", "VideoBlind",


a l

"Traffic*"}. This condition can be omitted. If omitted, find files of all the events.
stream : which video stream type you want to find. The range of stream is {"Main",
"Extra1", "Extra2", "Extra3"}. If omitted, find files with all the stream types.
Step 3 Get the media file information found by the finder.

Table 4-181
http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=<objectId>&cou
Syntax
nt=<fileCount>
Method GET
Description Find the next files no more than fileCount.
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&cou
Example
nt=100

General APIs 115


found=1
items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
items[0].EndTime=2011-1-1 13:00:00
Success items[0].Type=dav
Return items[0].Events[0]=AlarmLocal
items[0].VideoStream=Main
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
items[0].Length=790
items[0].Duration=3600
Comment The maximum value of fileCount is 100.

Appendix:
Da

Field in Description
hu

Response
a

found Count of found file, found is 0 if no file is found.


Internal video channel index starts from 0, equals to API findFile input
HT

Channel
condition.Channel -1.
TP

StartTime Start time.


AP

EndTime End time.


Type File type.
I

Events Event type.


fo

VideoStream Video stream type.


r

FilePath File path.


We

CutLength File length that cut between StartTime and EndTime.


st

Length File length of the whole file.


Duration Duration time.
Eu

Step 4 Close the finder.


ro

Table 4-182
pe

Syntax http://<server>/cgi-bin/mediaFileFind.cgi?action=close&object=<objectId>
Te

Method GET
Description Stop finding.
c
hn

Example http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=close&object=08137
ic

Success
OK
a

Return
l

Comment —
Step 5 Destroy the finder.

Table 4-183
Syntax http://<server>/cgi-bin/mediaFileFind.cgi?action=destroy&object=<objectId>
Method GET
Description Destroy the media file finder.
Example http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=destroy&object=08137
Success
OK
Return
Comment —

General APIs 116


4.11.6 Find media files with FaceDetection info
Step 1 Create a media files finder.
This API is the same as the API in "4.11.5 Find Media Files".
Step 2 Start to find media files satisfied the common conditions and FaceDetection condition
with the finder.

Table 4-184
URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
Start to find media files satisfied the common conditions and FaceDetection conditions
Description
with the finder.
[ Request Params ] ( key=value format at URL )
Da

Name Type R/O Param Description


hu

object int R The finder object id


a

condition object R The search conditions


HT

The video channel to search, video channel index start from


+Channel int R
1, use -1 to search all video channel.
TP

+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


AP

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


+Types array<string> O Search file types, should be "jpg"
I

Search flags, can be : "Timing", "Manual", "Marker", "Event",


fo

+Flags array<string> O "Mosaic", "Cutout"


r

should include “Event”


We

+Events array<string> R Search event list, must be one string : "FaceDetection"


st

Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.
Eu

+DB object R DB filter object


ro

++FaceDetecti
object R DB filter for FaceDetection
pe

onRecordFilter
Picture type, if omit, means search all type.
Te

+++ImageType string O "GlobalSence" : means big picture of the full sence,


c

"Small" : means small picture of the people face.


hn

+++Sex string O Sex, it can be "Man", "Woman", if omit, search all


ic

+++Age array<int> O Age range, ex:[25, 40]


a

+++Glasses int O Glasses Status, 0: all, 1: not wear, 2: wear


l

+++Mask int O Mask Status, 0: all, 1: not wearing mask, 2: wearing mask
+++Beard int O Beard Status, 0: all, 1: no beard, 2: has beard
[ Response Params ] ( OK )
[ Example ]

General APIs 117


GET
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condition.Ch
annel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-10%2012
:00:00&condition.Types[0]=jpg&condition.Flags[0]=Event&condition.Events[0]=FaceDetecti
Request
on&condition.DB.FaceDetectionRecordFilter.ImageType=GlobalSence&condition.DB.Face
DetectionRecordFilter.Sex=Man&condition.DB.FaceDetectionRecordFilter.Age[0]=25&cond
ition.DB.FaceDetectionRecordFilter.Age[1]=40&condition.DB.FaceDetectionRecordFilter.Gl
asses=1
Respons
OK
e
Step 3 Get the media file information found by the finder

Table 4-185
URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Da

Method GET
hu

Description Get the media file information found by the finder.


a

[ Request Params ] ( key=value format at URL )


HT

Name Type R/O Param Description


TP

object int R The finder object id


count int R Record num to get, should less than 100.
AP

[ Response Params ] ( key=value format )


I

Name Type R/O Param Description


fo

found int R Record num that found.


r

items array<object> R Result record items.


We

+Channel int R The video channel index start from 0,


+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"
st

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


Eu

+Type string R File type, should be: "jpg"


ro

+Events array<string> R Events with this record


+FilePath string R File path, string max length is 259
pe

+CutLength int R File length that cut between start time and end time
Te

+Length int O File length of the whole file


c

+SummaryNew array<object> R DB record object


hn

++Key string R DB record name, should be "FaceDetectionRecord"


ic

++Value object R DB record value


a

+++ImageType string O Picture type. It can be: "GlobalSence" , "Small"


l

+++TimeStamp object O Picture timestamp


++++UTC int O UTC seconds
++++UTCMS int O UTC miliseconds
+++Sex string O Sex, it can be "Man", "Woman", "Unknown"
+++Age int O Age
+++Glasses int O Glasses Status, 0: unknown, 1: not wear, 2: wear
Mask Status, 0: unknown, 1: not wearing mask, 2: wearing
+++Mask int O
mask
+++Beard int O Beard Status, 0: unknown, 1: no beard, 2: has beard
[ Example ]

General APIs 118


GET
Request http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&count=1
00
found=100
items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
items[0].EndTime=2011-1-1 13:00:00
items[0].Type=jpg
items[0].Events[0]=FaceDetection
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
items[0].CutLength=79000
Respons items[0].SummaryNew[0].Key=FaceDetectionRecord
e items[0].SummaryNew[0].Value.ImageType=GlobalSence
Da

items[0].SummaryNew[0].Value.TimeStamp.UTC=134652732
hu

items[0].SummaryNew[0].Value.TimeStamp.UTCMS=134
items[0].SummaryNew[0].Value.Sex=Man
a

items[0].SummaryNew[0].Value.Age=30
HT

items[0].SummaryNew[0].Value.Glasses=1
TP

items[0].SummaryNew[0].Value.Mask=2
items[0].SummaryNew[0].Value.Beard=1
AP


I

Step 4 Close the finder.


fo

This API is the same as the API in "4.11.5 Find Media Files".
r

Step 5 Destroy the finder.


We

This API is the same as the API in "4.11.5 Find Media Files".
st

4.11.7 Find media files with FaceRecognition info


Eu
ro

Step 1 Create a media files finder.


This API is the same as the API in "4.11.5 Find Media Files".
pe

Step 2 Start to find media files satisfied the common conditions and FaceRecognition
Te

conditions with the finder.


c

Table 4-186
hn

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
ic

Method GET
a

Description Start to find media files satisfied the common conditions and FaceRecognition conditions
l

with the finder.


[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
object int R The finder object id
condition object R The search conditions
+Channel int R The video channel to search, video channel index start from
1, use -1 to search all video channel.
+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"
Ignored, use StartTime in DB param
+EndTime string O End time to search, ex: "2010-06-25 12:05:00"

General APIs 119


Ignored, use EndTime in DB param
+Types array<string> O Search file types, should be "jpg"
+Flags array<string> O Search flags. It can be: "Timing", "Manual", "Marker", "Event",
"Mosaic", "Cutout"
should include “Event”.
+Events array<string> R Search event list, must be one string: "FaceRecognition"
Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.
+DB object R DB filter object
++FaceRecogn object R DB filter for FaceRecognition
itionRecordFilt
er
+++MachineAd string O Machine address
Da

dress
hu

+++StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


a

+++EndTime string R End time to search, ex: "2010-06-25 12:05:00"


HT

+++Person object O Search condition of history person and the similar face group
person candidates
TP

++++Name string O Person's name, max string length is 15


AP

++++Sex string O Sex, can be "Male", "Female", if omit, search all


I

++++Birthday string O Birthday, max string length is 11, ex: 1990-5-1


++++Country string O Country, ISO 3166, string length should be 2
fo

++++Province string O Province, max string length is 63


r

++++City string O City, max string length is 63


We

++++Certificate string O Certificate Type. It can be: "IC', "Passport", "Military",


st

Type "Unknown"
++++ID string O Person ID of CertificateType, max string length is 31
Eu

++++GroupID string O The identity of the Face Group that this Person in. max string
ro

length is 63
pe

++++Age array<int> O Age range, ex:[25, 40]


++++Glasses int O Glasses Status, 0: all, 1: not wear, 2: wear
Te

++++Mask int O Mask Status, 0: all, 1: not wearing mask, 2: wearing mask
c hn

++++Beard int O Beard Status, 0: all, 1: no beard, 2: has beard


+++GroupID array<string> O GroupID list
ic

+++SimilaryRa array<int> O Similary Range, ex: [40, 100]


a l

nge
[ Response Params ] ( OK )
[ Example ]
Request GET
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condition.Ch
annel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-10%2012
:00:00&condition.Types[0]=jpg&condition.Flags[0]=Event&condition.Events[0]=FaceRecogn
ition&condition.DB.FaceRecognitionRecordFilter.RegType=RecSuccess&condition.DB.Fac
eRecognitionRecordFilter.StartTime=2014-1-1%2012:00:00&condition.DB.FaceRecognition
RecordFilter.EndTime=2015-1-10%2012:00:00&condition.DB.FaceRecognitionRecordFilter.
Person.Sex=Male&condition.DB.FaceRecognitionRecordFilter.Person.Country=CN&conditi

General APIs 120


on.DB.FaceRecognitionRecordFilter.Person.Age[0]=25&condition.DB.FaceRecognitionRec
ordFilter.Person.Age[1]=40&condition.DB.FaceRecognitionRecordFilter.Person.Glasses=1
&condition.DB.FaceRecognitionRecordFilter.GroupID[0]=10001&condition.DB.FaceRecogn
itionRecordFilter.GroupID[1]=10003&condition.DB.FaceRecognitionRecordFilter.GroupID[2]
=10005&condition.DB.FaceRecognitionRecordFilter.SimilaryRange[0]=40&condition.DB.Fa
ceRecognitionRecordFilter.SimilaryRange[1]=100
Respons OK
e
Step 3 Get the media file information found by the finder

Table 4-187
URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
Description Get the media file information found by the finder
Da

[ Request Params ] ( key=value format at URL )


hu

Name Type R/O Param Description


a

object int R The finder object id


HT

count int R Record num to get, should less than 100.


TP

[ Response Params ] ( key=value format )


Name Type R/O Param Description
AP

found int R Record num that found.


I

items array<object> R Result record items.


fo

+Channel int R The video channel index start from 0,


r

+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


We

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


+Type string R File type, should be: "jpg"
st

+Events array<string> R Events with this record


Eu

+FilePath string R File path, string max length is 259


ro

+CutLength int R File length that cut between start time and end time
+Length int O File length of the whole file
pe

+SummaryNew array<object> R DB record object


Te

++Key string R DB record name, should be "FaceRecognitionRecord"


c

++Value object R DB record value


hn

Recognition result, 0 means recognition failed, no candidates.


+++RecResult int O
ic

1 means recognition success, has candidates.


a

+++MachineAd
l

string O Machine address, string max length is 259


dress
+++IsGlobalSc
bool O Is the global scene picture or not
ene
+++ImageInfo object O Big picture info
++++Length int O The length of the picture
++++FilePath string O The file path of the picture, max string length is 259
+++Object object O The target face info
++++Sex string O Sex, it can be "Man", "Woman", "Unknown"
++++Age int O Age
++++Glasses int O Glasses Status, 0: unknown, 1: not wear, 2: wear

General APIs 121


++++Eye int O Eye status, 0: not detected, 1: close eye, 2: open eye
++++Mouth int O Mouth status, 0: not detected, 1: close mouth, 2: open mouth
Mask status, 0: not detected, 1: not wearing mask, 2: wearing
++++Mask int O
mask
++++Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard
+++Candidates array<object> O The info of candidates face from face group.
++++Similarity int O Similarity
++++Person object O person info
+++++Name string O Person Name, max string length is 63
+++++Sex string O Sex, it can be "Male", "Female", "Unknown"
+++++Birthday string O The person's birthday, ex: "1980-01-01"
Country name, length must be 2, value should be according
+++++Country string O
to ISO3166
Da

+++++Province string O Province name, max string length is 63


hu

+++++City string O City name, max string length is 63


a

+++++Certificat Certificate Type. It can be: "IC', "Passport", "Military",


string O
HT

eType "Unknown"
TP

+++++ID string O Person ID of CertificateType, max string length is 31


+++++Feature
int O Feature State, 0:Unknown, 1:Failed, 2:OK
AP

State
I

[ Example ]
fo

GET
Request http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&count=1
r

00
We

found=100
st

items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
Eu

items[0].EndTime=2011-1-1 13:00:00
ro

items[0].Type=jpg
pe

items[0].Events[0]=FaceRecognition
items[0].FilePath =/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
Te

items[0].Length =790
c

items[0].SummaryNew[0].Key=FaceRecognitionRecord
hn

items[0].SummaryNew[0].Value.RecResult=1
ic

Respons items[0].SummaryNew[0].Value.MachineAddress=BinJiang
a

e items[0].SummaryNew[0].Value.IsGlobalScene=true
l

items[0].SummaryNew[0].Value.ImageInfo.Length=123
items[0].SummaryNew[0].Value.ImageInfo.FilePath=/tmp/1.jpg
items[0].SummaryNew[0].Value.Object.Sex=Man
items[0].SummaryNew[0].Value.Object.Age=40
items[0].SummaryNew[0].Value.Object.Glasses=1
items[0].SummaryNew[0].Value.Object.Eye=2
items[0].SummaryNew[0].Value.Object.Mouth=1
items[0].SummaryNew[0].Value.Candidates[0].Similarity=50
items[0].SummaryNew[0].Value.Candidates[0].Person.Name=ZhangSan
items[0].SummaryNew[0].Value.Candidates[0].Person.Birthday=1980-01-01

General APIs 122


items[0].SummaryNew[0].Value.Candidates[0].Person.Sex=Male
items[0].SummaryNew[0].Value.Candidates[0].Person.Country=CN
items[0].SummaryNew[0].Value.Candidates[0].Person.Province=ZheJiang
items[0].SummaryNew[0].Value.Candidates[0].Person.City=HangZhou
items[0].SummaryNew[0].Value.Candidates[0].Person.CertificateType=IC
items[0].SummaryNew[0].Value.Candidates[0].Person.ID=1234567890
items[0].SummaryNew[0].Value.Candidates[0].Person.FeatureState=0

Step 4 Close the finder.
This API is the same as the API in "4.11.5 Find Media Files".
Step 5 Destroy the finder.
This API is the same as the API in "4.11.5 Find Media Files".
Da

4.11.8 Find media files with HumanTrait info


hu

Step 1 Create a media files finder.


a

This API is the same as the API in "4.11.5 Find Media Files".
HT

Step 2 Start to find media files satisfied the common conditions and HumanTrait conditions
TP

with the finder


AP

Table 4-188
I

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
fo

Method GET
Start to find media files satisfied the common conditions and HumanTrait conditions with
r

Description
the finder.
We

[ Request Params ] ( key=value format at URL )


st

Name Type R/O Param Description


object int R The finder object id
Eu

condition object R The search conditions


ro

The video channel to search, video channel index start from


pe

+Channel int R
1, use -1 to search all video channel.
+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"
Te

+EndTime string O End time to search, ex: "2010-06-25 12:05:00"


c hn

+Types array<string> O Search file types, should be "jpg"


ic

Search flags. It can be: "Timing", "Manual", "Marker", "Event",


+Flags array<string> O "Mosaic", "Cutout"
a l

should include “Event”


+Events array<string> R Search event list, must be one string: "HumanTrait"
Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.
+DB object R DB filter object
++HumanTrait
object R DB filter for HumanTrait
RecordFilter
+++HumanAttri
object R Human attributes
butes
Coat color, refer to CoatColor in 16.1.3.5 [Event] HumanTrait
++++CoatColor array<string> O
for available values, max array size is 4

General APIs 123


Coat type, refer to CoatType in 16.1.3.5 [Event] HumanTrait
++++CoatType array<int> O
for available values, max array size is 2
++++Trousers Trousers color, refer to TrousersColor in 16.1.3.5 [Event]
array<string> O
Color HumanTrait for available values, max array size is 4
++++TrousersT Trousers type, refer to TrousersType in 16.1.3.5 [Event]
array<int> O
ype HumanTrait for available values, max array size is 2
++++HasHat int O Has hat or not, 0: all, 1: not has hat, 2: has hat
++++HasBag int O Has bag or not, 0: all, 1: not has bag, 2: has bag
++++Sex string O Sex, can be "Man", "Woman", if omit, search all
++++Age array<int> O Age range, ex:[25, 40]
Hair style, 0: all, 1: long hair, 2: short hair, 3: ponytail, 4: updo,
++++HairStyle int O
5: hiddened
[ Response Params ] ( OK )
Da

[ Example ]
hu

GET
a

http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condition.Ch
HT

annel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-10%2012
:00:00&condition.Types[0]=jpg&condition.Flags[0]=Event&condition.Events[0]=HumanTrait
TP

&condition.DB.HumanTraitRecordFilter.HumanAttributes.CoatColor[0]=White&condition.DB
AP

Request .HumanTraitRecordFilter.HumanAttributes.CoatColor[1]=Yellow&condition.DB.HumanTraitR
ecordFilter.HumanAttributes.CoatType=1&condition.DB.HumanTraitRecordFilter.HumanAttr
I

ibutes.HasHat=2&condition.DB.HumanTraitRecordFilter.HumanAttributes.Sex=Man&conditi
fo

on.DB.HumanTraitRecordFilter.HumanAttributes.Age[0]=30&condition.DB.HumanTraitReco
r

rdFilter.HumanAttributes.Age[1]=50&condition.DB.HumanTraitRecordFilter.HumanAttribute
We

s.HairStyle=1
st

Respons
OK
e
Eu

Step 3 Get the media file information found by the finder


ro

Table 4-189
pe

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
Te

Descripti
c

Get the media file information found by the finder


hn

on
ic

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
a l

object int R The finder object id


count int R Record num to get, should less than 100.
[ Response Params ] ( key=value format )
Name Type R/O Param Description
found int R Record num that found.
items array<object> R Result record items.
+Channel int R The video channel index start from 0,
+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"
+EndTime string R End time to search, ex: "2010-06-25 12:05:00"
+Type string R File type, should be: "jpg"
+Events array<string> R Events with this record

General APIs 124


+FilePath string R File path, string max length is 259
+CutLength int R File length that cut between start time and end time
+Length int O File length of the whole file
+SummaryNew object R Face info
++Key string R DB record name, should be "HumanTraitRecord"
++Value object R DB record value
+++HumanAttri
object O Human attributes
butes
Coat color, refer to CoatColor in 16.1.3.5 [Event] HumanTrait
++++CoatColor string O
for available values,
Coat type, refer to CoatType in 16.1.3.5 [Event] HumanTrait
++++CoatType int O
for available values,
++++Trousers Trousers color, refer to TrousersColor in 16.1.3.5 [Event]
Da

string O
Color HumanTrait for available values,
hu

++++TrousersT Trousers type, refer to TrousersType in 16.1.3.5 [Event]


int O
a

ype HumanTrait for available values,


HT

++++HasHat int O Has hat or not, 0: unknown, 1: not has hat, 2: has hat
++++HasBag int O Has bag or not, 0: unknown, 1: not has bag, 2: has bag
TP

++++Sex string O Sex, can be "Man", "Woman", "Unknown"


AP

++++Age int O Age


I

Hair style, 0: unknown, 1: long hair, 2: short hair, 3: ponytail,


++++HairStyle int O
4: updo, 5: hiddened
fo

++++HasUmbr Has umbrella or not, 0: unknown, 1: not has umbrella, 2: has


r

int O
ella umbrella
We

Bag type, 0: unknown, 1: handbag, 2: shoulder bag, 3:


++++Bag int O
st

knapsack, 4: draw-bar box


++++Cap int O Cap style, 0: unknown, 1: normal cap, 2: helmet
Eu

+++FaceAttribu
ro

object O Face attributes


tes
pe

++++Sex string O Sex, can be "Man", "Woman", "Unknown"


++++Age int O Age
Te

Mask status, 0: not detected, 1: not wearing mask, 2: wearing


c

++++Mask int O
mask
hn

++++Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard


ic

Glasses Status, 0: unknown, 1: not wearing, 2: normal


a

++++Glass Int O
l

Glasses, 3: sun glasses, 4: black frame glasses


Emotion info. It can be: "Unknown", "Smile", "Anger",
++++Emotion string O "Sadness", "Disgust", "Fear", "Surprise", "Neutral", "Laugh",
"Happy", "Confused", "Scream", "Lookaside"
+++FacePath string O Face picture path, max string length is 259
+++FaceScene
string O Face scene picture path, max string length is 259
Path
+++HumanPat
string O Human picture path, max string length is 259
h
+++HumanSce
string O Human scene picture path, max string length is 259
nePath

General APIs 125


[ Example ]
GET
Request http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&count=1
00
found=100
items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
items[0].EndTime=2011-1-1 13:00:00
items[0].Type=jpg
items[0].Events[0]=HumanTrait
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
items[0].Length=790
items[0].SummaryNew.Key=HumanTraitRecord
Da

items[0].SummaryNew.Value.HumanAttributes.CoatColor=White
hu

items[0].SummaryNew.Value.HumanAttributes.CoatType=1
a

items[0].SummaryNew.Value.HumanAttributes.TrousersColor=Black
items[0].SummaryNew.Value.HumanAttributes.TrousersType=1
HT

items[0].SummaryNew.Value.HumanAttributes.HasHat=2
TP

Respons items[0].SummaryNew.Value.HumanAttributes.HasBag=1
e items[0].SummaryNew.Value.HumanAttributes.Sex=Man
AP

items[0].SummaryNew.Value.HumanAttributes.Age=30
I

items[0].SummaryNew.Value.HumanAttributes.HairStyle=2
fo

items[0].SummaryNew.Value.HumanAttributes.HasUmbrella=1
r

items[0].SummaryNew.Value.HumanAttributes.Bag=0
We

items[0].SummaryNew.Value.HumanAttributes.Cap=2
st

items[0].SummaryNew.Value.FaceAttributes.Sex=Man
items[0].SummaryNew.Value.FaceAttributes.Age=35
Eu

items[0].SummaryNew.Value.FaceAttributes.Mask=0
ro

items[0].SummaryNew.Value.FaceAttributes.Beard=1
items[0].SummaryNew.Value.FaceAttributes.Glass=2
pe

items[0].SummaryNew.Value.FaceAttributes.Emotion=Smile
Te

items[0].SummaryNew.Value.FacePath=/mnt/2010/8/11/dav/15:40:50.jpg
items[0].SummaryNew.Value.FaceScenePath=/mnt/2010/8/11/dav/15:40:51.jpg
c hn


ic

Step 4 Close the finder.


a

This API is the same as the API in "4.11.5 Find Media Files".
l

Step 5 Destroy the finder.


This API is the same as the API in "4.11.5 Find Media Files".

4.11.9 Find media files with TrafficCar info


Step 1 Create a media files finder.
This API is the same as the API in "4.11.5 Find Media Files".
Step 2 Start to find media files satisfied the common conditions and TrafficCar conditions with
the finder

Table 4-190

General APIs 126


URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
Start to find media files satisfied the common conditions and TrafficCar conditions with
the finder.
Note: some request params can use compare condition, it's value is an array, first item is
a string of compare condition type, and the following items are compare values.
Compare condition type can be:
Description
"==": means equal, followed with one param, if param type is string, then param value can
contain some “*” to match any string.
"||": means equal one of the params, followed with one or more params.
"<>": means inside range, followed by two integer param,
"><": means outside range, followed by two integer param,
[ Request Params ] ( key=value format at URL )
Da

Name Type R/O Param Description


hu

object int R The finder object id


a

condition object R The search conditions


HT

The video channel to search, video channel index start from


+Channel int R
1, use -1 to search all video channel.
TP

+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"


AP

+EndTime string O End time to search, ex: "2010-06-25 12:05:00"


+Types array<string> O Search file types
I

Search flags. It can be: "Timing", "Manual", "Marker", "Event",


fo

+Flags array<string> O
"Mosaic", "Cutout"
r

Search event list


We

+Events array<string> O
Ignored, use Event under DB param.
st

Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.
Eu

+DB object R DB object


ro

++TrafficCar object R DB filter for TrafficCar


pe

+++PlateNumb <compare PlateNumber condition, use compare condition format, ex:


O
er condition> [ "==", "*888" ]
Te

<compare
+++Event O Event condition, ex: [ "||", "TrafficGate", "Alarm*" ]
c

condition>
hn

<compare
Speed condition, ex: [ "<>", 40, 80 ]
ic

+++Speed O
condition>
a

<compare Plate type condition, use compare condition format, ex: ["==",
l

+++PlateType O
condition> "Armed"],
<compare Plate color condition, use compare condition format, ex: ["==",
+++PlateColor O
condition> "Blue"],
+++VehicleCol <compare Vehicle color condition, use compare condition format, ex:
O
or condition> ["==", "White"],
[ Response Params ] ( OK )
[ Example ]
GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condit
Request ion.Channel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-1
0%2012:00:00&condition.Types[0]=jpg&condition.Flags[0]=Event&condition.DB.TrafficCar.

General APIs 127


PlateNumber[0]=%3d%3d&condition.DB.TrafficCar.PlateNumber[1]=%2a888&condition.D
B.TrafficCar.Speed[0]=%3c%3e&condition.DB.TrafficCar.Speed[1]=40&condition.DB.Traffi
cCar.Speed[2]=80&condition.DB.TrafficCar.VehicleColor[0]=%3d%3d&condition.DB.Traffic
Car.VehicleColor[1]=White
Response OK
Step 3 Get the media file information found by the finder

Table 4-191
URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
Descripti
Get the media file information found by the finder
on
[ Request Params ] ( key=value format at URL )
Da

Name Type R/O Param Description


object int R The finder object id
hu

count int R Record num to get, should less than 100.


a

[ Response Params ] ( key=value format )


HT

Name Type R/O Param Description


TP

found int R Record num that found.


items array<object> R Result record items.
AP

+Channel int R The video channel index start from 0,


I

+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


fo

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


r

+Type string R File type, should be: "jpg"


We

+Events array<string> R Events with this record


st

+FilePath string R File path, string max length is 259


+CutLength int R File length that cut between start time and end time
Eu

+Length int O File length of the whole file


ro

+Summary object R DB record info


pe

++TrafficCar object R TrafficCar record info


+++PlateNumb
string R Car plate number
Te

er
c

+++PlateType string O Plate type,


hn

+++PlateColor string O Plate color, ex: "Yellow", "Blue", … etc


ic

+++VehicleCol
string O Vehicle color, ex: "Yellow", "Blue", … etc
a

or
l

+++Country string O Country info. max string length is 19


+++Speed int O Vehicle speed, unit is km/hour
+++Event string O The event info, ex: “TrafficJunction”
[ Example ]
GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&co
Request
unt=100

General APIs 128


found=100
items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
items[0].EndTime=2011-1-1 13:00:00
items[0].Type=jpg
items[0].Events[0]=TrafficJunction
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
Respons items[0].Length=790
e items[0].Summary.TrafficCar.PlateNumber=A08888
items[0].Summary.TrafficCar.PlateType=Unknown
items[0].Summary.TrafficCar.PlateColor=Blue
items[0].Summary.TrafficCar.VehicleColor=White
items[0].Summary.TrafficCar.Country=China
Da

items[0].Summary.TrafficCar.Speed=70
hu

items[0].Summary.TrafficCar.Event=TrafficJunction

a

Step 4 Close the finder.


HT

This API is the same as the API in "4.11.5 Find Media Files".
TP

Step 5 Destroy the finder.


This API is the same as the API in "4.11.5 Find Media Files".
AP
I

4.11.10 Find media files with IVS info


fo
r

Step 1 Create a media files finder.


We

This API is the same as the API in "4.11.5 Find Media Files".
Step 2 Start to find media files satisfied the common conditions and IVS conditions with the
st

finder
Eu

Table 4-192
ro

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
pe

Method GET
Start to find media files satisfied the common conditions and IVS conditions with the
Te

Description
finder.
c

[ Request Params ] ( key=value format at URL )


hn

Name Type R/O Param Description


ic

object int R The finder object id


a l

condition object R The search conditions


The video channel to search, video channel index start from
+Channel int R
1, use -1 to search all video channel.
+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"
+EndTime string O End time to search, ex: "2010-06-25 12:05:00"
+Types array<string> O Search file types
Search flags. It can be: "Timing", "Manual", "Marker", "Event",
+Flags array<string> O
"Mosaic", "Cutout"
+Events array<string> O Search event list,
Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.

General APIs 129


+DB object R DB object
++IVS object R DB filter for IVS
IVS rule condition. It can be: "CrossLineDetection" , "Cro
ssRegionDetection" , "LeftDetection" , "WanderDetection
"
+++Rule string O
"MoveDetection" , "RioterDetection" , "CrossFenceDetectio
n" , "TakenAwayDetection" , "PasteDetection" , "Preservati
on" , "StayDetection" , "TailDetection"
IVS action. It can be: "Appear" , "Disappear" , "Inside" ,
+++Action string O
"Cross"
IVS object type, item in array can be: "Unknown" , "Human" ,
+++ObjectType array<string> O
"Vehicle" , "NonMotor"
[ Response Params ] ( OK )
Da

[ Example ]
hu

GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condit
a

ion.Channel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-1
HT

Request 0%2012:00:00&condition.Types[0]=jpg&condition.DB.IVS.Rule=CrossLineDetection&cond
ition.DB.IVS.Action=Cross&condition.DB.IVS.ObjectType[0]=Human&condition.DB.IVS.Ob
TP

jectType[1]=NonMotor
AP

Response OK
Step 3 Get the media file information found by the finder
I
fo

Table 4-193
r

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
We

Description Get the media file information found by the finder


st

[ Request Params ] ( key=value format at URL )


Eu

Name Type R/O Param Description


object int R The finder object id
ro

count int R Record num to get, should less than 100.


pe

[ Response Params ] ( key=value format )


Te

Name Type R/O Param Description


found int R Record num that found.
c hn

items array<object> R Result record items.


ic

+Channel int R The video channel index start from 0,


a

+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


l

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


+Type string R File type, should be: "jpg"
+Events array<string> R Events with this record
+FilePath string R File path, string max length is 259
+CutLength int R File length that cut between start time and end time
+Length int O File length of the whole file
+Summary object R DB record info
++IVS object R IVS record info
+++Rule string R IVS rule, see above for valid value
+++Action string O IVS action, see above for valid value

General APIs 130


+++ObjectType string O IVS object type, see above for valid value
[ Example ]
GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&
Request
count=100
found=100
items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
items[0].EndTime=2011-1-1 13:00:00
items[0].Type=jpg
items[0].Events[0]=CrossLineDetection
Response
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
items[0].Length=790
items[0].Summary.IVS.Rule=CrossLineDetection
Da

items[0].Summary.IVS.Action=Cross
hu

items[0].Summary.IVS.ObjectType=Human
a


Step 4 Close the finder.
HT

This API is the same as the API in "4.11.5 Find Media Files".
TP

Step 5 Destroy the finder.


This API is the same as the API in "4.11.5 Find Media Files".
AP
I

4.11.11 Find media files with NonMotor info


fo
r

Step 1 Create a media files finder.


We

This API is the same as the API in "4.11.5 Find Media Files".
st

Step 2 Start to find media files satisfied the common conditions and NonMotor conditions with
the finder
Eu

Table 4-194
ro

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
pe

Method GET
Start to find media files satisfied the common conditions and NonMotor conditions with
Te

Description
the finder.
c hn

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
ic

object int R The finder object id


a l

condition object R The search conditions


The video channel to search, video channel index start from
+Channel int R
1, use -1 to search all video channel.
+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"
+EndTime string O End time to search, ex: "2010-06-25 12:05:00"
+Types array<string> O Search file types
Search flags. It can be: "Timing", "Manual", "Marker", "Event",
+Flags array<string> O
"Mosaic", "Cutout"
+Events array<string> O Search event list,
Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.

General APIs 131


+DB object R DB object
++NonMotorRe
object R DB filter for NonMotor
cordFilter
+++NumOfCycl
int O Number of people that cycling, value can be 1 ~ 3
ing
NonMotor color, can be "White" "Orange" "Pink" "Black"
"Red" "Yellow" "Gray" "Blue" "Green" "Purple" "Brown"
"Sliver" "Darkviolet" "Maroon" "Dimgray" "Whitesmoke"
+++Color string O
"Darkorange" "Mistyrose" "Tomato" "Olive" "Gold"
"Darkolivegreen" "Chartreuse" "Greenyellow" "Forestgreen"
"Seagreen" "Deepskyblue" "Cyan" "Other"
NonMotor type, can be : "Non-Motor" "Bicycle" "Tricycle"
"Motorcycle" "DualTriWheelMotorcycle" "LightMotorcycle"
Da

+++Category string O "EmbassyMotorcycle" "MarginalMotorcycle"


hu

"AreaoutMotorcycle" "ForeignMotorcycle" "TrialMotorcycle"


a

"CoachMotorcycle"
+++Helmet int O Helmet status, 0 : unknown, 1 : without helmet, 2 : with helmet
HT

[ Response Params ] ( OK )
TP

[ Example ]
AP

GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condit
ion.Channel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-1
I

Request 0%2012:00:00&condition.Types[0]=jpg&condition.DB.NonMotorRecordFilter.NumOfCyclin
fo

g=2&condition.DB.NonMotorRecordFilter.Color=White&condition.DB.NonMotorRecordFilt
r

er.Category=Bicycle&condition.DB.NonMotorRecordFilter.Helmet=1
We

Response OK
st

Step 3 Get the media file information found by the finder

Table 4-195
Eu

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
ro

Method GET
pe

Description Get the media file information found by the finder


[ Request Params ] ( key=value format at URL )
Te

Name Type R/O Param Description


c hn

object int R The finder object id


ic

count int R Record num to get, should less than 100.


a

[ Response Params ] ( key=value format )


l

Name Type R/O Param Description


found int R Record num that found.
items array<object> R Result record items.
+Channel int R The video channel index start from 0,
+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"
+EndTime string R End time to search, ex: "2010-06-25 12:05:00"
+Type string R File type, should be: "jpg"
+Events array<string> R Events with this record
+FilePath string R File path, string max length is 259
+CutLength int R File length that cut between start time and end time
+Length int O File length of the whole file

General APIs 132


+SummaryNew object R NonMotor info
++Key string R DB record name, should be "NonMotorRecordFilter"
++Value object R DB record value
+++NumOfCycl
int O Number of people that cycling, value can be 1 ~ 3
ing
NonMotor color, can be "White" "Orange" "Pink" "Black"
"Red" "Yellow" "Gray" "Blue" "Green" "Purple" "Brown"
"Sliver" "Darkviolet" "Maroon" "Dimgray" "Whitesmoke"
+++Color string O
"Darkorange" "Mistyrose" "Tomato" "Olive" "Gold"
"Darkolivegreen" "Chartreuse" "Greenyellow" "Forestgreen"
"Seagreen" "Deepskyblue" "Cyan" "Other"
NonMotor type, can be : "Non-Motor" "Bicycle" "Tricycle"
"Motorcycle" "DualTriWheelMotorcycle" "LightMotorcycle"
Da

+++Category string O "EmbassyMotorcycle" "MarginalMotorcycle"


hu

"AreaoutMotorcycle" "ForeignMotorcycle" "TrialMotorcycle"


a

"CoachMotorcycle"
+++Helmet int O Helmet status, 0 : unknown, 1 : without helmet, 2 : with helmet
HT

[ Example ]
TP

GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&
Request
AP

count=100
found=100
I

items[0].Channel=1
fo

items[0].StartTime=2011-1-1 12:00:00
r

items[0].EndTime=2011-1-1 13:00:00
We

items[0].Type=jpg
st

items[0].Events[0]=NonMotorDetect
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
Response
Eu

items[0].Length=790
ro

items[0].SummaryNew.Key=NonMotorRecordFilter
pe

items[0].SummaryNew.Value.NumOfCycling=2
items[0].SummaryNew.Value.Color=White
Te

items[0].SummaryNew.Value.Category=Bicycle
c

items[0].SummaryNew.Value.Helmet=1
hn


ic

Step 4 Close the finder.


a

This API is the same as the API in "4.11.5 Find Media Files".
l

Step 5 Destroy the finder.


This API is the same as the API in "4.11.5 Find Media Files".

4.11.12 Download Media File with the File Name


Table 4-196
Syntax http://<server>/cgi-bin/RPC_Loadfile/<Filename>
Method GET
Description Download a file by filename. To get filename by chapter file finding.
http://192.168.1.108/cgi-bin/RPC_Loadfile/mnt/sd/2015-01-08/001/dav/19/19.57.12-19.
Example
58.25[M][0@0][0].dav

General APIs 133


HTTP Code: 200 OK
Content-Type: Application/octet-stream
Success Content-Length: <fileLength>
Return Body:
<data>
<data>
Parameters in URL:
Comment
Filename: name of media files which would be downloaded.

4.11.13 Download Media File between Times


Table 4-197
http://<server>/cgi-bin/loadfile.cgi?action=startLoad&channel=<ChannelNo>&startTim
Syntax
Da

e=<starttime>&endTime=<endtime>[&subtype=<typeNo>]
hu

Method GET
a

Description Download the media data between start time and end time.
http://192.168.1.108/cgi-bin/loadfile.cgi?action=startLoad&channel=1&startTime=2012-
HT

Example
10-8%2013:00:01&endTime=2012-10-8%2014:00:01&subtype=0
TP

HTTP Code: 200 OK


AP

Content-Type: Application/octet-stream
Success Content-Length:<fileLength>
I

Return Body:
fo

<data>
r

<data>
We

Parameters in URL:
st

ChannelNo: integer, video channel index which starts from 1.


typeNo: the stream type, default 0 if not specified.
Eu

0-Main Stream
Comment
ro

1-Extra Stream 1
pe

2-Extra Stream 2
starttime & endtime: video start time and end time. Time format: yyyy-mm-dd
Te

hh:mm:ss
c hn

4.12 User management


ic
a l

4.12.1 Get Information of a Particular User


Table 4-198
Syntax http://<server>/cgi-bin/userManager.cgi?action=getUserInfo&name=<userName>
Method GET
Description Get user information with name userName.
Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getUserInfo&name=admin
user.Name=admin
Success user.Memo=admin 's account
Return user.Group=admin
user.Reserved=true

General APIs 134


user.Sharable=true
user. AuthList=<authList>
Comment —

4.12.2 Get Information of All Users


Table 4-199
Syntax http://<server>/cgi-bin/userManager.cgi?action=getUserInfoAll
Method GET
Description Get information of all users.
Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getUserInfoAll
users[0].Group=admin
users[0].Id=1
Da

users[0].Memo=admin 's account


hu

users[0].Name=admin
Success
a

users[0].Reserved=true
Return
HT

users[0].Sharable=true
users[0]. AuthList=<authList>
TP

users[1].Group=admin
AP


Comment —
I
fo

4.12.3 Get Information of All Active Users


r
We

Table 4-200
st

Syntax http://<server>/cgi-bin/userManager.cgi?action=getActiveUserInfoAll
Method GET
Eu

Description Get active users.


ro

Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getActiveUserInfoAll
pe

users[0].name=admin
users[0].ip=10.43.2.16
Success
Te

users[0].group=admin
Return
c

users[0].clienttype=web3.0
hn

users[0].logintime=2011-11-08 09:51:03
ic

Comment —
a l

4.12.4 Get Information of a Particular Group


Table 4-201
Syntax http://<server>/cgi-bin/userManager.cgi?action=getGroupInfo&name=<groupName>
Method GET
Description Get group setting with name groupName.
Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getGroupInfo&name=admin
group.Name=admin
Success
group.Memo=administrator group
Return
group. AuthorityList=<authList>

General APIs 135


Parameters in URL:
The device has one or two default user groups: "admin"or "admin"and "user". The
"admin"group has all the authorities of operating the device. The "user"group only has
Comment
monitoring and replaying authorities.
groupName: name of the group.
If the group named groupName does not exist, the device returns Error.

4.12.5 Get Information of All Groups


Table 4-202
Syntax http://<server>/cgi-bin/userManager.cgi?action=getGroupInfoAll
Method GET
Description Get information of all groups.
Da

Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getGroupInfoAll
hu

group[0].Name=admin
a

group[0].Memo=administrator group
group[0]. AuthorityList=<authList>
HT

Success
group[1].Name=user
TP

Return
group[1].Memo=user group
AP

group[1]. AuthorityList=<authList>
group[2]….
I

Comment —
fo
r

4.12.6 Add a New User


We
st

Table 4-203
http://<server>/cgi-bin/userManager.cgi?action=addUser&user.Name=<userName>&u
Eu

Syntax ser.Password=<userPassword>&user.Group=<userGroup>&user.Sharable=<userSh
ro

arable>[&user.Memo=<userMemo>&user.Reserved=<userReserved>]
pe

Method GET
Description Add a user.
Te

http://192.168.1.108/cgi-bin/userManager.cgi?action=addUser&user.Name=George&us
Example
c

er.Password=123456&user.Group=user&user.Sharable=true&user.Reserved=false
hn

Success
ic

OK
Return
a

Parameters in URL:
l

userGroup: string, the range is "admin"and "user". In different group, the user has
Comment different authorities.
userSharable: bool, true means allow multi-point login.
userReserved: bool, true means this user can't be deleted.

4.12.7 Delete a User


Table 4-204
Syntax http://<server>/cgi-bin/userManager.cgi?action=deleteUser&name=<userName>
Method GET

General APIs 136


Description Delete user with name username.
Example http://192.168.1.108/cgi-bin/userManager.cgi?action=deleteUser&name=George
Success
OK
Return
Comment —

4.12.8 Modify User Information


Table 4-205
http://<server>/cgi-bin/userManager.cgi?action=modifyUser&name=<UserName>&user
Syntax .Memo=<userMemo>&user.Group=<userGroup>&user.Reserved=<userReserved>&us
er.Sharable=<userSharable>
Method GET
Da

Description Modify user info.


hu

http://192.168.1.108/cgi-bin/userManager.cgi?action=modifyUser&name=George&user
Example
a

.Group=admin
HT

Success
OK
Return
TP

Comment User is identified by <UserName>, other params are the same with AddUser.
AP

4.12.9 Modify User's Password


I
fo

Table 4-206
r

http://<server>/cgi-bin/userManager.cgi?action=modifyPassword&name=<username>
We

Syntax
&pwd=<newPwd>&pwdOld=<oldPwd>
st

Method GET
Description Modify user password.
Eu

http://192.168.1.108/cgi-bin/userManager.cgi?action=modifyPassword&name=George
Example
ro

&pwd=abcdef&pwdOld=123456
pe

Success
OK
Return
Te

Comment Old password oldPwd should be supplied, new password is newPwd.


c hn

4.13 Log
ic
a l

4.13.1 Find Logs


1. Whether or not found logs satisfied the conditions

Table 4-207
http://<server>/cgi-bin/log.cgi?action=startFind&condition.StartTime=<start>&condition
Syntax
.EndTime=<end>[& condition.Type=<type>]
Method GET
Description Start to find log.
Find log between 2011-1-1 12:00:00 and 2011-1-10 12:00:00, URL is:
Example
http://192.168.1.108/cgi-bin/log.cgi?action=startFind&condition.StartTime=2011-1-1%2

General APIs 137


012:00:00&condition.EndTime=2011-1-10%2012:00:00
Success
token=1
Return
Parameters in URL:
start/end: the start/end time of log. Format is: yyyy-mm-dd hh:mm:ss.
In response, there is a token for further log finding process. If token is greater than 0,
Comment
logs are found; otherwise no logs are found.
Type: log type. The range is { "System", "Config", "Event", "Storage", "Account", "Data",
"File", "CourseRecord" }.
2. Get the particular number of logs

Table 4-208
Syntax http://<server>/cgi-bin/log.cgi?action=doFind&token=<TokenValue>&count=<logCount>
Method GET
Da

Description Find log with token TokenValue and count logCount.


hu

Example http://192.168.1.108/cgi-bin/log.cgi?action=doFind&token=1&count=100
a

found=2
HT

items[0].RecNo=789
TP

items[0].Time=2011-05-20 11:59:10
items[0].Type=ClearLog
AP

items[0].User=admin
I

Success items[1].Detail.Compression=H.264->MJPG
fo

Return items[1].Detail.Data=Encode
r

items[1].RecNo=790
items[1].Time=2011-05-20 11:59:21
We

items[1].Type=SaveConfig
st

items[1].User=System

Eu

Parameters in URL:
ro

The TokenValue is got by startFind in the above section, and logCount is the count of
pe

Comment
logs for this query.
The maximum value of logCount is 100.
Te
c

Appendix:
hn

Field in Description
ic

Response
a l

found Count of found log, found is 0 if no log is found.


User User name.
Type Log type.
Time Time of this log.
RecNo Log number.
Detail Log details.
3. Stop query logs

Table 4-209
Syntax http://<server>/cgi-bin/log.cgi?action=stopFind&token=<TokenValue>
Method GET

General APIs 138


Description Stop query log by token TokenValue.
Example http://192.168.1.108/cgi-bin/log.cgi?action=stopFind&token=1
Success
OK
Return
Parameters in URL:
Comment
The TokenValue is got by startFind in above section

4.13.2 Clear All the Logs


Table 4-210

Syntax http://<server>/cgi-bin/log.cgi?action=clear
Method GET
Da

Description Clear all the logs.


hu

Example http://192.168.1.108/cgi-bin/log.cgi?action=clear
a

Success
OK
HT

Return

TP

Comment
AP

4.13.3 Backup Logs


I

Table 4-211
fo

http://<server>/cgi-bin/Log.backup?action=All&condition.StartTime=<startTime>&condi
r

Syntax
tion.EndTime=<endTime>
We

Method GET
st

Download the log information between the start time and the end time as a file named
Description
Log. Backup default.
Eu

http://192.168.1.108/cgi-bin/Log.backup?action=All&condition.StartTime=2014-8-25%2
ro

Example
000:02:32&condition.EndTime=2020-8-25%2001:02:32
pe

HTTP/1.1 200 OK
CONTENT-LENGTH: 743087
Te

CONNECTION: close
c

Content-type: application/binarytet-stream; charset=utf-8


hn
ic

&w_User: default
a

Success
&Time: 2014-09-01 15:20:45
l

Return
&Type: VideoLoss
&Content: EventType: VideoLoss
channel: <8>
StartTime: 2014-09-01 15:20:45


Parameters in URL:
startTime/endTime: the start/end time when log info built. 24 hour Format, as:
Comment
yyyy-mm-dd hh:mm:ss.
For example:

General APIs 139


2014-8-25 00:02:32
2020-8-25 01:02:32

4.14 Upgrader

4.14.1 Strat to Upgrade


Table 4-212
Syntax http://<server>/cgi-bin/upgrader.cgi?action=uploadFirmware
Method POST
Use this message to upload the firmware, and when the device receiving all the data
Description successfully, it will start to upgrade the device, and then use the getState method to get
the state.
Da

POST /cgi-bin/upgrader.cgi?action=uploadFirmware HTTP/1.1


hu

Host: 192.168.1.108
a

Connection: keep-alive
HT

Content-Type: multipart/form-data; boundary=---------------------------8655433224198


TP

Content-Length: xxxxxxxxx
AP

Example -----------------------------8655433224198
I

Content-Disposition:form-data;name="upgrade"; filename= "xxxxxx.bin"


fo

Content-Type: application/octet-stream
r

Firmware data….
We
st

-----------------------------8655433224198--
Success
Eu

OK
Return
ro

Comment —
pe

4.14.2 Get Upgrade State


Te
c hn

Table 4-213
Syntax http://<server>/cgi-bin/upgrader.cgi?action=getState
ic

Method GET
a l

Use this message to upload the firmware, and when the device receiving all the data
Description successfully, it will start to upgrade the device, and then use the getState method to get
the state.
Example http://192.168.1.108/cgi-bin/upgrader.cgi?action=getState
Success state.State=Upgrading
Return state.Progress=45
Parameters in Response:
State: the state of the upgrade, it can be Preparing, Downloading, DownloadFailed,
Comment
Upgrading, Invalid, Failed, Succeeded, Cancelled, and NotEnoughMemory.
Progress: the progress of the upgrade.

General APIs 140


5 SD Camera APIs
5.1 Video Attributes

5.1.1 Video in Focus


 Get video in focus config

Table 5-1
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInFocus
Da

Method GET
hu

Description Get video input focus config.


a

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInFocus
table.VideoInFocus[0][0].FocusLimit=100
HT

table.VideoInFocus[0][0].FocusLimitSelectMode=Manual
TP

table.VideoInFocus[0][0].IRCorrection=0
table.VideoInFocus[0][0].Mode=3
AP

table.VideoInFocus[0][0].Sensitivity=1
I

table.VideoInFocus[0][1].FocusLimit=100
fo

table.VideoInFocus[0][1].FocusLimitSelectMode=Manual
Success
r

table.VideoInFocus[0][1].IRCorrection=0
Return
We

table.VideoInFocus[0][1].Mode=3
st

table.VideoInFocus[0][1].Sensitivity=1
table.VideoInFocus[0][2].FocusLimit=100
Eu

table.VideoInFocus[0][2].FocusLimitSelectMode=Manual
ro

table.VideoInFocus[0][2].IRCorrection=0
table.VideoInFocus[0][2].Mode=3
pe

table.VideoInFocus[0][2].Sensitivity=1
Te

Comment —
c

 Set video in focus config


hn

Table 5-2
ic

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
a

Syntax
l

alue>[&<paramName>=<paramValue>…]
Method GET
Description Set video input focus config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInFocus[0][0].F
Example
ocusLimit=1000
Success
OK
Return

SD Camera APIs 141


Parameters in URL:
paramName and paramValue are as table below.
In table below,
head = VideoInFocus [ChannelNo] [ConfigNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.

Appendix:

ParamName ParamValue type Description


2—Auto focus, 3—Half auto focus, 4—Manual
head. Mode integer
focus
Da

head. FocusLimit integer 100,1000,2000,3000,5000,


hu

Range is 0,1,2
head. Sensitivity integer
a

0—high, 1—default, 2—low


head. IRCorrection integer 0: No correction; 1: Correction; 2: Auto correction
HT

head. FocusLimitSelectMode string Manual or Auto.


TP

5.1.2 Video in Zoom


AP
I

 Get video in zoom config


fo
r

Table 5-3
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInZoom
We

Method GET
st

Description Get video input zoom config.


Eu

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInZoom
table.VideoInZoom[0][0].DigitalZoom=true
ro

table.VideoInZoom[0][0].Speed=7
pe

table.VideoInZoom[0][0].ZoomLimit=4
table.VideoInZoom[0][1].DigitalZoom=true
Te

Success
table.VideoInZoom[0][1].Speed=0
c

Return
hn

table.VideoInZoom[0][1].ZoomLimit=4
ic

table.VideoInZoom[0][2].DigitalZoom=false
table.VideoInZoom[0][2].Speed=7
a l

table.VideoInZoom[0][2].ZoomLimit=4
Comment —
 Set video in zoom config

Table 5-4
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set video input zoom config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInZoom[0][0].D
Example
igitalZoom=false&VideoInZoom[0][0].Speed=8

SD Camera APIs 142


Success
OK
Return
Parameters in URL:
head = VideoInZoom [ChannelNo] [ConfigNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
video channel index -1, and so 0 means channel 1).
ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.

Appendix:

ParamName ParamValue type Description


true: Enable Digital Zoom
head. DigitalZoom integer
false: Disable Digital Zoom
Da

head. Speed integer Range is 0—100


hu
a

5.1.3 Video in Sharpness


HT

 Get video in sharpness


TP

Table 5-5
AP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInSharpness
I

Method GET
fo

Description Get video input sharpness settings.


r

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInSharp
Example
ness
We

table.VideoInSharpness[0][0].Level=4
st

table.VideoInSharpness[0][0].Mode=1
Eu

table.VideoInSharpness[0][0].Sharpness=8
table.VideoInSharpness[0][1].Level=4
ro

Success
table.VideoInSharpness[0][1].Mode=1
pe

Return
table.VideoInSharpness[0][1].Sharpness=8
table.VideoInSharpness[0][2].Level=4
Te

table.VideoInSharpness[0][2].Mode=1
c hn

table.VideoInSharpness[0][2].Sharpness=8
Comment —
ic

 Set video in sharpness


a l

Table 5-6
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set video input sharpness settings.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInSharpness[0]
Example
[0].Level=10&VideoInSharpness[0][0].Mode=1&VideoInSharpness[0][0].Sharpness=0
Success
OK
Return
Comment Parameters in URL:

SD Camera APIs 143


paramName and paramValue are as table below.
In table below,
head = VideoInSharpness [ChannelNo] [ConfigNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.

Appendix:

ParamName ParamValue type Description


head. Sharpness integer Range is 0—15
head. Level integer Range is 0—15
Da

5.1.4 Video in Mode


hu
a

 Get video in mode config


HT

Table 5-7
TP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInMode
Method GET
AP

Description Get video input mode settings.


I

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInMode
fo

table.VideoInMode[0].Config[0]=1
r

table.VideoInMode[0].Mode=0
table.VideoInMode[0].TimeSection[0][0]=0 00:00:00-23:59:59
We

table.VideoInMode[0].TimeSection[0][1]=0 00:00:00-23:59:59
st

table.VideoInMode[0].TimeSection[0][2]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[0][3]=0 00:00:00-23:59:59
Eu

table.VideoInMode[0].TimeSection[0][4]=0 00:00:00-23:59:59
ro

table.VideoInMode[0].TimeSection[0][5]=0 00:00:00-23:59:59
pe

table.VideoInMode[0].TimeSection[1][0]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[1][1]=0 00:00:00-23:59:59
Te

table.VideoInMode[0].TimeSection[1][2]=0 00:00:00-23:59:59
c hn

table.VideoInMode[0].TimeSection[1][3]=0 00:00:00-23:59:59
Success
table.VideoInMode[0].TimeSection[1][4]=0 00:00:00-23:59:59
ic

Return
table.VideoInMode[0].TimeSection[1][5]=0 00:00:00-23:59:59
a l

table.VideoInMode[0].TimeSection[2][0]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[2][1]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[2][2]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[2][3]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[2][4]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[2][5]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[3][0]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[3][1]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[3][2]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[3][3]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[3][4]=0 00:00:00-23:59:59

SD Camera APIs 144


table.VideoInMode[0].TimeSection[3][5]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[4][0]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[4][1]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[4][2]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[4][3]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[4][4]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[4][5]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[5][0]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[5][1]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[5][2]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[5][3]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[5][4]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[5][5]=0 00:00:00-23:59:59
Da

table.VideoInMode[0].TimeSection[6][0]=0 00:00:00-23:59:59
hu

table.VideoInMode[0].TimeSection[6][1]=0 00:00:00-23:59:59
table.VideoInMode[0].TimeSection[6][2]=0 00:00:00-23:59:59
a

table.VideoInMode[0].TimeSection[6][3]=0 00:00:00-23:59:59
HT

table.VideoInMode[0].TimeSection[6][4]=0 00:00:00-23:59:59
TP

table.VideoInMode[0].TimeSection[6][5]=0 00:00:00-23:59:59
Comment —
AP

 Set video in mode config


I
fo

Table 5-8
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
r

Syntax
alue>[&<paramName>=<paramValue>…]
We

Method GET
st

Description Set video input mde settings.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Mod
Eu

Example
e=0
ro

Success
pe

OK
Return
Parameters in URL:
Te

paramName and paramValue are as table below.


c hn

In table below,
Comment
head = VideoInMode [ChannelNo]
ic

ChannelNo: integer, array index starts from 0, which means video channel (equals to
a l

video channel index -1, and so 0 means channel 1).

Appendix:

ParamName ParamValue type Description


Range is {0,1}
head. Mode integer 0: No Switch;
1: Switch depends on head.TimeSection.
Mode=0 Config[0]={0,1/2}
head. Config integer Mode=1 Config[1]={ 1 }
Config[2]={ 2 }

SD Camera APIs 145


ParamName ParamValue type Description
The time format is "0 H:m: H:m:S "
head. TimeSection[0][0] integer
For example: 0 00:00:00-10:59:59

5.1.5 Video in Day Night Mode Shift


 Get video in day night mode shift config

Table 5-9
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInDayNight
Method GET
Description Get video in day night mode shift config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInDayNight
Da

table.VideoInDayNight[0][0].Delay=10
hu

table.VideoInDayNight[0][0].Mode=Brightness
table.VideoInDayNight[0][0].Sensitivity=2
a

table.VideoInDayNight[0][0].Type=Mechanism
HT

table.VideoInDayNight[0][1].Delay=10
TP

Success table.VideoInDayNight[0][1].Mode=Brightness
Return table.VideoInDayNight[0][1].Sensitivity=2
AP

table.VideoInDayNight[0][1].Type=Mechanism
I

table.VideoInDayNight[0][2].Delay=10
fo

table.VideoInDayNight[0][2].Mode=Brightness
r

table.VideoInDayNight[0][2].Sensitivity=2
We

table.VideoInDayNight[0][2].Type=Mechanism
VideoInDayNight[ChannelNo][ConfigNo]:
st

ChannelNo: integer, array index starts from 0, which means video channel (equals to
Eu

Comment video channel index -1, and so 0 means channel 1).


ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for night,
ro

and 2 means config for normal scene.


pe

 Set video in day night mode shift config


Te

Table 5-10
c

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
hn

Syntax
alue>[&<paramName>=<paramValue>…]
ic

Method GET
a l

Description Set video in day night mode shift config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInDayNight[0][
Example
0].Mode=BlackWhite
Success
OK
Return
Parameters in URL:
Comment ParamName and paramValue are as table below. In table below,
head = VideoInDayNight[ChannelNo][ConfigNo]

Appendix:

ParamName ParamValue type Description

SD Camera APIs 146


ParamName ParamValue type Description
The range is {"Electron", "Mechanism"}, the way of ICR
head. Type string
switching.
The range is {"Color", "Brightness", "BlackWhite",
"Photoresistor", "Gain"}.
Color: always in color mode.
Brightness: shift to color or day-and- night mode
head. Mode string according to the Brightness.
BlackWhite: always in black-and-white mode, in contrast
to Color mode.
Photoresistor: switchingt mode by photoresistor.
Gain: switching mode according to the gain.
head. Sensitivity integer Range is [0-7]. Sensitivity of switching mode
Da

Range is [3-30].
head. Delay integer
hu

Delay seconds when switching mode.


a

5.1.6 Lighting
HT
TP

 Get lighting config


AP

Table 5-11
I

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Lighting
fo

Method GET
r

Description Get lighting config.


We

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Lighting
table.Lighting[0][0].Correction=50
st

table.Lighting[0][0].FarLight[0].Angle=0
Eu

table.Lighting[0][0].FarLight[0].Light=0
table.Lighting[0][0].Mode=ZoomPrio
ro

table.Lighting[0][0].NearLight[0].Angle=0
pe

table.Lighting[0][0].NearLight[0].Light=0
Te

table.Lighting[0][0].Sensitive=3
table.Lighting[0][1].Correction=50
c hn

table.Lighting[0][1].FarLight[0].Angle=0
ic

table.Lighting[0][1].FarLight[0].Light=0
Success
table.Lighting[0][1].Mode=ZoomPrio
a

Return
l

table.Lighting[0][1].NearLight[0].Angle=0
table.Lighting[0][1].NearLight[0].Light=0
table.Lighting[0][1].Sensitive=3
table.Lighting[0][2].Correction=50
table.Lighting[0][2].FarLight[0].Angle=0
table.Lighting[0][2].FarLight[0].Light=0
table.Lighting[0][2].Mode=ZoomPrio
table.Lighting[0][2].NearLight[0].Angle=0
table.Lighting[0][2].NearLight[0].Light=0
table.Lighting[0][2].Sensitive=3
Comment Lighting[ChannelNo][ConfigNo]:

SD Camera APIs 147


ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.
 Set lighting config

Table 5-12
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set lighting config.
Turn on light:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0].FarLig
Da

ht[0].Light=10&Lighting[0][0].NearLight[0].Light=90&Lighting[0][0].Mode=Manual
Example
hu

Shift the light to ZoomPrio mode:


a

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0].Correct
HT

ion=50&Lighting[0][0].Mode = ZoomPrio
TP

Success
OK
Return
AP

Parameters in URL:
I

paramName and paramValue are as table below.


fo

Comment In table below,


r

head = Lighting [ChannelNo] [ConfigNo]


We

Lighting[0][0].FarLight[0].Light+ Lighting[0][0].NearLight[0].Light<=100.
st

Appendix:
Eu

ParamName ParamValue type Description


ro

Light mode.
The range is {"Manual", "Auto", "Off",
pe

"ZoomPrio", "Timing", "SmartLight",


Te

head. Mode string "LinkLight"}.


Manual: the settings below effective only in
c hn

Manual mode.
ic

ZoomPrio: zoom priority.


a

Light compensation.
l

head. Correction integer The range is [0—100], effective in ZoomPrio


mode.
head. Sensitive integer Range is [0—5]. Sensitivity of light
Range is [0-100].
head. FarLight[Index].Angle integer
The angle of the far light.
Range is [0—100].
head. FarLight[Index]. Light integer
The luminance of far light.
Range is [0—100].
head. MiddleLight [Index].Angle integer
The angle of the middle light.
Range is [0—100].
head. MiddleLight [Index]. Light integer
The luminance of middle light.

SD Camera APIs 148


ParamName ParamValue type Description
Range is [0—100].
head. NearLight [Index].Angle integer
The angle of the near light.
Range is [0—100].
head. NearLight [Index]. Light integer
The luminance of near light.

5.2 Wiper

5.2.1 Move Continuously


Table 5-13
http://<server>/cgi-bin/rainBrush.cgi?action=moveContinuously&interval=<Second>[&c
Syntax
hannel=<ChannelNo>]
Da

Method GET
hu

Description Control the wiper to move continuously.


a

Example http://192.168.1.108/cgi-bin/rainBrush.cgi?action=moveContinuously&interval=5
HT

Success
OK
TP

Return
Second: integer, rain brush movement time interval which start from 1.
AP

Comment
ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.
I
fo

5.2.2 Stop Move


r

Table 5-14
We

Syntax http://<server>/cgi-bin/rainBrush.cgi?action=stopMove[&channel=<ChannelNo>]
st

Method GET
Eu

Description Control the wiper to stop moving.


Example http://192.168.1.108/cgi-bin/rainBrush.cgi?action=stopMove
ro

Success
pe

OK
Return
Te

Comment ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.
c hn

5.2.3 Move Once


ic

Table 5-15
a l

Syntax http://<server>/cgi-bin/rainBrush.cgi?action=moveOnce[&channel=<ChannelNo>]
Method GET
Description Control the wiper to move once.
Example http://192.168.1.108/cgi-bin/rainBrush.cgi?action=moveOnce
Success
OK
Return
Comment ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.

SD Camera APIs 149


6 Storage APIs
6.1 Storage Devices

6.1.1 Get Hard Disk Information


Table 6-1
Syntax http://<server>/cgi-bin/storageDevice.cgi?action=factory.getPortInfo
Method GET
Da

Description Get the storage device port info.


hu

Example http://192.168.1.108/cgi-bin/storageDevice.cgi?action=factory.getPortInfo
a

info.Total=2
info.Plug=1
HT

Success info.Mask=1
TP

Return info.Bad=0
info.IDE=1
AP

info.Esata=4
I

Comment —
fo
r

6.1.2 Get All the Names of Storage Devices


We
st

Table 6-2
Syntax http://<server>/cgi-bin/storageDevice.cgi?action=factory.getCollect
Eu

Method GET
ro

Description Get all the names of storage devices.


pe

Example http://192.168.1.108/cgi-bin/storageDevice.cgi?action=factory.getCollect
list[0]="/dev/sda0"
Success
Te

list[1]="/dev/sda1"
Return
c

list[2]="/dev/sg1"
hn

Comment —
ic
a

6.1.3 Get Storage Device Information


l

Table 6-3
Syntax http://<server>/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo
Method GET
Description Get all the storage device information.
Example http://192.168.1.108/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

Storage APIs 150


list[0].Detail[0].IsError=false
list[0].Detail[0].Pointer=27023434
list[0].Detail[0].TotalBytes=0
Success
list[0].Detail[0].Type=ReadWrite
Return
list[0].Detail[0].UsedBytes=0
list[0].Name="/dev/sda"
list[0].State=Success
Comment —

6.1.4 Get Storage Capability


Table 6-4
Syntax http://<server>/cgi-bin/storage.cgi?action=getCaps
Da

Method GET
hu

Description Get storage capabilities.


a

Example http://192.168.1.108/cgi-bin/storage.cgi?action=getCaps
HT

Success caps.RedundantDisk.Support=false
Return caps.SupportRemoteLimit=true
TP

Comment —
AP

6.1.5 Format Camera SD-Card


I
fo

Table 6-5
r

http://<server>/cgi-bin/storageDevice.cgi?action=setDevice&type=FormatPatition&path=
Syntax
We

<path>
st

Method GET
Description Format camera SD card.
Eu

http://192.168.1.108/cgi-bin/storageDevice.cgi?action=setDevice&type=FormatPatition&
ro

Example
path= /dev/sda
pe

Success
OK
Return
Te

If set successfully, return true, else return false.


c

Comment path : The stringValue is got from cgi API "Get storage device information"
hn

(/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo). stringValue is list[0].Name.


ic
a

6.2 NAS
l

6.2.1 NAS Information


 Get NAS config

Table 6-6
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=NAS
Method GET
Description Get all the directories on the NAS server.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=NAS

Storage APIs 151


table.NAS[0].Name=" FTP1"
table.NAS[0].Enable = true
table.NAS[0].Protocol ="FTP"
Success table.NAS[0].Address ="www.ttt.com"
Return table.NAS[0].Port =21
table.NAS[0].UserName ="anonymity"
table.NAS[0].Password ="none"
table.NAS[0].Directory ="share"
Comment —
 Set NAS config

Table 6-7
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Da

Method GET
hu

Description Set NAS config.


a

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NAS[0].Name=nas0
Example
HT

1&NAS[0].Enable=true
TP

Success
OK
Return
AP

Parameters in URL:
I

In table below,
Comment
fo

Head =NAS[index]
r

index: The index of the NAS Server


We

Appendix:
st

ParamName ParamValue type Description


Eu

Head. Name string NAS name.


Head. Enable bool Enable/Disable the NAS.
ro

Head. Protocol string The range is {"FTP", "SMB"}


pe

Head. Address string The IP address or host name.


Te

Head. Port integer NAS port.


Head. UserName string NAS username.
c hn

Head. Password string NAS password.


ic

Head. Directory string Directory name.


a l

6.3 Storage Point

6.3.1 Record Storage Point


 Get record storage point config

Table 6-8
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=RecordStoragePoi
Syntax
nt
Method GET
Description Get record storage point config.

Storage APIs 152


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RecordStora
Example
gePoint
table.RecordStoragePoint [0].TimingRecord.Local ="local"
table.RecordStoragePoint [0].TimingRecord. Redundant =" Redundant"
table.RecordStoragePoint [0].TimingRecord. Remote =" FTP"
Success
table.RecordStoragePoint [0].TimingRecord. AutoSync = false
Return
table.RecordStoragePoint [0].TimingRecord. AutoSyncRange =0
table.RecordStoragePoint [0].TimingRecord. LocalForEmergency =false
table.RecordStoragePoint [0].TimingRecord. CompressBefore =15
Comment —
 Set record storage point config

Table 6-9
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Da

Syntax
alue>[&<paramName>=<paramValue>…]
hu

Method GET
a

Description Set record storage point config.


HT

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&RecordStoragePoint[
Example
TP

0].TimingRecord.Local=local
Success
AP

OK
Return
I

Parameters in URL:
fo

In table below,
r

ch: integer, array index starts from 0, which means video channel(equals to video
Comment channel index -1, and so 0 means channel 1).
We

recType: The range is {"TimingRecord", "VideoDetectRecord", "AlarmRecord",


st

"EventRecord", "TimingSnapShot", "VideoDetectSnapShot", "AlarmSnapShot",


"EventSnapShot"}
Eu
ro

Appendix:
pe

ParamName ParamValue type Description


RecordStoragePoint
Te

string Local directory name.


[ch].[recType].Local
c hn

RecordStoragePoint [ch].[recType].
string Redundant directory name.
ic

Redundant
RecordStoragePoint [ch].[recType].
a

string Remote directory name.


l

Remote
When remote directory recovers, auto
RecordStoragePoint [ch].[recType].
bool synchronize local directory to remote
AutoSync
directory or not.
From the remote directory recovering
time, how long the data needs to be
RecordStoragePoint [ch].[recType].
integer synchronized. The unit is hour. If it is
AutoSyncRange
0, all the data needs to be
synchronized.

Storage APIs 153


ParamName ParamValue type Description
When the remote directory is
RecordStoragePoint [ch].[recType].
bool unusable, save the data the local
LocalForEmergency
directory or not.
RecordStoragePoint [ch].[recType]. The days' data which will be
integer
CompressBefore compressed.

6.3.2 Storage Group


 Get storage group config

Table 6-10
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageGroup
Method GET
Da

Description Get storage group config.


hu

http://192.168.1.168/cgi-bin/configManager.cgi?action=getConfig&name=StorageGrou
a

Example
p
HT

table.StorageGroup[0].Channels[0].MaxPictures=0
TP

table.StorageGroup[0].FileHoldTime=0
table.StorageGroup[0].Memo=For Reading & Writing Files
AP

table.StorageGroup[0].Name=ReadWrite
I

table.StorageGroup[0].OverWrite=true
fo

table.StorageGroup[0].PicturePathRule=%y-%M-%d/%c/jpg/%h/%m/%s[%E][%O@%S
r

][%R].jpg
table.StorageGroup[0].RecordPathRule=%y-%M-%d/%c/dav/%h/%h.%m.%s-%h.%m.
We

Success %s[%E][%O@%S][%R].dav
st

Return table.StorageGroup[1].Channels[0].MaxPictures=0
table.StorageGroup[1].FileHoldTime=0
Eu

table.StorageGroup[1].Memo=For FTP Files


ro

table.StorageGroup[1].Name=Remote
pe

table.StorageGroup[1].OverWrite=true
table.StorageGroup[1].PicturePathRule=%y-%M-%d/%c/jpg/%h/%m/%s[%E][%O@%S
Te

][%R].jpg
c hn

table.StorageGroup[1].RecordPathRule=%y-%M-%d/%c/dav/%h/%h.%m.%s-%h.%m.
%s[%E][%O@%S][%R].da
ic

Comment —
a l

 Set storage group config

Table 6-11
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set storage group config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageGroup[0].Na
Example
me=main
Success
OK
Return

Storage APIs 154


Parameters in URL:
In table below,
Comment Index = Storage Group index
ch: integer, array index starts from 0, which means video channel (equals to video
channel index -1, and so 0 means channel 1).

Appendix:

ParamName ParamValue type Description


StorageGroup[Index]. Name string Storage group name.
StorageGroup[Index]. Memo string Storage group memo.
StorageGroup[Index]. FileHoldTime integer How many days the file will hold.
Over write or not when there is not
StorageGroup[Index]. OverWrite bool
enough storage.
Da

The max pictures beyond which the


hu

StorageGroup[Index]. Channels[ch]. old pictures will be over written. If it


Integer
a

MaxPictures is 0, the old pictures will be not over


HT

written.
StorageGroup[Index]. Channels[ch].
TP

string The channel path.


Path
AP

6.4 SDEncrypt
I
fo

6.4.1 Encrypt SD Card


r
We

Table 6-12
st

http://<server>/cgi-bin/SDEncrypt.cgi?action=encrypt&deviceName=<deviceName>&p
Syntax
assword=<password>
Eu

Method GET
ro

Description SD encryption operation.


pe

http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=encrypt&deviceName=/dev/mmc0&
Example
password=123456
Te

Success
c

OK
hn

Return
ic

If set successfully, return true, else return false.


deviceName: The stringValue is got from cgi API Get storage device information
a

Comment
l

(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
password: The stringValue Card is Encrypted

6.4.2 Decrypt SD Card


Table 6-13
http://<server>/cgi-bin/SDEncrypt.cgi?action=decrypt&deviceName=<deviceName>&p
Syntax
assword=<password>
Method GET
Description SD decrypt operation.

Storage APIs 155


http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=decrypt&deviceName=/dev/mmc0&
Example
password=123456
Success
OK
Return
If set successfully, return true, else return false.
deviceName: The stringValue is got from cgi API Get storage device information
Comment
(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
password: The stringValue ard is Encrypted

6.4.3 Clear SD Card Password


Table 6-14
http://<server>/cgi-bin/SDEncrypt.cgi?action=clearPassword&deviceName=<deviceNa
Syntax
Da

me>&password=<password>
hu

Method GET
a

Description SD clear password operation.


HT

http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=clearPassword&deviceName=/dev/
Example
mmc0&password=123456
TP

Success
OK
AP

Return
If set successfully, return true, else return false.
I

deviceName: The stringValue is got from cgi API Get storage device information
fo

Comment
(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
r

password: The stringValue ard is Encrypted


We
st

6.4.4 Modify SD Card Password


Eu

Table 6-15
ro

http://<server>/cgi-bin/SDEncrypt.cgi?action=modifyPassword&deviceName=<device
Syntax
pe

Name>&password=<password>&oldPassword=<oldPassword>
Method GET
Te

Description SD change password operation.


c

http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=clearPassword&deviceName=/dev/
hn

Example
mmc0&password=123456&oldPassword=admin123
ic

Success
OK
a

Return
l

If set successfully, return true, else return false.


deviceName: The stringValue is got from cgi API Get storage device information
Comment (cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
password: The new stringValue Card is Encrypted
oldPassword: The old stringValue Card is Encrypted

6.4.5 Get SD Card Operate Error Policy


Table 6-16
Syntax http://<server>/cgi-bin/SDEncrypt.cgi?action=getOperateErrorPolicy&deviceName=<de

Storage APIs 156


viceName>&operate=<operate>
Method GET
When decrypt, clearPassword, modifyPassword failed, get the error info, leftTimes and
Description
left time.
http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=getOperateErrorPolicy&deviceNam
Example
e=/dev/mmc0&operate=decrypt
Success policy.leftTimes=5
Return policy.lockSeconds=30
If set successfully, return true, else return false.
deviceName: the stringValue is got from cgi API Get storage device information
(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
Comment
Operate: operate type, can be: decrypt, modifyPassword and clearPassword
leftTimes : remain operate times, max is 5
Da

lockSeconds : lock operate time, unit is seconds, max is 30


hu
a

6.4.6 Storage Health Alarm Settings


HT

 Get StorageHealthAlarm config


TP

Table 6-17
AP

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageHealthAlar
Syntax
I

m
fo

Method GET
r

Description Get SD health info alarm config.


http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageHealthAlar
We

Example
m
st

table.StorageHealthAlarm.Enable=true
Eu

Success table.StorageHealthAlarm.LowerLimit=10
Return table.StorageHealthAlarm.EventHandler= (output of EventHandler is described in
ro

GetEventHandler)
pe

Comment —
 Set StorageHealthAlarm config
Te
c

Table 6-18
hn

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
ic

Syntax
alue>[&<paramName>=<paramValue>…]
a

Method GET
l

Description Set SD health info alarm config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageHealthAlarm.
Example
Enable=true
Success
OK
Return
Comment —

Storage APIs 157


7 Display APIs
7.1 GUI

7.1.1 GUISet
 Get GUISet config

Table 7-1
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=GUISet
Da

Method GET
hu

Description Get the GUI settings. Every video out screen has a group setting.
a

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=GUISet
table.GUISet[index]. WindowAlpha =128
HT

table.GUISet[index]. TimeTitleEnable =true


TP

table.GUISet[index]. TimeTitlePos[0]=0
table.GUISet[index]. TimeTitlePos[1]=0
AP

table.GUISet[index]. TimeTitlePos[2]=8191
I

table.GUISet[index]. TimeTitlePos[3]=8191
fo

table.GUISet[index]. MenuShowOption =0
r

Success table.GUISet[index]. MenuAutoHideTime =10


We

Return table.GUISet[index]. AutoLogout =10


st

table.GUISet[index]. ChannelTitleShowEnable =true


table.GUISet[index]. ChannelTitlePos[0]=0
Eu

table.GUISet[index]. ChannelTitlePos[1]=0
ro

table.GUISet[index]. ChannelTitlePos[2]=8191
table.GUISet[index]. ChannelTitlePos[3]=8191
pe

table.GUISet[index]. AutoGuideEnable =true


Te


c

Parameters in Response :
Comment
hn

index: the array index which starts from 0.


ic

 Set GUISet config


a

Table 7-2
l

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set the GUI settings. Every video out screen has a group setting.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&GUISet[0].WindowAl
Example
pha=192&GUISet[0].TimeTitleEnable=false&GUISet[0].MenuShowOption=1
Success
OK
Return

Display APIs 158


Parameters in URL:
The paramName and paramValue are in the table below.
Comment
in table below,
index : the array index which starts from 0.

Appendix:

ParamName ParamValue type Description


Diaphaneity of the window
GUISet[index].WindowAlpha integer
background.
GUISet[index].TimeTitleEnable bool Show the time title or not.
GUISet[index].TimeTitlePos[0] integer
GUISet[index].TimeTitlePos[1] integer
The position of the time title.
GUISet[index].TimeTitlePos[2] integer
Da

GUISet[index].TimeTitlePos[3] integer
hu

0: Show the directory.


a

GUISet[index].MenuShowOption integer 1: Hide the directory.


HT

2: Timing-hide the directory.


How many seconds to hide the
TP

GUISet[index].MenuAutoHideTime integer
directory.
AP

How many minutes to auto logout.


I

GUISet[index].AutoLogout integer The range is [0-120]. 0 expresses not


logout.
fo

GUISet[index].ChannelTitleShowEnable bool Show the channel title or not.


r

GUISet[index].ChannelTitlePos[0] integer
We

GUISet[index].ChannelTitlePos[1] integer
The position of the channel title.
st

GUISet[index].ChannelTitlePos[2] integer
GUISet[index].ChannelTitlePos[3] integer
Eu

GUISet[index].AutoGuideEnable bool Auto guide or not when startup.


ro
pe

7.2 Split Screen


Te

7.2.1 Split Screen Mode


c hn
ic

 Get split screen mode


a

Table 7-3
l

Syntax http://<server>/cgi-bin/split.cgi?action=getMode&channel=<ChannelNo>
Method GET
Description Get the split screen mode.
Example http://192.168.1.108/cgi-bin/split.cgi?action=getMode&channel=1
Success mode=split1
Return group=4
Parameters in URL:
Comment
ChannelNo: the display screen No. Start from 1 and <= 2.
 Set split screen mode

Display APIs 159


Table 7-4
http://<server>/cgi-bin/split.cgi?action=setMode&channel=<ChannelNo>&mode=<mo
Syntax
de>&group=<group>
Method GET
Description Set the split screen mode.
http://192.168.1.108/cgi-bin/split.cgi?action=setMode&channel=1&mode=split4&group
Example
=1
Success
OK
Return
Parameters in URL:
ChannelNo: the display screen No. Start from 1.
mode:enum{split1,split2,split4,split6,split8,split9,split12,split16,split20,split25,split36,sp
lit64,split144,pip1,pip3, "Free", "CompositeSplit1" / "FitDisplayUnit1", "CompositeSplit1"
Comment
Da

/ "FitDisplayUnit4"};
hu

group: the No. of a group which contains certain number channels. For example, if 16
a

video channels display in split4 Mode which contains 4 video channels on Screen, then
there are 4 groups and each group contains 4 video channels.
HT
TP

7.3 Moniter Tour


AP
I

7.3.1 Moniter Tour


fo

Get moniter tour config


r


We

Table 7-5
st

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MonitorTour
Method GET
Eu

Description Get monitor tour config.


ro

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MonitorTour
pe

table.MonitorTour[ch].Enable=128
table.MonitorTour[ch].Interval=true
Success
Te

table.MonitorTour[ch].Mask.Split1=0,1,5
Return
c

table.MonitorTour[ch].Mask.Split8=0,1,5
hn

table.MonitorTour[ch].Collections=Favortite1, Favortite2…
ic

Comment —
a

 Set moniter tour config


l

Table 7-6
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set monitor tour config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MonitorTour[0].Enabl
Example
e=true
Success
OK.
Return
Comment Parameters in URL:

Display APIs 160


The paramName and paramValue are in the table below.

Appendix:

ParamName ParamValue type Description


MonitorTour[ch].Enable bool MonitorTour or not.
MonitorTour[ch].Interval integer MonitorTour interval.
MonitorTour[ch].Mask.Split1 — Channel array for split1
MonitorTour[ch].Mask.Split8 — Channel array for split8
MonitorTour[ch].Collections — Split collections

7.3.2 Enable Tour


Table 7-7
Da

http://<server>/cgi-bin/split.cgi?action=enableTour&channel=<ChannelNo>&enable=<fl
Syntax
hu

ag>
a

Method GET
HT

Description Enable tour in every video channel on a screen or not.


Example http://192.168.1.108/cgi-bin/split.cgi?action=enableTour&channel=1&enable=true
TP

Success
OK
AP

Return
I

ChannelNo: the display screen No. Start from 1 and <= 2.


Comment
flag : true or false
fo
r

7.3.3 Monitor Collection


We
st

 Get monitor collection config


Eu

Table 7-8
ro

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MonitorCollection
Method GET
pe

Description Get monitor collection config.


Te

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MonitorCollec
Example
tion
c hn

table.MonitorCollection.collectionname. Mode=Split1
ic

table.MonitorCollection.collectionname.Windows[winno].Enable= true
a

table.MonitorCollection.collectionname.Windows[winno].Device=device1
l

Success table.MonitorCollection.collectionname.Windows[winno].VideoChannel=5
Return table.MonitorCollection.collectionname.Windows[winno].VideoStream=Main
table.MonitorCollection.collectionname.Windows[winno].AudioChannel=5
table.MonitorCollection.collectionname.Windows[winno].AudioStream=Main

Parameters in Response :
Comment winno : integer, the array index which equals to the window index in a screen and starts
from 0.
 Set monitor collection config

Table 7-9

Display APIs 161


http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set monitor collection config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MonitorCollection.Fa
Example vorite1.Mode=split4&MonitorCollection.Favorite1.Windows[1].Enable=true&MonitorColl
ection.Favorite1.Windows[1].VideoChannel=2
Success
OK
Return
Parameters in URL:
The paramName and paramValue are in the table below.
In table below:
Comment Collect= MonitorCollection.collectionname.
Da

collectionname: can be any name.


hu

winno: integer, the array index which equals to the window index in a screen and starts
a

from 0.
HT

Appendix:
TP

ParamName ParamValue type Description


AP

The range is the same as


Collect. Mode string
SetSplitMode.
I

Collect. Windows[winno]. Enable bool Enable the window or not.


fo

Collect. Windows[winno]. Device string The device Id.


r

Collect. Windows[winno].
integer The video channel.
We

VideoChannel
st

Collect. Windows[winno]. The range is {"Main", "Extra1", "Extra2",


string
VideoStream "Extra3", "Auto"}.
Eu

Collect. Windows[winno].
integer The audio channel.
ro

AudioChannel
pe

Collect. Windows[winno]. The range is {"Main", "Extra1", "Extra2",


string
AudioStream "Extra3", "Auto"}.
Te
c hn
ic
a l

Display APIs 162


8 Video Analyse APIs
8.1 Video Analyse

8.1.1 Get Video Analyse Capability


Table 8-1
Syntax http://<server>/cgi-bin/devVideoAnalyse.cgi?action=getcaps&channel=<ChannelNo>
Method GET
Da

Description Get video analyse capabilities.


hu

Example http://192.168.1.108/cgi-bin/devVideoAnalyse.cgi?action=getcaps&channel=1
a

caps.CalibrateBoxs[0]=2
caps.CalibrateBoxs[1]=3
HT

caps.ComplexSizeFilter=false
TP

caps.MaxCelibateAreas=10
caps.MaxExcludeRegions=0
AP

caps.MaxInternalOptions=512
I

caps.MaxModules=1
fo

caps.MaxPointOfLine=20
r

caps.MaxPointOfRegion=20
We

caps.MaxRules=10
st

caps.MaxStaffs=4
caps.SpecifiedObjectFilter=true
Eu

caps.SupportedRules[0]=CrossLineDetection
ro

caps.SupportedRules[1]=CrossRegionDetection
Success
caps.SupportedRules[2]=LeftDetection
pe

Return
caps.SupportedRules[3]=TakenAwayDetection
Te

caps.SupportedScene[0]=Normal
caps.SupportedScene[1]=FaceDetection
c hn

caps.SupportedScene[2]=VideoDiagnosis
ic

caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.HorizontalSt
a

affs[0]=0
l

caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.HorizontalSt
affs[1]=0
caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.VerticalStaffs
[0]=0
caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.VerticalStaffs
[1]=0
caps.SupportedScenes.StereoNumber.SupportedRules.ManNumDetection.SupportLoc
alDataStore=false
Parameters in URL:
Comment
ChannelNo: integer, video channel index which starts from 1.

Video Analyse APIs 163


8.1.2 Video Analyse Global
 Get video analyse global config

Table 8-2
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyseGlob
Syntax
al
Method GET
Description Get video analyse global config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyse
Example
Global
head.Scene.Type=Normal
head.Scene.PtzPresetId=1
Da

head.Scene.Depth=Far
hu

head.Scene.Detail.CameraAngle=30
a

head.Scene.Detail.CameraDistance=10.000000
Success
head.Scene.Detail.CameraHeight=6.200000
HT

Return
head.TimePeriod.Day[0]=8:00:00
TP

head.TimePeriod.Day[1]=20:00:00
head.TimePeriod.Night[0]=20:00:00
AP

head.TimePeriod.Night[1]=8:00:00
I


fo

Parameters in Response :
r

head =table.VideoAnalyseGlobal[ChannelNo]
Comment
We

ChannelNo: integer, array index starts from 0, which means video channel(equals to
st

video channel index -1, and so 0 means channel 1).


 Set video analyse global config
Eu

Table 8-3
ro

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
pe

Syntax
alue>[&<paramName>=<paramValue>...]
Method GET
Te

Description Set video analyse global config.


c hn

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoAnalyseGlobal[
Example
0].Scene.Type=Normal&VideoAnalyseGlobal[0].Scene.PtzPresetId=1
ic

Success
a

OK
l

Return
Parameters in URL:
paramName and paramValue are as table below.
In table below, head =VideoAnalyseGlobal[ChannelNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
ParamName start with head.Scene.Detail depends on head.Scene.Type.

Appendix

ParamName ParamValue type Description

Video Analyse APIs 164


ParamName ParamValue type Description
Scene class, the range is { "Normal", "Indoor",
"ATM", "Traffic", "FaceRecognition",
head.Scene.Type string "FaceDetection", "Prison", "NumberStat",
"HeatMap", "VideoDiagnosis", "VehicleAnalyse",
"TrafficPatrol", "CourseRecord", "Vehicle" }
Range is 0 — 255, 0 means that the scene is
head.Scene.PtzPresetId integer
unassociated with PTZ.
Picture distance feature, the range is { "Normal",
head.Scene.Depth string
"Far", "Middle", "Near" }
Detail config of a scene. For example, when
Scene.Type is "Normal", it's detail includes
head.Scene.Detail.Value string
CameraAngle, CameraDistance, CameraHeight,
Da

etc.
hu

head.TimePeriod.Day[0] string The start time of Day, it's format is hh:mm:ss


a

head.TimePeriod.Day[1] string The end time of Day


HT

head.TimePeriod.Night[0] string The start time of Night, it's format is hh:mm:ss


head.TimePeriod.Night[1] string The end time of Night
TP
AP

8.1.3 Video Analyse Rule


I

 Get video analyse rule


fo
r

Table 8-4
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyseRule
We

Method GET
st

Description Get video analyse rules config.


Eu

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyse
Example
Rule
ro

head.Name= line1
pe

head.Type=CrossLineDetection
Success head.VideoAnalyseRule[0][0].Enable =true
Te

Return head.VideoAnalyseRule[0][0].EventHandler= (output of EventHandler is described in


c hn

GetEventHandler)

ic

Parameters in Response :
a l

head =table.VideoAnalyseRule[ChannelNo] [RuleNo]


Comment ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
RuleNo =rule index.
 Set video analyse rule

Table 8-5
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set video analyse rules config.

Video Analyse APIs 165


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoAnalyseRule[0]
Example
[0].Name=myAnalyseRule1&VideoAnalyseRule[0][0].Type=CrossLineDetection
Success
OK
Return
Parameters in URL:
paramName and paramValue are as table below.
In table below, head =VideoAnalyseRule[ChannelNo] [RuleNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
video channel index -1, and so 0 means channel 1).
RuleNo =rule index.
ParamName start with head.Config is only effective with {"CrossLineDetection",
"CrossRegionDetection", "LeftDetection", "TakenAwayDetection"}.

Appendix
Da
hu

ParamName ParamValue type Description


a

head. Name string Rule name, it must be unique.


The range is {"CrossLineDetection",
HT

"CrossRegionDetection", "LeftDetection",
TP

"TakenAwayDetection",
"VideoAbnormalDetection", "FaceDetection",
AP

head. Type string


"AudioMutation", "AudioAnomaly",
I

"VideoUnFocus", "WanderDetection",
fo

"RioterDetection", "ParkingDetection",
r

"MoveDetection", "NumberStat"}.
We

head. Enable bool Enable/Disable this rule.


st

Setting of EventHandler is described in


head. EventHandler —
SetEventHandler.
Eu

head. Config.DetectLine[0][0] integer The start point of DetectLine 0;


ro

head. Config.DetectLine[0][1] integer The end point of DetectLine 0;


pe

head. Config.DetectLine[1][0] integer The start point of DetectLine 1;


head. Config.DetectLine[1][1] integer The end point of DetectLine 1;
Te

The range is {"LeftToRight", "RightToLeft",


head. Config.Direction string
c

"Both"}.
hn

Maximum width. The width of the object must not


ic

be beyond maximum width.


a

Adapt to {"CrossLineDetection",
l

head.
integer "CrossRegionDetection", "LeftDetection",
Config .SizeFilter.MaxSize[0]
"TakenAwayDetection", "FaceDetection",
"WanderDetection", "RioterDetection",
"ParkingDetection", "MoveDetection"}.
head. Maximum height. The height of the object must
integer
Config .SizeFilter.MaxSize[1] not be beyond maximum height.
head. Minimum width. The width of the object must not
integer
Config .SizeFilter.MinSize[0] be less than minimum width.
head. Minimum height. The height of the object must
integer
Config .SizeFilter.MinSize[1] not be beyond minimum height.

Video Analyse APIs 166


ParamName ParamValue type Description
The start point of DetectRegion 0;
Adapt to {"CrossRegionDetection",
head.
integer "LeftDetection", "TakenAwayDetection",
Config.DetectRegion[0][0]
"WanderDetection", "RioterDetection",
"ParkingDetection", "MoveDetection"}.
head.
integer The end point of DetectRegion 0;
Config.DetectRegion[0][1]
head.
integer The start point of DetectRegion 1;
Config.DetectRegion[1][0]
head.
integer The end point of DetectRegion 1;
Config.DetectRegion[1][1]
head.
integer The start point of DetectRegion 2;
Da

Config.DetectRegion[2][0]
hu

head.
integer The start point of DetectRegion 2;
a

Config.DetectRegion[2][1]
Range is 1 — 600, adapt to {"LeftDetection",
HT

"TakenAwayDetection", "WanderDetection"}.
TP

head. Config. MinDuration integer


Range is 10-300, adapt to {"RioterDetection"}.
AP

Range is 6-300, adapt to {"ParkingDetection"}.


Range is 1 — 10, adapt to {"RioterDetection",
I

head. Config. Sensitivity integer


"MoveDetection"}.
fo

Range is 0 — 100000000, adapt to


head. Config. EnterThreshold
r

integer
{"NumberStat"}.
We

Range is 0 — 100000000, adapt to


head. Config. ExitThreshold integer
st

{"NumberStat"}.
Range is 0 — 100000000, adapt to
head. Config. InsideThreshold
Eu

integer
{"NumberStat"}.
ro
pe

8.2 Number of People


Te

8.2.1 Video Widget Number Status


c hn

Get video widget number status


ic


a

Table 8-6
l

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidgetNumb
Syntax
erStat
Method GET
Description Get OSD config when display number status information of people.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidget
Example
NumberStat
head.EncodeBlend=true
Success head.ShowEnterNum=true
Return head.ShowExitNum=true
head.TextAlign=0

Video Analyse APIs 167



Parameters in Response :
head =table.VideoWidgetNumberStat[ChannelNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
 Set video widget number status

Table 8-7
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set OSD config when display number status information of people.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidgetNumber
Example
Da

Stat[0].EncodeBlend=true&VideoWidgetNumberStat[0].ShowEnterNum=true
Success
hu

OK
Return
a

Parameters in URL:
HT

paramName and paramValue are as table below.


TP

In table below,
Comment
head =VideoWidgetNumberStat[ChannelNo]
AP

ChannelNo: integer, array index starts from 0, which means video channel(equals to
I

video channel index -1, and so 0 means channel 1).


fo

Appendix
r

ParamName ParamValue type Description


We
st

head. EncodeBlend bool Enable/Disable


Eu

head. ShowEnterNum bool Enable/Disable


head. ShowExitNum bool Enable/Disable
ro

head. TextAlign integer 0 for left, 2 for right


pe
Te

8.2.2 Get Heat MapInformation


c hn

Table 8-8
ic

http://<server>/cgi-bin/heatMap.cgi?action=getPicByTime&channel=<ChannelNo>&St
Syntax
a

artTime=<start>&EndTime=<end>
l

Method GET
Description Get binary data of heat map.
http://192.168.1.108/cgi-bin/heatMap.cgi?action=getPicByTime&channel=1&StartTime
Example
=2015-08-20%2000:00:00&EndTime=2015-08-21%2023:59:59
Content-Type: application/binarytet-stream
Success
Content-Length:<heatMap size>
Return
<HeatMap data>
Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Comment
start/end: the start/end time of Heat Map info. 24 hour Format, as: yyyy-mm-dd
hh:mm:ss.

Video Analyse APIs 168


Parameters in Response:
heatMap size: width*height + 16.
HeatMap data: format as table below.

Appendix: HeatMap Data Format


0 1 2 3 4 … 15 16 17 18 …
Width Height Reserved Data: every byte symbolize a pixel

8.3 FishEye

8.3.1 Get FishEye Capability


Da

The method described in the Section 4.5.13(Get video input capability) should be used fisrst.In
hu

the response, it will contain these message "caps.FishEye=false", if the value of the FishEye is
a

true, Then you can use the method described below to get the detail capability.
HT

Table 8-9
TP

http://<server>/cgi-bin/devVideoInput.cgi?action=getCapsEx&channel=<ChannelNo>&
Syntax
AP

name=VideoInFishEye
Method GET
I

Description Clear the people count information.


fo

http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCapsEx&channel=1&name=
r

Example
VideoInFishEye
We

caps.Type=Chip
st

caps.MountMode[0]=WallMode
caps.MountMode[1]=CeilMode
Eu

……
ro

caps.CalibrateMode[0]=Original
Success
pe

caps.CalibrateMode[1]=Config
Return
caps.CalibrateMode[2]=Panorama
Te

……
c

caps.EPtzCmd[0]=Up
hn

caps.EPtzCmd[1]=Down
ic

…….
a

Parameters in Response:
l

Type: string, it can be Chip, Plugin, and ChipAndPlugin. Chip means only support
calibrate by device.
Plugin means only support calibrate by plugin. ChipAndPlugin means support
both.
MountMode: string and array.and MountMode means the install mode, it can be
Comment
WallMode,CeilMode, FloorMode,180CeilMode.
CalibrateMode: string and array. It can be Original, Config, Panorama,
DoublePanorama, OriginalPlusThreeEPtzRegion, Single, FourEPtzRegion,
TwoEPtzRegion, and Normal.
EPtzCmd: string and array. It can be ZoomIn, ZoomOut, Up, Down, Left, Right,
RotateClock, RotateAntiClock, Stop, TapView, and ShowRegion.

Video Analyse APIs 169


8.3.2 FishEye Setting
 Get FishEye config

Table 8-10
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FishEye
Method GET
Description Get FishEye config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FishEye
head.PlaceHolder=1
Success
head.CalibrateMode=Original
Return
……..
Parameters in Response:
Da

head = table.FishEye[ChannelNo]
hu

ChannelNo: integer, array index starts from 0, which means video channel (equals to
a

Comment video channel index -1, and so 0 means channel 1).


PlaceHolder:integer, it can be 1(CeilMode), 2(WallMode), 3(FloorMode).
HT

CalibrateMode: string. It can be Original, Config, Panorama, DoublePanorama,


TP

OriginalPlusThreeEPtzRegion, Single, FourEPtzRegion, TwoEPtzRegion, and Normal.


AP

 Set FishEye config


I

Table 8-11
fo

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
r

alue>[&<paramName>=<paramValue>…]
Method GET
We

Description Set FishEye config.


st

Change the placeholder setting of channel 1:


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FishEye[0].PlaceHol
Eu

der=1
ro
pe

Change the calibratemode setting of channel 1:


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FishEye[0].Calibrate
Te

Example
Mode=Panorama
c hn

Also can use


ic

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FishEye[0].Calibrate
a l

Mode=Panorama&FishEye[0].PlaceHolder=1 to change the placeholder and


calibratemode in one message.
Success
OK
Return
Comment —

8.4 CrowdDistriMap

8.4.1 Get Channel Caps


Table 8-12

Video Analyse APIs 170


Syntax http://<server>/cgi-bin/crowdDistriMap.cgi?action=getCaps
Method GET
Description Get Channel CrowdistriMap Caps.
Example http://192.168.1.108/cgi-bin/crowdDistriMap.cgi?action=getCaps
CrowdCapsList[0].channel=<ChannelNo>
CrowdCapsList[0].Support=<Support>
Success
CrowdCapsList[1].channel=<ChannelNo>
Return
CrowdCapsList[1].Support=<Support>

Parameters in URL and Response:
Comment ChannelNo : video channel index
Support : true or false, support or not
Da

8.4.2 Subscribe to Realtime Crowd Stat


hu
a

Table 8-13
HT

http://<server>/cgi-bin/crowdDistriMap.cgi?action=attach&channel=<ChannelNo>[&he
Syntax
artbeat=<Heartbeat>]
TP

Method GET
AP

Description Subscribe the crowd distribuite map information, return info at regular time.
Example http://<server>/cgi-bin/crowdDistriMap.cgi?action=attach&channel=1&heartbeat=5
I

HTTP/1.1 200 OK
fo

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


r

Connection: close
We
st

--<boundary>
Content-Type: text/plain
Eu

Content-Length: <data length>


ro
pe

CrowdStatData[0].Channel=1
CrowdStatData[0].GloabalPeopleNum =10
Te

CrowdStatData[0].RegionNum =1
c

CrowdStatData[0].RegionPeopleList[0].RegionID=0
hn

Success CrowdStatData[0].RegionPeopleList[0].Region[0][0]=10
ic

Return CrowdStatData[0].RegionPeopleList[0].Region[0][1]=10
a

CrowdStatData[0].RegionPeopleList[0].Region[1][0]=10
l

CrowdStatData[0].RegionPeopleList[0].Region[1][1]=100

CrowdStatData[0].RegionPeopleList[0].RegionPeopleNum=100
CrowdStatData[0].CrowdEventNum =2
CrowdStatData[0].CrowdList[0].Center=2
CrowdStatData[0].CrowdList[0].Radius=2
CrowdStatData[0].RegionEventNum =2
CrowdStatData[0].RegionList[0].Region[0][0]=10
CrowdStatData[0].RegionList[0].Region[0][1]=10
CrowdStatData[0].RegionList[0].Region[1][0]=10
CrowdStatData[0].RegionList[0].Region[1][0]=100

Video Analyse APIs 171



CrowdStatData[0].RegionList[0].RegionID=0
CrowdStatData[0].RegionList[0].PeopleNum=100
--<boundary>
Content-Type: text/plain
Content-Length: 11

Heartbeat
--<boundary>
Content-Type: text/plain
Content-Length: <data length>

CrowdStatData[0].Channel=1
Da


hu

Parameters in URL and Response


ChannelNo: integer, video channel index to subscribe
a
HT

Region is Polygon, has a list of points, every point has x and y , so Region[0][0] is first
TP

point's x, Region[0][1] is first point's y, Region[1][0] is second point's x, Region[1][1] is


Comment
second point's y, and so on
AP
I

Heartbeat: integer, range is [1,60],unit is second.If the URL contains this parameter,
fo

and the value is 5, it means every 5 seconds the device should send the heartbeat
r

message to the client,the heartbeat meaage are "Heartbeat".


We

8.4.3 Get Current Crowd Stat


st
Eu

Table 8-14
ro

http://<server>/cgi-bin/crowdDistriMap.cgi?action=getSummary&channel=<ChannelNo
Syntax
>
pe

Method GET
Te

Description Get crowd distribuite map information, return info only once.
c

Example http://<server>/cgi-bin/crowdDistriMap.cgi?action=getSummary&channel=1
hn

CrowdStatData[0].Channel=1
ic

CrowdStatData[0].GloabalPeopleNum =10
a

CrowdStatData[0].RegionNum =1
l

CrowdStatData[0].RegionPeopleList[0].RegionID=0
CrowdStatData[0].RegionPeopleList[0].Region[0][0]=10
CrowdStatData[0].RegionPeopleList[0].Region[0][1]=10
Success CrowdStatData[0].RegionPeopleList[0].Region[1][0]=10
Return CrowdStatData[0].RegionPeopleList[0].Region[1][1]=100

CrowdStatData[0].RegionPeopleList[0].RegionPeopleNum=100
CrowdStatData[0].CrowdEventNum =2
CrowdStatData[0].CrowdList[0].Center=2
CrowdStatData[0].CrowdList[0].Radius=2
CrowdStatData[0].RegionEventNum =2

Video Analyse APIs 172


CrowdStatData[0].RegionList[0].Region[0][0]=10
CrowdStatData[0].RegionList[0].Region[0][1]=10
CrowdStatData[0].RegionList[0].Region[1][0]=10
CrowdStatData[0].RegionList[0].Region[1][0]=100

CrowdStatData[0].RegionList[0].RegionID=0
CrowdStatData[0].RegionList[0].PeopleNum=100
Similar to above "Subscribe to Realtime Crowd Stat", but reply stat only once, not at
Comment
regular time.
Da
hu
a
HT
TP
AP
I
fo
r
We
st
Eu
ro
pe
Te
c hn
ic
a l

Video Analyse APIs 173


9 Intelligent Traffic APIs
9.1 Traffic Snap

9.1.1 Get the Specific Parking Space Status


Table 9-1
http://<server>/cgi-bin/trafficSnap.cgi?action=getParkingSpaceStatus&channel=<Chan
Syntax
nelNo>&<paramName>=<paramValue>[&<paramName>=<paramValue>…]
Da

Method GET
hu

Description Get specific parking space(s) status.


a

http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=getParkingSpaceStatus&condition.L
Example
ane[0]=0&condition.Lane[1]=255
HT

A list of parking space status


TP

status[0].Lane=0
status[0].PictureId=5
AP

status[0].TrafficCar.CountInGroup=1
I

Success

fo

Return
status[1].Lane=1
r

status[1].PictureId=4
We

status[1].TrafficCar.CountInGroup=1

st

Parameters in URL:
Eu

ChannelNo: integer, video channel index which starts from 1.


ro

paramName and paramValue: detail in table below.


pe

Comment In table below,


Te

index: The index of type array, start from 0


c hn

Parameters in Response :
ic

TrafficCar: the members refer to TrafficCar


a l

Appendix

ParamName ParamValue type Description


condition. Lane[index] int The Lane value
condition.
int The Level value , refer to condition
ResponseLevel

9.1.2 Open Strobe


Table 9-2
http://<server>/cgi-bin/trafficSnap.cgi?action=openStrobe&channel=<ChannelNo>&inf
Syntax
o.openType=<OpenType>&info.plateNumber=<PlateNumber>

Intelligent Traffic APIs 174


Method GET
Description Open the strobe manually.
http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=openStrobe&channel=1&info.openT
Example
ype=Normal&info.plateNumber=046XRW
Success
OK
Return
Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Comment
OpenType: string, For now, the value is fixed to "Normal"
PlateNumber: string, the plateNumber of the TrafficCar.

9.1.3 Open/Close Unlicensed Vehicle Detection


Da

Table 9-3
hu

http://<server>/cgi-bin/trafficSnap.cgi?action=<Action>&channel=<ChannelNo>&nam
Syntax
a

e=UnlicensedVehicle
HT

Method GET
Description Open or Close the unlicensed vehicle detection.
TP

http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=open&channel=1&name=Unlicense
Example
AP

dVehicle
Success
I

OK
Return
fo

Parameters in URL:
r

Comment Action: string, this value can be open and close.


We

ChannelNo: integer, video channel index which starts from 1.


st

9.1.4 Snap
Eu
ro

Table 9-4
pe

Syntax http://<server>/cgi-bin/trafficSnap.cgi?action=manSnap&channel=<ChannelNo>
Method GET
Te

Take a snapshot manually. For intelligent traffic device, it should use this method to take
c

a snapshot.
hn

But, the response is not image data.If you want to get the image data, please follow
ic

these steps:
Description
a

1. Use the method mentioned chapter (4.4.3 Subscribe to snapshot) to subscribe the
l

image data, and the eventcode is "TrafficManualSnap".


2. Use the "manSnap"to take a snapshot manually.
3. In the connection which built in the Step 1, the device will send the image data.
Example http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=manSnap&channel=1
Success
OK
Return
Parameters in URL:
Comment
ChannelNo: integer, video channel index which starts from 1.

Intelligent Traffic APIs 175


9.2 Traffic Parking

9.2.1 Get All Status of Parking Spaces


Table 9-5
Syntax http://<server>/cgi-bin/trafficParking.cgi?action=getAllParkingSpaceStatus
Method GET
Description Get all valid parking spaces status of one device.
Example http://192.168.1.108/cgi-bin/trafficParking.cgi?action=getAllParkingSpaceStatus
A list of parking space status
status[0].Lane=0
status[0]. CustomParkNo = A2701
Da

Success status[0].Status = Park


hu

Return …
a

status[1].Lane=1
status[1]. Status = NoPark
HT


TP

Parameters in Response :
Comment
Status : Park or NoPark
AP
I

9.2.2 Parking Space Light State


fo
r

 Get parking space light state


We

Table 9-6
st

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=ParkingSpaceLight
Syntax
State
Eu

Method GET
ro

Use this method. It can get the light state config. For example, it can know that when the
pe

Description space is free, then the light should be green, and the space is full, the light should be
red.
Te

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=ParkingSpace
c

Example
hn

LightState
table.ParkingSpaceLightState.SpaceFree.Blue=0
ic

table.ParkingSpaceLightState.SpaceFree.Green=1
a l

table.ParkingSpaceLightState.SpaceFree.Pink=0
table.ParkingSpaceLightState.SpaceFree.Purple=0
table.ParkingSpaceLightState.SpaceFree.Red=0
table.ParkingSpaceLightState.SpaceFree.White=0
Success
table.ParkingSpaceLightState.SpaceFree.Yellow=0
Return
table.ParkingSpaceLightState.SpaceFull.Blue=0
table.ParkingSpaceLightState.SpaceFull.Green=0
table.ParkingSpaceLightState.SpaceFull.Pink=0
table.ParkingSpaceLightState.SpaceFull.Purple=0
table.ParkingSpaceLightState.SpaceFull.Red=1
table.ParkingSpaceLightState.SpaceFull.White=0

Intelligent Traffic APIs 176


table.ParkingSpaceLightState.SpaceFull.Yellow=0
table.ParkingSpaceLightState.SpaceOrder.Blue=0
table.ParkingSpaceLightState.SpaceOrder.Green=0
table.ParkingSpaceLightState.SpaceOrder.Pink=0
table.ParkingSpaceLightState.SpaceOrder.Purple=0
table.ParkingSpaceLightState.SpaceOrder.Red=0
table.ParkingSpaceLightState.SpaceOrder.White=0
table.ParkingSpaceLightState.SpaceOrder.Yellow=1
table.ParkingSpaceLightState.SpaceOverLine.Blue=0
table.ParkingSpaceLightState.SpaceOverLine.Green=0
table.ParkingSpaceLightState.SpaceOverLine.Pink=0
table.ParkingSpaceLightState.SpaceOverLine.Purple=0
table.ParkingSpaceLightState.SpaceOverLine.Red=0
Da

table.ParkingSpaceLightState.SpaceOverLine.White=0
hu

table.ParkingSpaceLightState.SpaceOverLine.Yellow=1
table.ParkingSpaceLightState.SpaceSpecial.Blue=0
a

table.ParkingSpaceLightState.SpaceSpecial.Green=0
HT

table.ParkingSpaceLightState.SpaceSpecial.Pink=0
TP

table.ParkingSpaceLightState.SpaceSpecial.Purple=0
table.ParkingSpaceLightState.SpaceSpecial.Red=0
AP

table.ParkingSpaceLightState.SpaceSpecial.White=0
I

table.ParkingSpaceLightState.SpaceSpecial.Yellow=1
fo

Parameters in Response :
r

There are five conditions about the space light state: SpaceFree, SpaceFull,
We

SpaceOrder, SpaceOverLine, and SpaceSpecial. For each condition, you can choose
the light state.
st

Comment
The state value is integer. It can be 0, 1, 2.
Eu

0 means close;
ro

1 means open;
2 means twinkle.
pe

 Set parking space light state


Te

Table 9-7
c

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
hn

Syntax
alue>[&<paramName>=<paramValue>…]
ic

Method GET
a

Description Set the light state config.


l

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ParkingSpaceLightSt
ate.SpaceFree.Blue=1&ParkingSpaceLightState.SpaceFree.Green=0&ParkingSpaceLi
Example ghtState.SpaceFree.Pink=0&ParkingSpaceLightState.SpaceFree.Purple=0&ParkingSp
aceLightState.SpaceFree.Red=0&ParkingSpaceLightState.SpaceFree.White=0&Parkin
gSpaceLightState.SpaceFree.Yellow=0
Success
OK
Return
Comment —

Intelligent Traffic APIs 177


9.2.3 Set Order State
Table 9-8
http://<server>/cgi-bin/trafficParking.cgi?action=setOrderState&state[0].Lane=<LaneNu
Syntax
mber>&state[0].State=<State>
Method GET
Description Set the light order state, order or not
http://192.168.1.108/cgi-bin/trafficParking.cgi?action=setOrderState&state[0].Lane=0&s
Example
tate[0].State=Ordered
Success
OK
Return
Parameters in URL:
Comment LaneNumber: integer, for now, fixed to 0.
Da

State: string, the value can be "Ordered"or "Free".


hu
a

9.2.4 Set Light State


HT
TP

Table 9-9
http://<server>/cgi-bin/trafficParking.cgi?action=setLightState&state[Index].LightNo=<L
AP

Syntax aneNumber>&state[Index].Color=<Color>&state[Index].State=<State>&state[Index].
I

Enable=<Enable>
fo

Method GET
r

Description Set the light state.


http://192.168.1.108/cgi-bin/trafficParking.cgi?action=setLightState&state[0].LightNo=0
We

Example
&state[0].Color=Red&state[0].State=0&state[0].Enable=true
st

Success
OK
Eu

Return
Parameters in URL:
ro

Index: integer, start with 0.


pe

LaneNumber: integer, the No. of the Lane.


Comment
Color: string, it can be Red, Yellow, Blue, Green, Purple, White, Pink.
Te

State: integer, it can be 0, 1, 2.0 means close;1 means open;2 means twinkle;
c hn

Enable: true or false, enable or not.


ic

9.2.5 [Config] Parking Space Access Filter Setting


a l

 Get parking space access filter setting

Table 9-10
http://<server>/cgi-bin/ConfigManager.cgi?action=getConfig&name=ParkingSpaceAcces
URL
sFilter
Method GET
Get Parking Space Access Filter config. Using this method, we can get the accessible
Description
address of the device.
[ Request Params ] ( None )
[ Response Params ] ( key=value format )

Intelligent Traffic APIs 178


Name Type R/O Param Description
table object R config table object
+ParkingSpaceA
object R ParkingSpaceAccessFilter config object
ccessFilter
++Enable bool R Enable filter or not
++Type string R Filter type, can be: "BannedList", "TrustList".
++TrustList Array<string> O IP address list that trust
++BannedList Array<string> O IP address list that banned.
[ Example ]
GET
Request http://10.0.0.8/cgi-bin/ConfigManager.cgi?action=getConfig&name=ParkingSpaceAccessFil
ter
table.ParkingSpaceAccessFilter.Enable=false
Da

Respons table.ParkingSpaceAccessFilter.Type=TrustList
hu

e table.ParkingSpaceAccessFilter.TrustList[0]=172.24.2.14
a

table.ParkingSpaceAccessFilter.BannedList[0]=172.24.2.15
HT

 Set parking space access filter setting


TP

Table 9-11
http://<server>/cgi-bin/ConfigManager.cgi?action=setConfig&name=ParkingSpaceAccessFi
AP

URL
lter
I

Method GET
fo

Descripti
Set Parking Space Access Filter config.
r

on
We

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
st

ParkingSpaceAc
object R ParkingSpaceAccessFilter config object
Eu

cessFilter
ro

+Enable bool R Enable filter or not


+Type string R Filter type, can be: "BannedList", "TrustList".
pe

+TrustList Array<string> O IP address list that trust


Te

+BannedList Array<string> O IP address list that banned.


c

[ Response Params ] ( None )


hn

[ Example ]
ic

GET
a

http://10.0.0.8/cgi-bin/ConfigManager.cgi?action=getConfig&action=setConfig&ParkingSpa
l

Request
ceAccessFilter.Enable=true&ParkingSpaceAccessFilter.Type=TrustList&ParkingSpaceAcce
ssFilter.TrustList[0]=172.24.2.14&ParkingSpaceAccessFilter.BannedList[0]=172.24.2.15
Respons
<none>
e

9.2.6 Set OverLine State


Table 9-12
http://<server>/cgi-bin/trafficParking.cgi?action=setOverLineState&state[0].Lane=<Lan
Syntax
eNumber>&state[0].State=<State>
Method GET

Intelligent Traffic APIs 179


Description Set the spaceState overLine state or StopOverLine state
http://192.168.1.108/cgi-bin/trafficParking.cgi?action=setOverLineState&state[0].Lane=
Example
0&state[0].State=OverLine
Success
OK
Return
Parameters in URL:
Comment LaneNumber: integer, for now, fixed to 0.
State: string, the value can be “OverLine” or “StopOverLine”.

9.3 Traffic Record Import Export

9.3.1 Traffic BlackList


Da

 Import blacklist record


hu
a

Table 9-13
http://<server>/cgi-bin/trafficRecord.cgi?action=uploadFile&Type=TrafficBlackList&form
HT

Syntax
at=<Format>&code=<Code>
TP

Method POST
AP

Upload a blacklist file into the deivce, and the device will import the data of the file.This
Description
operation may take a long time.
I

POST
fo

/cgi-bin/trafficRecord.cgi?action=uploadFile&Type=TrafficBlackList&format=CSV&code
r

=UTF-8 HTTP/1.1
We

Host: 192.168.1.108
st

Connection: keep-alive
Content-Length:XXXX
Eu

Content-Type: multipart/form-data;
ro

boundary=----WebKitFormBoundaryooT6JTCbuezAQeDy
Example
pe

------WebKitFormBoundaryooT6JTCbuezAQeDy
Te

Content-Disposition: form-data; name="blackfile"; filename="TrafficBlackList.CSV"


c

Content-Type: application/vnd.ms-excel
hn
ic

File data….
a l

------WebKitFormBoundaryooT6JTCbuezAQeDy--
Success
OK
Return
Parameters in URL:
Comment Format: string, for the blacklist, the value is fixed to "CSV".
Code: string, for the blacklist, the value can be "utf-8"or "GB2312".

9.3.2 Traffic Flow


 Export traffic flow record

Intelligent Traffic APIs 180


Table 9-14
http://<server>/cgi-bin/recordUpdater.cgi?action=exportAsyncFile&name=TrafficFlow&f
Syntax
ormat=<Format>&code=<Code>
Method GET
Let the deivce export the record into a file in the device.This method is non-blocking.To
Description
get the result, it should use the "getFileExportState"method.
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=exportAsyncFile&name=TrafficFl
Example
ow&format=CSV&code=utf-8
Success
OK
Return
Parameters in URL:
Comment Format: string, for the TrafficFlow, the value is fixed to "CSV".
Code: string, for the TrafficFlow, the value can be "utf-8"or "GB2312".
Da

Table 9-15
hu

Syntax http://<server>/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=TrafficFlow
a

Method GET
HT

Description Get the export state.


TP

Example http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=Traffi
cFlow
AP

Success state=0
I

Return
fo

Comment Parameters in Response:


r

state: integer,the value can be 0(success),1(fail), 2(running), 3(the file is invalid), 4(the
We

file is too large) or 5(have duplicate info in the file).


st

Table 9-16
Syntax http://<server>/cgi-bin/trafficRecord.cgi?action=downloadFile&Type=TrafficFlow
Eu

Method GET
ro

Description Download the traffic flow record.


pe

Example http://192.168.1.108/cgi-bin/trafficRecord.cgi?action=download&filename=TrafficFlow
Success File data
Te

Return
c

Comment —
hn
ic
a l

Intelligent Traffic APIs 181


10 Thermography and Radiometry APIs
10.1 Thermography Manager

10.1.1 Get Capability of Thermography


Table 10-1
http://<server>/cgi-bin/ThermographyManager.cgi?action=getCaps&channel=<Channe
Syntax
lNo>
Da

Method GET
hu

Description Get thermography capability.


a

Example http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getCaps&channel=1
caps.PresetModes = Indoor
HT

caps.Brightness.Max = 100
TP

caps.Brightness.Min = 0
caps.Brightness.Step = 1
AP

caps.Sharpness.Max= 100
I

caps.Sharpness.Min = 0
fo

caps.Sharpness.Step = 5
r

caps.EZoom.Max= 24
We

caps.EZoom.Min = 0
st

caps.EZoom.Step = 1
caps. ThermographyGamma.Max= 8
Eu

caps. ThermographyGamma.Min = -8
ro

caps. ThermographyGamma.Step = 1
Success
caps. SmartOptimizer.Max= 100
pe

Return
caps. SmartOptimizer.Min = 0
Te

caps. SmartOptimizer.Step = 5
caps. Agc.Max= 255
c hn

caps. Agc.Min = 0
ic

caps. Agc.Step = 5
a

caps. AgcMaxGain.Max= 255


l

caps. AgcMaxGain.Min = 0
caps. AgcMaxGain.Step = 5
caps. AgcPlateau.Max= 100
caps. AgcPlateau.Min = 0
caps. AgcPlateau.Step = 5
caps.PresetColorization[i]= Ironbow2
caps.PresetROIModes[j]= Full Screen
Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Comment

Parameters in Response:

Thermography and Radiometry APIs 182


PresetModes: the preset mode. Range is { "Indoor", "Outdoor", "Default" }
PresetColorization: Preset colorization mode. Range is { "WhiteHot", "BlackHot",
"Fusion", "Rainbow", "Globow", "Ironbow1", "Ironbow2", "Sepia", "Color1", "Color2",
"Icefire", "Rain", "RedHot", "GreenHot"}.
PresetROIModes: Preset ROI mode. Range is {"Full Screen", "Sky", "Ground",
"Horizon", "Center 75%", "Center 50%", "Center 25%", "Custom"}

10.1.2 Thermography Options


 Get thermography options config

Table 10-2
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=ThermographyOpti
Syntax
ons
Da

Method GET
hu

Description Thermography options contain EZoom, Colorization, and SmartOptimizer and so on.
a

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Thermograph
Example
HT

yOptions
TP

head.EZoom=0
head.Colorization=White Hot
AP

head.SmartOptimizer=10
I

head.OptimizedRegion.Type=Custom
fo

head.OptimizedRegion.Enable= true
r

head.OptimizedRegion.Regions[i][0u]=0
head.OptimizedRegion.Regions[i][1u]=0
We

head.OptimizedRegion.Regions[i][2u]=0
st

Success
head.OptimizedRegion.Regions[i][3u]=0
Return
head.Agc=10
Eu

head.AgcMaxGain=10
ro

head.AgcPlateau=10
pe

head.Mode="HighTemperature"
head.Auto.LowToHigh=13
Te

head.Auto.LHROI=15
c

head.Auto.HighToLow=12
hn

head.Auto.HLROI=95
ic

Parameters in Response:
a l

head = table.ThermographyOptions [ChannelNo][0]


ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
video channel index -1, and so 0 means channel 1).
Regions: the region is a rectangle
i: the array index starts from 0.
 Set thermography options config

Table 10-3
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set thermography options.

Thermography and Radiometry APIs 183


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ThermographyOptio
Example
ns[0][0].OptimizedRegion.Type=Gound
Success
OK
Return
Parameters in URL:
The paramName and paramValue are in the table below.

In table below,
Comment
head = ThermographyOptions[ChannelNo][0]
ChannelNo: integer, array index starts from 0, which means video channel(equals to
video channel index -1, and so 0 means channel 1).
i: the array index starts from 0.

Appendix
Da
hu

ParamName ParamValue type Description


a

Range is [0—24].
head. EZoom integer Range and step are got from interface in "10.1.1
HT

Get Capability of Thermography".


TP

Range is {"White Hot", "Black Hot", "Ironbow2",


"IceFire"…}.
AP

head. Colorization String


Range and step are got from interface in "10.1.1
I

Get Capability of Thermography".


fo

Range is [0—100].
r

head. SmartOptimizer integer Range and step are got from interface in "10.1.1
We

Get Capability of Thermography".


st

Range is {"Full Screen", "Sky", "Ground",


head. OptimizedRegion.Type String "Horizontal", "Center 75%", "Center 50%", "Center
Eu

25%", "Custom"}.
ro

head. true: enable


bool
pe

OptimizedRegion.Enable false: not enable


head.
Range is [0—8191].
Te

OptimizedRegion.Regions[i][ integer
i: the region index, starts from 0.
c

0u]
hn

head.
Range is [0—8191].
ic

OptimizedRegion.Regions[i][ integer
i: the region index, starts from 0.
a

1u]
l

head.
Range is [0—8191].
OptimizedRegion.Regions[i][ integer
i: the region index, starts from 0.
2u]
head.
Range is [0—8191].
OptimizedRegion.Regions[i][ integer
i: the region index, starts from 0.
3u]
Range is [0—255].
head. Agc integer Range and step are got from interface in "10.1.1
Get Capability of Thermography".
Range is [0—255].
head. AgcMaxGain integer
Range and step are got from interface in "10.1.1

Thermography and Radiometry APIs 184


ParamName ParamValue type Description
Get Capability of Thermography".
Range and step are got from interface in "10.1.1
head. AgcPlateau integer
Get Capability of Thermography".
Range is {"HighTemperature", "LowTemperature",
head. Mode string
"Auto"}.
head. Auto.LowToHigh integer UInt32
head. Auto.LHROI integer UInt32, percentage range is[0—100]
head. Auto.HighToLow integer UInt32
head. Auto.HLROI integer UInt32, percentage range is[0—100]

10.1.3 Get ExternSystem Information


Da

Table 10-4
hu

http://<server>/cgi-bin/ThermographyManager.cgi?action=getExternSystemInfo&chann
Syntax
a

el=<ChannelNo>
HT

Method GET
Description Get extern system Info.
TP

http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getExternSystemInfo&
Example
AP

channel=1
I

sysInfo.SerialNumber = 11111111123
Success sysInfo.SoftwareVersion = 2222222222222
fo

Return sysInfo.FirmwareVersion= 3333333333333


r

sysInfo.LibVersion = 4444444444
We

Parameters in URL:
Comment
st

ChannelNo: integer, video channel index which starts from 1.


Eu

10.1.4 Get Information of Preset Mode


ro
pe

Table 10-5
http://<server>/cgi-bin/ThermographyManager.cgi?action=getPresetParam&channel=<
Te

Syntax
ChannelNo>&mode=<modeType>
c

Method GET
hn

Description Get preset mode info.


ic

http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getPresetParam&chan
a

Example
nel=1&mode=Default
l

presetInfo.Brightness = 50
presetInfo.Sharpness= 50
presetInfo.EZoom= 12
presetInfo.ThermographyGamma= 0
Success presetInfo.Colorization= "White Hot"
Return presetInfo.SmartOptimizer= 10
presetInfo.OptimizedRegion.Type= Full Screen
presetInfo.OptimizedRegion.Enable= Full Screen
presetInfo.OptimizedRegion.Regions[i][0u]=0
presetInfo.OptimizedRegion.Regions[i][1u]=0

Thermography and Radiometry APIs 185


presetInfo.OptimizedRegion.Regions[i][2u]=0
presetInfo.OptimizedRegion.Regions[i][3u]=0
presetInfo.Agc= 10
presetInfo.AgcMaxGain=10
presetInfo.AgcPlateau = 10
Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
modeType: depends on capability , get from interface in getCaps
Comment
Parameters in Response :
Regions : the region is a rectangle
i : the array index.
Da

10.1.5 Get Optimized Region Information


hu
a

Table 10-6
http://<server>/cgi-bin/ThermographyManager.cgi?action=getOptimizedRegion&chann
HT

Syntax
el=<ChannelNo>
TP

Method GET
Description Get optimized region info.
AP

http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getOptimizedRegion&c
I

Example
hannel=1
fo

optimizedRegion.Type= Full Screen


r

optimizedRegion.Enable= true
We

Success optimizedRegion.Regions[i][0u]=0
st

Return optimizedRegion.Regions[i][1u]=0
optimizedRegion.Regions[i][2u]=0
Eu

optimizedRegion.Regions[i][3u]=0
ro

Parameters in URL:
pe

ChannelNo: integer, video channel index which starts from 1.

Comment
Te

Parameters in Response:
c

Regions : the region is a rectangle


hn

i: the region index.


ic
a

10.1.6 Enable Shutter


l

Table 10-7
http://<server>/cgi-bin/ThermographyManager.cgi?action=enableShutter&channel=<C
Syntax
hannelNo>&enable=<Enable>
Method GET
Description Shutter control, whether enable shutter.
http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=enableShutter&channel
Example
=1&enable=true
Success
OK
Return
Comment Parameters in URL:

Thermography and Radiometry APIs 186


ChannelNo: integer, video channel index which starts from 1.
Enable: true or false, enable or not.

10.1.7 Fix Focus


Table 10-8
http://<server>/cgi-bin/ThermographyManager.cgi?action=fixFocus&linkVideoChannel[
Syntax
0]=<ChannelNo>&linkVideoChannel[1]=<ChannelNo>[&speed=<SpeedValue>]
Method GET
Description The visual channel change focus to the same as the thermography channel.
http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=fixFocus&linkVideoCha
Example
nnel[0]=1&linkVideoChannel[1]=2
Success
Da

OK
Return
hu

Parameters in URL:
a

Comment ChannelNo: integer, video channel index which starts from 1.


HT

SpeedValue: float, range is 0.0-1.0.


TP

10.1.8 Do Flat Field Correction


AP

Table 10-9
I

http://<server>/cgi-bin/ThermographyManager.cgi?action=doFFC&channel=<Channel
fo

Syntax
No>
r

Method GET
We

Description Do flat field correction.


st

Example http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=doFFC&channel=1
Success
Eu

OK
Return
ro

Parameters in URL:
Comment
pe

ChannelNo: integer, video channel index which starts from 1.


Te

10.2 Radiometry
c hn

10.2.1 Get Capability of Radiometry


ic
a l

Table 10-10
http://<server>/cgi-bin/RadiometryManager.cgi?action=getCaps[&channel=<ChannelN
Syntax
o>]
Method GET
Description Get the capabilities of radiometry manager.
Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=getCaps&channel=1
caps.TotalNum.MaxNum=8
caps.TotalNum.Spot.MaxSpots=8
Success
caps.TotalNum.Line.MaxLines=1
Return
caps.TotalNum.Area.MaxAreas=8
caps.TemperPresets.MaxPresets=256

Thermography and Radiometry APIs 187


caps.MeterInfo.Type[0u]=Spot
caps.MeterInfo.Type[1u]=Area
caps.MeterInfo.ObjectEmissivity.Max=100
caps.MeterInfo.ObjectEmissivity.Min=0
caps.MeterInfo.ObjectEmissivity.Default=0
caps.MeterInfo.ObjectEmissivity.Step=1
caps.MeterInfo.ObjectDistanceMeter.Max=100
caps.MeterInfo.ObjectDistanceMeter.Min=0
caps.MeterInfo.ObjectDistanceMeter.Default=0
caps.MeterInfo.ObjectDistanceMeter.Step=1
caps.MeterInfo.ReflectedTemperature.Max=100
caps.MeterInfo.ReflectedTemperature.Min=0
caps.MeterInfo.ReflectedTemperature.Default=0
Da

caps.MeterInfo.ReflectedTemperature.Step=1
hu

caps.MeterInfo.RelativeHumidity.Max=100
caps.MeterInfo.RelativeHumidity.Min=0
a

caps.MeterInfo.RelativeHumidity.Default=0
HT

caps.MeterInfo.RelativeHumidity.Step=1
TP

caps.MeterInfo.AtmosphericTemperature.Max=100
caps.MeterInfo.AtmosphericTemperature.Min=0
AP

caps.MeterInfo.AtmosphericTemperature.Default=0
I

caps.MeterInfo.AtmosphericTemperature.Step=1
fo

caps.Statistics.MinPeriod=60
r

caps.Isotherm.MaxTemp=327.0
We

caps.Isotherm.MinTemp=-20.0
Parameters in URL:
st

Comment
ChannelNo: integer, video channel index which starts from 1.
Eu

10.2.2 Heat Image Thermometry


ro
pe

 Get heat image thermometry config


Te

Table 10-11
c

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=HeatImagingTherm
hn

Syntax
ometry
ic

Method GET
a

Description Get HeatImagingThermometry Config.


l

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=HeatImaging
Example
Thermometry

Thermography and Radiometry APIs 188


table.RelativeHumidity = 50
table.AtmosphericTemperature =20
table.ObjectEmissivity =1
table.ObjectDistance =100
table.ReflectedTemperature=20
Success table.TemperatureUnit= Centigrade
Return table.Isotherm.Enable=true
table.Isotherm.MaxValue=50
table.Isotherm.MinValue=0
table.Isotherm.ColorBarDisplay=true
table.HotSpotFollow=true
table.TemperEnable=true
Comment —
Da

 Set heat image thermometry config


hu

Table 10-12
a

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
HT

alue>[&<paramName>=<paramValue>…]
TP

Method GET
Description Set HeatImagingThermometry Config
AP

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&HeatImagingThermo
Example
I

metry.RelativeHumidity=50&HeatImagingThermometry.ObjectDistance=20.3
fo

Success
OK
r

Return
Parameters in URL:
We

Comment
The paramName and paramValue are in the table below.
st

Appendix
Eu

ParamName ParamValue type Description


ro

The Relative Humidity


pe

HeatImagingThermometry.RelativeHumidity integer range and step are got from


interface in getCaps.
Te

The Atmospheric
c hn

Temperature range and


HeatImagingThermometry.AtmosphericTemperature float
step are got from interface
ic

in getCaps.
a l

The Object Emissivity


HeatImagingThermometry.ObjectEmissivity float range and step are got from
interface in getCaps.
The Object Distance range
and step are got from
HeatImagingThermometry.ObjectDistance float
interface in getCaps.
Unit is meter.
The Reflected Temperature
HeatImagingThermometry.ReflectedTemperature float range and step are got from
interface in getCaps

Thermography and Radiometry APIs 189


ParamName ParamValue type Description
Range is {Centigrade,
HeatImagingThermometry.TemperatureUnit string
Fahrenheit}.
HeatImagingThermometry.Isotherm. Enable bool true or false
MaxValue range is got form
interface in getCaps.
HeatImagingThermometry.Isotherm. MaxValue float
MaxValue must be bigger
than MinVaue
MinValue range is got form
interface in getCaps.
HeatImagingThermometry.Isotherm. MinValue float
MinValue must be smaller
than MaxVaue.
HeatImagingThermometry.Isotherm.
bool true or false
Da

ColorBarDisplay
hu

HeatImagingThermometry.HotSpotFollow bool true or false


a

HeatImagingThermometry.TemperEnable bool true or false


HT

10.2.3 Thermometry Rule


TP
AP

 Get thermometry rule config


I

Table 10-13
fo

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=ThermometryRule
r

Method GET
Description Get thermometry rule.
We

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Thermometry
st

Example
Rule
Eu

head.Enable = true
head.PresetId =0
ro

head.RuleId=0
pe

head.Name=SpotName
head.Type=Spot
Te

head.MeterRegion.Coordinates[PointNo][0]= 0
c hn

head.MeterRegion.Coordinates[PointNo][1]= 0
ic


head.T=3
a l

Success head.Alarm.Id=0
Return head.Alarm.Enable=true
head.Alarm.Result =Max
head.Alarm.AlarmCondition=Below
head.Alarm.Threshold=20.0
head.Alarm.Hysteresis=0.1
head.Alarm.Duration=30
head.LocalParameters.Enable=true
head.LocalParameters.ObjectEmissivity=0.95
head.LocalParameters.ObjectDistance=0.95
head.LocalParameters.RefalectedTemp=0

Thermography and Radiometry APIs 190


Parameters in Response :
head =table.ThermometryRule[ChannelNo][RuleNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
Comment
RuleNo =rule index.
PointNo = point index
Alarm= AlarmSetting[AlarmNo]
AlarmNo = alarm index
 Set thermometry rule config

Table 10-14
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Da

Description Set thermometry rule.


hu

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ThermometryRule[0]
a

Example
[0].Name=name1
HT

Success
OK
TP

Return
Parameters in URL:
AP

The paramName and paramValue are in the table below.


I
fo

In table below,
r

head = ThermometryRule[ChannelNo][RuleNo]
Comment ChannelNo: integer, array index starts from 0, which means video channel (equals to
We

video channel index -1, and so 0 means channel 1).


st

PointNo = point index


RuleNo =rule index.
Eu

Alarm= AlarmSetting[AlarmNo]
ro

AlarmNo = alarm index


pe

Appendix
Te

ParamName ParamValue type Description


c hn

head. Enable bool Enable/Disable


Range [0—PresetMax]
ic

PresetMax is got from


a

head. PresetId integer


l

interface in
GetCurrentProtocolCaps.
Range [0—MaxNum]
head. RuleId integer MaxNum is got from interface
in getCaps.
Radiometry rule name.
head. Name string
char[64]
head. Type string Range is {Spot, Line, Area }.
Range [0—8091]
head. MeterRegion.Coordinates[PointNo] [0] integer The Xscale of Region/Line
point

Thermography and Radiometry APIs 191


ParamName ParamValue type Description
Range [0—8091]
head. MeterRegion.Coordinates[PointNo] [1] integer The Yscale of Region/Line
point
Temperature Sample period.
head. T integer
Unit is Second.
Range [0 — 65535],unique
head. Alarm.Id integer
alarm id
head. Alarm.Enable bool Enable/Disable
Depend on the vaule of Type
Spot : {Vaule}
head. Alarm.Result string Line: { Max, Min, Aver}
Area: {Max, Min, Aver, Std, Mid,
Da

ISO}
hu

Range is {Below, Match ,


head. Alarm. AlarmCondition string
a

Above }
HT

head. Alarm. Threshold float Alarm threshold


head. Alarm. Hysteresis float Alarm hysteresis
TP

The duration time of alarm.


head. Alarm. Duration integer
AP

Unit is second
head. LocalParameters.Enable bool Enable/Disable
I

Range [0 — 1]
fo

head. LocalParameters. ObjectEmissivity float


Accuracy is 0.01
r

Object distance
We

head. LocalParameters. ObjectDistance float The range is got from interface


st

in getCaps.
Object Reflected Temperature
Eu

head. LocalParameters. ReflectedTemp float The range is got from interface


ro

in getCaps.
pe

10.2.4 Heat Image Temper Event


Te
c

 Get heat image temper event config


hn
ic

Table 10-15
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=HeatImagingTemp
a

Syntax
l

er
Method GET
Description Get Heat Imaging Temper config
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=HeatImagingT
Example
emper
Success head.Enable=false
Return head.EventHandler. paramName = paramValue
Parameters in Response:
head= table.HeatImagingTemper[ChannelNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).

Thermography and Radiometry APIs 192


 Set heat image temper event config

Table 10-16
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set Heat Imaging Temper config
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&HeatImagingTemper[
Example
0].Enable=false&HeatImagingTemper[0].EventHandler.BeepEnable=false
Success
OK
Return
Parameters in URL:
The paramName and paramValue are in the table below.
Da

Comment In table below,


hu

head= HeatImagingTemper[ChannelNo]
a

ChannelNo: integer, array index starts from 0, which means video channel (equals to
HT

video channel index -1, and so 0 means channel 1).


TP

Appendix
AP

ParamName ParamValue type Description


I

head.Enable bool Enable/Disable Heat Imaging Temper feature.


fo

Setting of EventHandler is described in


head.EventHandler —
r

SetEventHandler.
We

10.2.5 Get Temperature of Particular Point


st
Eu

Table 10-17
ro

http://<server>/cgi-bin/RadiometryManager.cgi?action=getRandomPointTemper&chann
Syntax
el=<ChannelNo>&coordinate[0]=x &coordinate[1]=y
pe

Method GET
Te

Description Get temperature values of random point.


http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=getRandomPointTemper&
c

Example
hn

channel=1&coordinate[0]=1024&coordinate[1]=1024
ic

Success TempInfo.Type=Spot
a

Return TempInfo.TemperAver=27.5
l

Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Comment
x : The Xscale of the point
y : The Yscale of the point

10.2.6 Get Temperature of Particular Condition


Table 10-18
http://<server>/cgi-bin/RadiometryManager.cgi?action=getTemper&<paramName>=<p
Syntax
aramValue>[&<paramName>=<paramValue>…]
Method GET

Thermography and Radiometry APIs 193


Description Get temperature values from rules which have been set.
http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=getTemper&condition.Pres
Example etId=0&condition.RuleId=0&condition.Type=Spot&condition.Name=Spot1&condition.ch
annel=1
Success TempInfo.Type=Spot
Return TempInfo.TemperAver=27.5
Parameters in URL:
Comment
The paramName and paramValue are in the table below.

Appendix

ParamName ParamValue type Description


condition. Channel integer Video channel index. Start from 1
Range [0- PresetMax]
Da

condition. PresetId integer PresetMax is got from interface in


hu

GetCurrentProtocolCaps.
a

Range [0- MaxNum]


condition. RuleId integer
HT

MaxNum is got from interface in getCaps.


condition. Type string Range is {Spot, Line, Area}.
TP

Name is got from interface in


condition. Name string
AP

GetThermometryRuleConfig.
I

10.2.7 Query Temperature Information


fo
r

1. Start to query temperature information


We

Table 10-19
st

http://<server>/cgi-bin/RadiometryManager.cgi?action=startFind&condition.StartTime=
Eu

Syntax <StartTimeValue>&condition.EndTime=<EndTimeValue>&condition.Type=<TypeVal
ue>&condition.channel=<ChannelValue>&condition.Period=<PeriodValue>
ro

Method GET
pe

Description Start to query the history data of temperature values.


Te

http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=startFind&condition.StartTi
Example me=2010-04-01%200:00:00&condition.EndTime=2010-04-08%200:00:00&condition.Ty
chn

pe=Spot&condition.channel=1&condition.Period=5
ic

Success token=46878
Return totalCount=333
a l

Comment The parameters in bold face are as table below.

Appendix

ParamName ParamValue type Description


condition.StartTime string The start time to find.
condition.EndTime string The end time to find.
condition.Type string The type of data. Range is {Spot, Line, Area}
condition.channel integer Video channel index. Start from 1
condition.Period integer Range is {5, 10, 15, 30}, minute
2. Get the data of temperature

Thermography and Radiometry APIs 194


Table 10-20
http://<server>/cgi-bin/RadiometryManager.cgi?action=doFind&token=<tokenvalue>&
Syntax
beginNumber=<BeginNumber>&count=<findNum>
Method GET
Description Get the history data of temperature.
http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=doFind&token=46878&be
Example
ginNumber=16&count=16
found=12
info[i].Time=2010-04-08 16:12:46
info[i].PresetId=0
info[i].RuleId=0
info[i].Type=Spot
info[i].Name=xxxx
Success
Da

info[i].Coordinate[0]=1024
Return
hu

info[i].Coordinate[1]=2048
a

info[i].Channel=0
info[i].TemperatureUnit=Centigrade
HT

info[i].QueryTemperInfo.TemperAve=50.1
TP

info[i].QueryTemperInfo.TemperMax=50.2
info[i].QueryTemperInfo.TemperMin=50.0
AP

Parameters in URL:
I

token: query token, get from interface of the first step above.
fo

beginNumber: the begin index in this query.


Comment
r

count: the number you want to query.


We

Params in Resp:
st

i: the array index.


3. Stop finding temperature information
Eu

Table 10-21
ro

Syntax http://<server>/cgi-bin/RadiometryManager.cgi?action=stopFind&token=<tokenvalue>
pe

Method GET
Description Stop to find the history data of temperature values.
Te

Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=stopFind&token=46878
c
hn

Success
OK
Return
ic

Comment token: query token, get from interface of the first step.
a
l

10.2.8 Subscribe to Temperature Information


Table 10-22
http://<server>/cgi-bin/RadiometryManager.cgi?action=attachTemper&channel=<Chan
Syntax
nelNo>
Method GET
Description Subscribe to temperature information of a channel.
Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=attachTemper&channel=2
Success --<boundary>\r\n
Return Content-Type: text/plain\r\n

Thermography and Radiometry APIs 195


Content-Length: <data length>\r\n\r\n
info[i].Time=2010-04-08 16:12:46
info[i].PresetId=0
info[i].RuleId=0
info[i].Type=Spot
info[i].Name=xxxx
info[i].Coordinate[0]=1024
info[i].Coordinate[1]=2048
info[i].Channel=0
info[i].TemperatureUnit=Centigrade
info[i].QueryTemperInfo.TemperAve=50.1
info[i].QueryTemperInfo.TemperMax=50.2
info[i].QueryTemperInfo.TemperMin=50.0
Da

Parameters in URL:
hu

ChannelNo: integer, video channel index which starts from 1.


Comment
Params in Resp :
a

i: the array index.


HT
TP

10.2.9 Subscribe to Radiometry Data


AP

Table 10-23
I

http://<server>/cgi-bin/RadiometryManager.cgi?action=attachProc&channel=<Channel
fo

Syntax
No>
r

Method GET
We

Description Subscribe to radiometry data of a channel. It needs to cooperate with interface below.
st

Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=attachProc&channel=2
--<boundary>\r\n
Eu

Content-Type: text/plain\r\n
ro

Content-Length: <data length>\r\n\r\n


pe

dataInfo.Height=0
dataInfo.Width=0
Te

dataInfo.Channel=0
c

dataInfo.Time=2010-05-25 00:00:00
hn

dataInfo.Length=0
ic

Success dataInfo.sensorType="Tau"
a

Return dataInfo.Unzip.ParamR=1
l

dataInfo.Unzip.ParamB=1
dataInfo.Unzip.ParamF=1
dataInfo.Unzip.ParamO=1

--<boundary>\r\n
Content-Type: application/http\r\n
Content-Length: <data length>\r\n\r\n
<Binary data>
Comment ChannelNo: integer, video channel index which starts from 1.

Thermography and Radiometry APIs 196


10.2.10 To Fetch Radiometry Data
Table 10-24
http://<server>/cgi-bin/RadiometryManager.cgi?action=toFetch&channel=<ChannelNo
Syntax
>
Method GET
Description Start to fetch radiometry data.
Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=toFetch&channel=2
Success
status=Ready
Return
ChannelNo: integer, video channel index which starts from 1.
Comment status: Range is {Ready, Busy}. "Ready"means service available and "Busy"means
service busy.
Da
hu

10.2.11 Get FireWarning Config


a
HT

Table 10-25
TP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FireWarning
Method GET
AP

Description Get FireWarning config.


I

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FireWarning
fo

head.Enable=true
r

head.PresetId=0
head.Row = 31
We

head.Col = 40
st

head.Mode="Auto"
Eu

head.TimeDurationEnable=false
head.FireDuration= 15
ro

head.DetectWindow[windowsNum].Regions[0]=123468789
pe

head.DetectWindow[windowsNum].Regions[1]=123468789
Success
head.DetectWindow[windowsNum].Regions[2]=123468789
Te

Return
head.DetectWindow[windowsNum].Regions[3]=123468789
c hn

head.DetectWindow[windowsNum].Postion[0]=0
head.DetectWindow[windowsNum].Postion[1]=0
ic

head.DetectWindow[windowsNum].Postion[2]=0
a l

head.DetectWindow[windowsNum].Postion[3]=0
head.DetectWindow[windowsNum].Sensitivity = 95
head. DetectWindow[windowsNum].Id=1
head.DetectWindow[windowsNum].Name="windName"
head.EventHandler=(output of EventHandler is described in GetEventHandler)
Parameters in Response:
head= table.FireWarning[ChannleNo][RuleNum]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
video channel index -1, and so 0 means channel 1).
RuleNum: integer,array index starts from 0,which means rules in each Preset,
If FireWarningMode is "SpaceExClude", then only the first rule used.

Thermography and Radiometry APIs 197


windowsNum: support 4 Nums if FireWarningMode is "PtzPreset", 8 if "SpaceExClude"
Postion: only valid in "SpaceExClude"Mode

10.2.12 Set FireWarning Config


Table 10-26
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramVa
Syntax
lue>[&<paramName>=<paramValue>…]
Method GET
Description Set FireWarning config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FireWarning[0][0].Ea
Example
nble=false
Success
Da

OK
Return
hu

Comment head = FireWarning[ChNum][RuleNum]


a

Appendix:
HT

ParamName ParamValue type Description


TP

head.Enable bool whether fire detect take effect


AP

head.PresetId integer The PresetId


I

head.Row integer rows of fire detect area


head.Col integer cols of fire detect area
fo

head.Mode string Range is {"Auto","Normal"}.


r

whether include fire detect


We

head.TimeDurationEnable bool duration,only take effect in


st

SpaceExClude mode
head.FireDuration integer fire last times
Eu

head.DetectWindow[windowsNum].Regions[0] integer detect area mask


ro

head.DetectWindow[windowsNum].Sensitivity integer Rage {0,100}


pe

head. DetectWindow[windowsNum].Id integer Rage {0,…}


head.DetectWindow[windowsNum].Name string detect window name
Te

Setting of EventHandler is
c

head.EventHandler EventHandler
described in SetEventHandler.
hn
ic

10.2.13 Get FireWarningMode Config


a l

Table 10-27
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FireWarningMode
Method GET
Description Get FireWarningMode config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FireWarningMo
Example
de
Success
head.Mode="PtzPreset"
Return
Parameters in Response:
Comment
head= table.FireWarningMode[ChannelNo]

Thermography and Radiometry APIs 198


ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).

10.2.14 Set FireWarningMode Config


Table 10-28
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set FireWarningMode config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FireWarningMode[0]
Example
. Mode ="SpaceExClude"
Success
Da

OK
Return
hu

Comment head = FireWarningMode[ChannelNo]


a

Appendix:
HT

ParamName ParamValue type Description


TP

head.Mode string Rage is {"PtzPreset","SpaceExClude"}


AP
I
fo
r
We
st
Eu
ro
pe
Te
c hn
ic
a l

Thermography and Radiometry APIs 199


11 Access Control APIs
11.1 Door

11.1.1 Open Door


Table 11-1
http://<server>/cgi-bin/accessControl.cgi?action=openDoor&channel=<ChannelNo>[&
Syntax
UserID=<UserID>&Type=<Type>]
Method GET
Da

Description Open the door.


hu

http://192.168.1.108/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=
a

Example
101&Type=Remote
HT

Success
OK
TP

Return
Parameters in URL:
AP

ChannelNo: integer, the index of door, starts from 1.


Comment
I

UserID: remote user ID.


fo

Type: the open type, default value is "Remote".


r

11.1.2 Get Door Status


We
st

Table 11-2
Syntax http://<server>/cgi-bin/accessControl.cgi?action=getDoorStatus&channel=<ChannelNo>
Eu

Method GET
ro

Description Get status of the door.


pe

Example http://192.168.1.108/cgi-bin/accessControl.cgi?action=getDoorStatus&channel=1
Success
Te

Info.status=Open
Return
c
hn

Parameters in URL :
ChannelNo: integer, the index of door, starts from 1.
ic

Comment
Parameters in Response :
a l

status : the range is {Open, Break, Close}

11.1.3 Close Door


Table 11-3
http://<server>/cgi-bin/accessControl.cgi?action=closeDoor&channel=<ChannelNo>[&
Syntax
UserID=<UserID>&Type=<Type>]
Method GET
Description Close the door.
http://192.168.1.108/cgi-bin/accessControl.cgi?action=closeDoor&channel=1&UserID=
Example
101&Type=Remote

Access Control APIs 200


Success
OK
Return
Parameters in URL:
ChannelNo: integer, the index of door, starts from 1.
Comment
UserID: remote user ID.
Type: the open type, default value is "Remote".

11.2 Access Control

11.2.1 Add Access Control Custom Password


Da

Table 11-4
http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControlCustomPa
hu

URL
ssword
a

Method GET
HT

Description Insert access control custom password.


TP

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
AP

Access control custom password record name, should be


I

name string R
"AccessControlCustomPassword".
fo

UserID string R The user's id.


r

OpenDoorPass
string R Ths user’s open door password.
We

word
AlarmPassword string O Ths user’s alarm password.
st

Doors array<int> R The index of the doors that custom password can open.
Eu

The index of the time sections of each door that this card can
TimeSections array<int> O
ro

open.
VTOPosition string O VTO position number.
pe

ValidDateStart string O The start of valid date, format is "yyyyMMdd hhmmss".


Te

ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".


c

ValidCounts int O The password’s valid counts.


hn

OriginSmartGate
string O The origin smart gateway address.
ic

Way
a

[ Response Params ] (key=value format)


l

R/
Name Type Param Description
O
RecNo int R The record id.
[ Example ]
GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControl
CustomPassword&UserID=102&OpenDoorPassword=123456&Doors[0]=1&Doors[1]=3&
Request
Doors[2]=5&VTOPosition=01018001&ValidDateStart=20151022%20093811&ValidDateEn
d=20151222%20093811&ValidCounts=30
Response RecNo=12345

Access Control APIs 201


11.2.2 Modify Access Control Custom Password
Table 11-5
http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=AccessControlCustom
URL
Password
Method GET
Update access control custom password.
Description
Note: You should provide at lease one optional param to update.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access control custom password record name, should be
name string R
"AccessControlCustomPassword".
Da

recno int R The record id.


UserID string R The user's id.
hu

OpenDoorPass
a

string R Ths user’s open door password.


word
HT

Doors array<int> R The index of the doors that custom password can open.
TP

…<See above insert command for other params of the record,


…<other param> — —
They are all optional.>
AP

[ Response Params ] ( OK )
I

[ Example ]
fo

GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=update&name=AccessContr
r

olCustomPassword&recno=12345&UserID=102&OpenDoorPassword=123456&Doors[0]
Request
We

=1&Doors[1]=3&Doors[2]=5&ValidDateStart=20151022%20093811&ValidDateEnd=2015
1222%20093811
st

Response OK
Eu

11.2.3 Delete Access Control Custom Password


ro
pe

 Delete access control custom password record by recno


Te

Table 11-6
c

http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=AccessControlCustomPa
hn

URL
ssword
ic

Method GET
a

Descriptio
l

Remove the access control custom password record by recno.


n
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCustomPassword".
recno int R The record id.
[ Response Params ] ( OK )
[ Example ]
GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=remove&name=AccessCont
Request
rolCustomPassword&recno=12345

Access Control APIs 202


Response OK
 Delete all the access control custom password records

Table 11-7
http://<server>/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControlCustomPass
URL
word
Method GET
Descriptio
Remove all the access control custom password records
n
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCustomPassword".
Da

[ Response Params ] ( OK )
[ Example ]
hu

GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControl
a

Request
CustomPassword
HT

Response OK
TP

11.2.4 Find Access Control Custom Password


AP
I

 Find Access control custom password by condition


fo

Table 11-8
r

http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCustomPass
We

URL
word
st

Method GET
Description Find Access control custom password by condition.
Eu

[ Request Params ] ( key=value format in URL )


ro

Name Type R/O Param Description


pe

name string R Record Name, should be "AccessControlCustomPassword".


count int O Max result to return, default is 1024.
Te

StartTime string O The start of the record's CreateTime.


c

EndTime string O The End of the record's CreateTime.


hn

condition object O Search condition.


ic

+UserID string O The user's id.


la

[ Response Params ] (key=value format)


Name Type R/O Param Description
totalCount int O The total record num that find.
found int O The record num that returned.
records array<object> R The records that returned.
+RecNo int R The record id.
+CreateTime int R The create time of record.
+UserID string R The user's id.
+OpenDoorPa
string R Ths user’s open door password.
ssword

Access Control APIs 203


+AlarmPasswo
string O Ths user’s alarm password.
rd
+Doors array<int> R The index of the doors that custom password can open.
The index of the time sections of each door that this card can
+TimeSections array<int> O
open.
VTOPosition string O VTO position number.
+ValidDateStart string O The start of valid date, format is "yyyyMMdd hhmmss".
+ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".
+ValidCounts int O The password’s valid counts.
+OriginSmartG
string O The origin smart gateway address.
ateWay
[ Example ]
GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCust
Da

Request omPassword&condition.UserID=103&StartTime=123456700&EndTime=123456800&count
hu

=100
a

totalCount=1000
HT

found=100
records[0].RecNo=12345
TP

records[0].CreateTime=123456789
AP

records[0].UserID=103
records[0].OpenDoorPassword=123456
I

records[0].Doors[0]=1
fo

records[0].Doors[1]=3
r

records[0].Doors[2]=5
We

records[0].VTOPosition=01018001
st

records[0].ValidStart=20151022 093811
records[0].ValidEnd=20151222 093811
Response
Eu


ro

records[1].RecNo=13579
pe

records[1].CreateTime=123456799
records[1].UserID=103
Te

records[0].OpenDoorPassword=123456
c

records[1].Doors[0]=2
hn

records[1].Doors[1]=4
ic

records[1].Doors[2]=6
a

records[1].VTOPosition=01018002
l

records[1].ValidStart=20151022 093811
records[1].ValidEnd=20151222 093811

 Find Access control custom password by recno

Table 11-9
http://<server>/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCustomPas
URL
sword
Method GET
Description Find Access control custom password by recno.
[ Request Params ] ( key=value format in URL )

Access Control APIs 204


Name Type R/O Param Description
name string R Record Name, should be "AccessControlCustomPassword".
recno int R The record id.
[ Response Params ] (key=value format)
Name Type R/O Param Description
record object R The record that returned.
+RecNo int R The record id.
+CreateTime int R The create time of record.
+UserID string R The user's id.
…<other param> — — …<See above find command for other params of the record.>
[ Example ]
GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCu
Request
stomPassword&recno=3
Da

record.RecNo=3
hu

record.CreateTime=123456789
a

record.UserID=103
HT

record.OpenDoorPassword=123456
record.Doors[0]=1
TP

Response record.Doors[1]=3
AP

record.Doors[2]=5
I

record.VTOPosition=01018001
record.ValidStart=20151022 093811
fo

record.ValidEnd=20151222 093811
r


We
st

11.2.5 Get the Total Number of Records of Access Control


Eu

Custom Password
ro
pe

Table 11-10
http://<server>/cgi-bin/recordFinder.cgi?action=getQuerySize&name=AccessControlCar
URL
Te

d
c

Method GET
hn

Description Get the total number of records of the access control custom password.
ic

[ Request Params ] ( key=value format in URL )


a

Name Type R/O Param Description


l

Access user card and fingerprint record name, should be


name string R
"AccessControlCustomPassword".
[ Response Params ] ( key=value )
count int R The total number of records.
[ Example ]
GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=getQuerySize&name=Access
Request
ControlCustomPassword
Response count=150

Access Control APIs 205


11.2.6 Get Access Control Caps
Table 11-11
URL http://<server>/cgi-bin/accessControlManager.cgi?action=getCaps
Method GET
Description Get access control capabilities.
[ Request Params ] ( none )
[ Response Params ] ( key=value )
caps object R The access control capabilities.
+AccessControl
int R The access control channel number.
Channels
+AccessControl
bool O Support log access control alarm record or not.
Da

AlarmRecord
+CustomPasswo
hu

int O The custom password crypt type, 0 : plain text, 1 : MD5


rdEncryption
a

+SupportFinger Support fingerprint type, 0 : unknown, 1 : not support, 2 :


HT

int O
Print support
TP

+OnlySingleDoo
int O Support single door auth type, 0 : not support, 1 : support
rAuth
AP

+AsynAuth int O Support async auth type, 0 : not support, 1 : support


I

+SpecialDaysSc
object O Special days schedule capabilities
fo

hedule
r

++Support bool O Support special days schedule or not.


We

++MaxSpecialD
uint O Max special days schedule number
aysSchedules
st

++MaxTimePeri
uint O Max time periods per day.
Eu

odsPerDay
ro

++MaxSpecialD
uint O Max special day groups.
ayGroups
pe

++MaxDaysInSp
uint O Max special days in special day group.
Te

ecialDayGroup
[ Example ]
c hn

Request GET http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=getCaps


ic

Response count=150
a l

Access Control APIs 206


12 Intelligent Building APIs
12.1 Video Talk

12.1.1 Subscribe Video Talk Status


Table 12-1
Syntax http://<server>/cgi-bin/VideoTalkPeer.cgi?action=attachState
Method GET
Da

Description Subscribe the video talk status. When client disconnect, it will unsubscribe.
hu

Example http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=attachState
a

Notify the state:


HT

SID=315
TP

state.State=Answer
state.Talkback.Pack=RTP
AP

state.Talkback.Protocol=UDP
I

state.Talkback.Type=Talk
fo

state.Talkback.Audio.AudioPort=6000
r

state.Talkback.Audio.Format[0].Compression=PCM
We

Success state.Talkback.Audio.Format[0].Frequency=44000
st

Return state.Talkback.Audio.Format[0].Depth=16
state.Talkback.Audio.Format[1].Compression=G.711A
Eu

state.Talkback.Audio.Format[1].Frequency=44000
ro

state.Talkback.Audio.Format[1].Depth=16
state.Talkback.Video.VideoPort=7000
pe

state.Talkback.Video.Format[0].Compression=H.264
Te

state.Talkback.Video.Format[0].Frequency=90000
state.Talkback.Video.Format[1].Compression=MJPG
c hn


ic

state.Talkback. MediaAddr=224.10.10.10
a

Parameters in Response:
l

Comment State: in range of {"Ringing", "Inviting", "Answer", "Refuse", "Cancel", "Hangup",


"Busying" }

12.1.2 Unsubscribe Video Talk Status


Table 12-2
Syntax http://<server>/cgi-bin/VideoTalkPeer.cgi?action=detachState&SID=<sid>
Method GET
Description Unsubscribe the video talk status.
Example http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=detachState&SID=101
Success OK

Intelligent Building APIs 207


Return
Parameters in URL:
Comment
sid: the subscribe id, which is the response of attachState

12.1.3 Invite Server on Video Talk


Table 12-3
http://<server>/cgi-bin/VideoTalkPeer.cgi?action=invite[&Talkback.Protocol=<protocol>
Syntax
&Talkback.Type=<type>&Talkback.MediaAddr=<addr>…]
Method GET
Description Start the video talk conversation.
http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=invite&Talkback.Protocol=UDP&
Example
Talkback.Type=Talk&Talkback.MediaAddr=224.10.10.10
Da

Success
OK
hu

Return
a

Parameters in URL:
HT

protocol: the transmit protocol


Comment
type: video talk type.
TP

addr: addr to get stream


AP

12.1.4 Cancel the Video Talk


I
fo

Table 12-4
r

Syntax http://<server>/cgi-bin/VideoTalkPeer.cgi?action=cancel
We

Method GET
st

Description Cancel video talk conversation.


Example http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=cancel
Eu

Success
OK
ro

Return
pe

Comment —
Te

12.1.5 Answer the Invitation


c hn

Table 12-5
ic

http://<server>/cgi-bin/VideoTalkPeer.cgi?action=answer&Talkback.Protocol=<protoco
Syntax
a

l>&Talkback.Type=<type>&Talkback.MediaAddr=<addr>…
l

Method GET
Description Answer the call.
http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=answer&Talkback.Protocol=UDP
Example
&Talkback.Type=Talk&Talkback.MediaAddr=224.10.10.10
Success
OK
Return
Parameters in URL:
protocol: the transmit protocol
Comment
type: video talk type.
addr: addr to get stream

Intelligent Building APIs 208


12.1.6 Refuse to Answer the Video Talk Invitation
Table 12-6
Syntax http://<server>/cgi-bin/VideoTalkPeer.cgi?action=refuse
Method GET
Description Refuse answer the call.
Example http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=refuse
Success
OK
Return
Comment —

12.1.7 Hang Up
Da

Table 12-7
hu

Syntax http://<server>/cgi-bin/VideoTalkPeer.cgi?action=hangup
a

Method GET
HT

Description Close it when the conversation is over.


TP

Example http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=hangup
Success
AP

OK
Return
I

Comment —
fo
r

12.2 Video Talk Log


We
st

12.2.1 Query Video Talk Log


Eu

Table 12-8
ro

http://<server>/cgi-bin/recordFinder.cgi?action=find&name=VideoTalkLog[&condition.C
Syntax
pe

allType=<Type>&condition.EndState=<State>&count=<countNo>]
Method GET
Te

Description Find the VideoTalkLog record.


c

http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=VideoTalkLog&conditi
hn

Example
on.CallType=Incoming&condion.EndState=Missed&count=500
ic

totalCount=1000
a

found=500
l

records[0].RecNo=789
Success records[0].CreateTime=123456789
Return records[0].CallType=Incoming
records[0].EndState=Received
records[0].PeerNumber=501

Parameters in URL:
Type: call type
Comment
State: end state of the call
countNo: the number of records to get

Intelligent Building APIs 209


Parameters in Response :
totalCount : the record count which match condition
found : the record count to return
CallType: call type. The range is {"Incoming", "Outgoing"}.
EndState: the range is {"EndState" , "Received"}

12.3 Announcement Record

12.3.1 Insert Record


Table 12-9
http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=Announcement&Conten
Da

Syntax t=<Content>&ExpirTime=<ExpirTime>&IssueTime=<IssueTime>&Title=<Title>&User
hu

=<User>&State=<State>&ReadFlag=<ReadFlag>
a

Method GET
HT

Description Insert the Announcement record.


TP

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=Announcement&C
Example ontent=stringData&ExpirTime=2012-01-01%2012:00:00&IssueTime=2012-01-01%201
AP

2:00:00&Title=Anounce1&User=101&State=0&ReadFlag=0
I

Success
RecNo=<RecNo>
fo

Return
r

Parameters in URL:
Content: Announcement Content
We

ExpirTime: the time when the Announcement expire, format: 2012-01-01%2012:00:00


st

IssueTime: Announcement issue time, format: 2012-01-01%2012:00:00


Title: title of the announcement
Eu

Comment
User: the number the Announcement issued to
ro

State: the state of the Announcement. 0 init, 1 send , 2 overdue


pe

ReadFlag: the read flag. 0 not read, 1 read.


Parameters in Response :
Te

RecNo: the record index of the new record


c hn

12.4 Alarm Record


ic
a l

12.4.1 Query Alarm Record


Table 12-10
http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AlarmRecord[&StartTime=<
Syntax
startTime>&EndTime=<endTime>&count=<countNo>]
Method GET
Description Find the AlarmRecord record.
http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AlarmRecord&StartTi
Example
me=2014-8-25%2000:02:32&EndTime=2014-8-25%2001:02:32&count=500
Success totalCount = 1000
Return found = 500

Intelligent Building APIs 210


records [0].RecNo=789
records [0].CreateTime=123456789
records [0].Channel=0
records [0].SenseMethod=DoorMagnetism
records [0].RoomNumber=501
records [0].ReadFlag=0
records [0].Comment=Friend

Parameters in URL:
startTime: The start time ,format : 2014-8-25%2000:01:32
endTime: The end time, format: 2014-8-25%2000:02:32
countNo: the number of records to get, The record count, default 1024
Da

Comment Parameters in Response :


hu

totalCount : the record count which match condition


a

found : the record count to return


SenseMethod :the range is { "DoorMagnetism", "PassiveInfrared", "GasSensor",
HT

"SmokingSensor", "WaterSensor", "ActiveInfrared", "CallButton", "UrgencyButton",


TP

"Steal", "Perimeter", "PreventRemove", "DoorBell" }


AP
I
fo
r
We
st
Eu
ro
pe
Te
c hn
ic
a l

Intelligent Building APIs 211


13 DVR Custom APIs
13.1 File Finder

13.1.1 Create a File Finder


Table 13-1
http://<server>/cgi-bin/FileFindHelper.cgi?action=startFind&condition.channel=<Channe
lNo>&condition.startTime=<start>&condition.endTime=<end>&condition.streamType=<
Syntax
Da

stream>[&condition.flags[0]=<flag>&condition.events[0]=<event>&combineMode.granu
hu

larity=<granularityValue>&combineMode.types[0]=<combineType>]
Method GET
a

Description Start to find files.


HT

Find a file in channel 1. Event type is "AlarmLocal" or "VideoMotion". Time lines between
TP

2014-1-1 12:00:00 and 2015-1-10 12:00:00. Combine "AlarmLocal" or "VideoMotion"


files with granularity 16.
AP

URL is:
I

Example http://172.23.1.66/cgi-bin/fileFindHelper.cgi?action=startFind&condition.channel=1&con
fo

dition.startTime=2014-1-1%2012:00:00&condition.endTime=2015-1-10%2012:00:00&co
r

ndition.streamType=Main&condition.flags[0]=Event&condition.events[0]=AlarmLocal&co
We

ndition.events[1]=VideoMotion&combineMode.granularity=16&combineMode.types[0]=A
st

larmLocal&combineMode.types[0]=VideoMotion
Success
result=08137
Eu

Return
ro

Start to find a file with the above condition and combine files with certain type. If it
succeeds, return to find id. Otherwise return to Error.
pe

Parameters in URL:
Te

ChannelNo: integer, video channel index which starts from 1.


c

start / end: the start/end time when recording.


hn

flag: which flags of the file you want to find. It is an array. The index starts from 0. The
ic

range of flag is {"Timing", "Marked", "Event", "Restrict"}. If omitted, find files with all the
a

flags.
l

event: by which event the record file is triggered. It is an array. The index starts from 0.
Comment The range of event is {"AlarmLocal", "VideoMotion", "VideoLoss"}. This condition can be
omitted. If omitted, find files of all the events.
stream: which video stream type you want to find. The range of stream is {"Main",
"Extra1", "Extra2", "Extra3"}.
combineType: which types of the file you want to combined. It is an array. The index
starts from 0. The range of combine type is {"AlarmLocal", "VideoMotion", "Timing",
"VideoLoss"}. This condition can be omitted. If omitted, file will not be combined.
granularityValue: by which granularity to combine files
Example:
File 1:

DVR Custom APIs 212


items[0]. Channel =1
items[0]. StartTime =2011-1-1 12:00:00
items[0]. EndTime =2011-1-1 13:00:00
items[0]. Events[0]=AlarmLocal
items[0]. VideoStream=Main
items[0]. Length =790
items[0]. Duration = 3600

File 2:
items[0]. Channel =1
items[0]. StartTime =2011-1-1 13:00:00
items[0]. EndTime =2011-1-1 14:00:00
items[0]. Events[0]=AlarmLocal
Da

items[0]. VideoStream=Main
hu

items[0]. Length =790


items[0]. Duration = 3600
a
HT

file1 and file2 will be combined to file3


TP

File 3:
items[0]. Channel =1
AP

items[0]. StartTime =2011-1-1 12:00:00


I

items[0]. EndTime =2011-1-1 14:00:00


fo

items[0]. Events[0]=AlarmLocal
r

items[0]. VideoStream=Main
We

items[0]. Length =1580


items[0]. Duration = 7200
st
Eu

13.1.2 Create a Motion File Finder


ro

Table 13-2
pe

http://<server>/cgi-bin/FileFindHelper.cgi?action=startMotionFind&condition.channel=<C
Te

hannelNo>&condition.startTime=<start>&condition.endTime=<end>&condition.streamT
Syntax ype=<stream>&motionRegion.senseLevel=<level>[&motionRegion.rects[rectNo][0]=<r
c hn

ect0>&motionRegion.rects[rectNo][1]=<rect1>&motionRegion.rects[rectNo][2]=<rect2>
ic

&motionRegion.rects[rectNo][3]=<rect3>]
a

Method GET
l

Description Start to find motion files.


Find a file in channel 1, event type is "AlarmLocal" or "VideoMotion", and time between
2014-1-1 12:00:00 and 2015-1-10 12:00:00, motion region is [0,0,21,17]
URL is:
http://172.23.1.66/cgi-bin/fileFindHelper.cgi?action=startMotionFind&condition.channel=
Example 1&condition.startTime=2014-1-1%2012:00:00&condition.endTime=2015-1-10%2012:00:
00&condition.streamType=Main&condition.flags[0]=Event&condition.events[0]=AlarmLoc
al&condition.events[1]=VideoMotio&motionRegion.senseLevel=1&motionRegion.rects[1]
[0]=0&motionRegion.rects[1][1]=0&motionRegion.rects[1][2]=21&motionRegion.rects[1][
3]=17
Success result=08137

DVR Custom APIs 213


Return
Start to find a file with the above condition and combine files with certain type. If success,
return find id, else return Error.
Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
start / end: the start/end time when recording.
flag: which flags of the file you want to find. It is an array. The index starts from 0. The
range of flag is {"Timing", "Marked", "Event", "Restrict"}. If omitted, find files with all the
flags.
event: by which event the record file is triggered. It is an array. The index starts from 0.
Comment
The range of event is {"AlarmLocal", "VideoMotion"}. This condition can be omitted. If
omitted, find files of all the events.
stream: which video stream type you want to find. The range of stream is {"Main",
Da

"Extra1", "Extra2", "Extra3"}.


hu

level: the motion sensitive level, range is 0–6, 0 represent all level
rectNo: the rects array index, start from 1
a

rect0 & rect1 & rect2 & rect3 : relative coordinates, rect0 and rect2 range is 0—21, rect1
HT

and rect3 range is 0—17. {0,0,0,0} top—left, {21,0,0,0} top—right, {0,17,0,0} bottom
TP

—left, {21,17,0,0} bottom—right


AP

13.1.3 Get the File Information Found by the Finder


I
fo

Table 13-3
r

http://<server>/cgi-bin/FileFindHelper.cgi?action=findNext&findId=<findId>&count=<fileCo
Syntax
We

unt>
st

Method GET
Descriptio
Find the next files no more than fileCount number.
Eu

n
ro

Example http://192.168.1.108/cgi-bin/FileFindHelper.cgi?action=findNext&findId=08137&count=100
pe

found=1
items[0]. channel =1
Te

items[0]. startTime =2011-1-1 12:00:00


c

items[0]. endTime =2011-1-1 13:00:00


hn

Success
items[0]. fileType =dav
Return
ic

items[0]. events[0]=AlarmLocal
a

items[0]. streamType=Main
l

items[0]. length =790


items[0]. duration = 3600
findId: The find Id is created by API Create a file finder or API Create a motion file finder.
Comment
Must create a finder before finding files.

13.1.4 Stop the Finder


Table 13-4
Syntax http://<server>/cgi-bin/FileFindHelper.cgi?action=stopFind&findId=<findId>
Method GET
Description Stop the searching operation.

DVR Custom APIs 214


Example http://192.168.1.108/cgi-bin/FileFindHelper.cgi?action=stopFind&findId =08137
Success
OK
Return
findId: The find Id is created by API Create a file finder or API Create a motion file
Comment
finder. Must create a finder before finding files.

13.1.5 Get Bound Files


Table 13-5
http://<server>/cgi-bin/FileFindHelper.cgi?action=getBoundFile&condition.channel=<Cha
Syntax nnelNo>&condition.startTime=<start>&condition.endTime=<end>&condition.streamTyp
e=<stream>[&condition.flags[0]=<flag>&condition.events[0]=<event>]
Method GET
Da

Description Get bound files.


hu

http://<server>/cgi-bin/FileFindHelper.cgi?action=getBoundFile&condition.channel=1&co
a

Example ndition.startTime=2014-1-1%2012:00:00&condition.endTime=2015-1-10%2012:00:00&c
HT

ondition.streamType=Main&condition.flags[0]=Timing
found=2
TP

items[0]. channel =1
AP

items[0]. startTime =2011-1-1 12:00:00


items[0]. endTime =2011-1-1 13:00:00
I

items[0]. flags [0]= Timing


fo

items[0]. streamType=Main
r

items[0]. length =790


Success
We

items[0]. duration = 3600


Return
st

items[1]. channel =1
items[1]. startTime =2011-1-1 13:00:00
Eu

items[1]. endTime =2011-1-1 14:00:00


ro

items[1]. events[0]= Timing


pe

items[1]. streamType=Main
items[1]. length =790
Te

items[1]. duration = 3600


c

Comment Params is same as FileFindHelper. startFind


hn
ic

13.2 BandLimit
a l

13.2.1 Get Bandwidth Limit State


Table 13-6
Syntax http://<server>/cgi-bin/BandLimit.cgi?action=getLimitState
Method GET
Description Get bandwidth limit state.
Example http://192.168.1.108/cgi-bin/bandLimit.cgi?action=getLimitState
Success
limit=true
Return
Comment —

DVR Custom APIs 215


13.3 Record Files Protection

13.3.1 Add Protection


Table 13-7
http://<server>/cgi-bin/FileManager.cgi?action=addConditionList&condition.Types[0]=<
Syntax paramValue>&condition.StartTime=<paramValue>&condition.EndTime=<paramValu
e>&condition.Channel[0]=<paramValue>
Method GET
Description Add protection or access control for record files.
http://192.168.1.108/cgi-bin/FileManager.cgi?action=addConditionList&condition.Types
[0]=RecordRestrict&condition.Types[1]=RecordProtect&condition.StartTime=2014-7-3
Example
Da

%2021:02:32&condition.EndTime=2014-7-3%2023:02:32&condition.Channel[0]=1&con
hu

dition.Channel[1]=3
a

Success
OK
Return
HT

In table below:
TP

Comment TypeIndex: The index of type array


ChIndex: The index of channel number array
AP
I

Appendix:
fo

ParamName ParamValue type Description


r

An array. The range is {"RecordProtect",


condition.Type[TypeIndex] string
We

"RecordRestrict"}.
st

The time format is "Y-M-D H-m-S", example


condition.StartTime string
2011-7-3%2021:02:32
Eu

condition.EndTime string The time format is "Y-M-D H-m-S"


ro

condition.Channel[ChIndex] integer Video channel index which starts from 1.


pe

13.3.2 Cancel Protection


Te
c

Table 13-8
hn

http://<server>cgi-bin/FileManager.cgi?action=cancelConditionList&condition.Types[0]
ic

Syntax =<paramValue>&condition.StartTime=<paramValue>&condition.EndTime=<paramVa
a

lue>&condition.Channel[0]=<paramValue>
l

Method GET
Description Cancel protection of record files.
http://192.168.1.108/cgi-bin/FileManager.cgi?action=cancelConditionList&condition.Ty
pes[0]=RecordRestrict&condition.Types[1]=RecordProtect&condition.StartTime=2014-
Example
7-3%2021:02:32&condition.EndTime=2014-7-3%2023:02:32&condition.Channel[0]=1&
condition.Channel[1]=3
Success
OK
Return
Comment paramValue as Appendix above.

DVR Custom APIs 216


13.3.3 Remove Protection
Table 13-9
http://<server>/cgi-bin/FileManager.cgi?action=removeConditionList&condition.Types[0
Syntax ]=<paramValue>&condition.StartTime=<paramValue>&condition.EndTime=<paramV
alue>&condition.Channel[0]=<paramValue>
Method GET
Description Remove protection of record files.
http://192.168.1.108/cgi-bin/FileManager.cgi?action=removeConditionList&condition.Ty
pes[0]=RecordRestrict&condition.Types[1]=RecordProtect&condition.StartTime=2014-
Example
7-3%2021:02:32&condition.EndTime=2014-7-3%2023:02:32&condition.Channel[0]=0&
condition.Channel[1]=3
Success
Da

OK
Return
hu

Comment paramValue as Appendix above.


a
HT

13.4 Get Daylight


TP

Table 13-10
AP

Syntax http://<server>/cgi-bin/global.cgi?action=getDST
I

Method GET
fo

Description Get daylight saving time state.


r

Example http://192.168.1.108/cgi-bin/global.cgi?action=getDST
Success
We

result = 1
Return
st

Comment result: 1/0, yes or not in daylight saving time


Eu
ro
pe
Te
c
hn
ic
a l

DVR Custom APIs 217


14 Comm
14.1 Coaxial Control IO

14.1.1 Control White Light or Speaker


 control white light or speaker

Table 14-1
http://<server>/cgi-bin/coaxialControlIO.cgi?action=control&[channel=<channelno>]&[i
Syntax
Da

nfo[0].Type=<type>]&[info[0].IO=<io>
hu

Method GET
Description Control white light or speaker
a

http://192.168.1.108/cgi-bin/coaxialControlIO.cgi?action=control&channel=1&info[0].Ty
HT

Example
pe=1&info[0].IO=0
TP

Success status.whitelight=on
Return status.speaker=on
AP

channelno: video channel index for white light,for siren it's audio output channel, The
I

Comment channel number is default 0 if the request is not carried the param
fo

io: enable or disable the function


r

Appendix:
We
st

ParamName ParamValue type Description


type integer 1:wight light, 2:speaker
Eu

io bool 0:close, 1:open


ro

 get white light and speaker status


pe

Table 14-2
Syntax http://<server>/cgi-bin/coaxialControlIO.cgi?action= getstatus&[channel=<channelno>]
Te

Method GET
c hn

Description Get white light and speaker stauts


ic

Example http://192.168.1.108/cgi-bin/coaxialControlIO.cgi?action= getStatus&channel=1


Success status.whitelight=on
a l

Return status.speaker=on
Comment channelno: video channel index

14.2 Pir Alarm

14.2.1 Configure Pir Parameter


 Get pir parameter

Table 14-3
Syntax http://<server>/cgi-bin/pirAlarm.cgi?action=getPirParam&[channel=<channelNo>]

Comm 218
Method GET
Description Get pir parameter.
Example http://192.168.1.108/cgi-bin/pirAlarm.cgi?action=getPirParam&channel=1
head.Enable=true
head.PirLink.LightingLink.Enable=true
head.PirLink.LightingLink.LightLinkType=Filcker
head.PirLink.LightingLink.FilckerIntevalTime=5
head.PirLink.LightingLink.LightDuration=10
head.PirLink.LightingLink.WhiteLightTimeSection=TimeSection
head.PirLink.TimeSection[weekday][0]=1 00:00:00-24:00:00
head.PirLink.TimeSection[weekday][1]=0 02:00:00-24:00:00
head.PirLink.TimeSection[weekday][2]=0 03:00:00-24:00:00
head.PirLink.TimeSection[weekday][3]=0 04:00:00-24:00:00
Da

head.PirLink.TimeSection[weekday][4]=0 05:00:00-24:00:00
hu

head.PirLink.TimeSection[weekday][5]=0 06:00:00-24:00:00
a

head.RecordEnable=true
head.RecordChannels=[0, 1, 2]
HT

head.RecordLatch=10
TP

head.AlarmOutEnable=true
head.AlarmOutChannels=[1, 4]
AP

Success
head.AlarmOutLatch=10
I

Return
head.SnapshotEnable=true
fo

head.SnapshotChannels=[2, 4]
r

head.MailEnable=true
We

head.AlarmBellEnable=true
st

head.AlarmBellLatch=10
head.Dejitter=0
Eu

head.LogEnable=true
ro

head.DetectWindow[0].Level=3
head.DetectWindow[0].Id=0
pe

head.DetectWindow[0].Name=Region0
Te

head.DetectWindow[0].Sensitive=58
head.DetectWindow[0].Threshold=4
c
hn

head.DetectWindow[0].Region[0]=3932160
ic

head.DetectWindow[0].Region[1]=3932160
a


l


head. DetectWindow [1]…
if a device has one or more pir, PirParam is a array
channel : video channel index
Comment
weekday : range is [0-6] (Sunday - Saturday)
head=configEx[channelNo]
 set pir parameter

Table 14-4
http://<server>/cgi-bin/pirAlarm.cgi?action=setPirParam&[channel=<channelNo>]&<pa
Syntax
ramName>=<paramValue>...&<paramName>=<paramValue>

Comm 219
Method GET
Description Set pir parameter.
http://192.168.1.108/cgi-bin/pirAlarm.cgi?action=setPirParam&channel=1&configEx[1].
Example
Enable=true&configEx[1].PirLink.LightingLink.Enable=true&...
Success
OK
Return
channel : video channel index
Comment
head=configEx[channelNo]

Appendix:

ParamName ParamValue type Description


Enable/Disable motion detect feature in a
head.Enable bool
channel.
Da

WinNum
hu

Index of detect window, there are 4 detect


a

windows at present. Each window is


HT

divided into 18 lines and 22 blocks/line.


head.DetectWindow
integer
TP

[WinNum].Level
Range is [1—6].
AP

Sensitivity of pir
1: lowest sensitivity.
I

6: highest sensitivity.
fo

head.DetectWindow [WinNum].Id integer It is the Id of a detect window.


r

head.DetectWindow
string It is the name of a detect window.
We

[WinNum].Name
st

Range is [0—100].
head.DetectWindow
integer It presents more sensitive if the value is
Eu

[WinNum].Sensitive
larger.
ro

Range is [0—100].
head.DetectWindow [WinNum].
pe

integer It presents the threshold value when trigger


Threshold
motion detect.
Te
c hn
ic
a l

Comm 220
ParamName ParamValue type Description
LineNum
Index of region, region is divided into lines
and each line has several blocks, a line is
described by a 32 bit integer, a bit for a
block.
0=Line 1
1=Line 2

Currently, region is divided into 18 lines


head.DetectWindow[WinNum].Regi
integer and 22 blocks/line.
on[LineNum]
Da

A bit describes a block in the line.


hu

Bit = 1: motion in this block is monitored.


Example:
a

MotionDetect[0].Region[0] = 4194303
HT

(0x3FFFFF):: motion in channel 0 line 0's


TP

22 blocks is monitored.
MotionDetect[0].Region[1] =0: motion in
AP

line 1's 22 blocks is not monitored.


I

MotionDetect[0].Region[17] = 3: in the last


fo

line of channel 0, motion in the left two


r

blocks is monitored.
We

wd (week day) range is [0—6] (Sunday -


st

Staurday)
ts (time section) range is [0 — 23],
Eu

timesection table index.


ro

Format: mask hh:mm:ss-hh:mm:ss


pe

head.TimeSection[wd][ts] string Mask: [0—65535], hh: [0—24], mm: [0—


Te

59], ss: [0—59]


Mask indicates record type by bits:
c hn

Bit0: regular record


ic

Bit1: motion detection record


Bit2: alarm record
a l

Bit3: card record


Range is {0, 1}
head. PirLink.RecordChannels[ch] Integer 0 – do not record on video channel ch
1 – record on video channel ch
head. PirLink.RecordEnable bool Enable/Disable record function.
Range is [10—300].
head. PirLink.RecordLatch integer Unit is seconds, indicates the time to
record after input alarm is cleared.

Comm 221
ParamName ParamValue type Description
Range is {0, 1}, ch is alarm out channel
index.
head. PirLink.AlarmOutChannels[ch] integer 0 — do not output alarm at alarm out
channel ch
1 — output alarm at alarm out channel ch
head. PirLink.AlarmOutEnable bool Enable/Disable alarm out function.
Range is [10—300].
head. PirLink.AlarmOutLatch Integer Unit is seconds, indicates the time to
output alarm after input alarm is cleared.
Range is {0, 1}
head. PirLink.SnapshotChannels[ch] integer 0 — do not snapshot on video channel ch
1 — snapshot on video channel ch
Da

head. PirLink.SnapshotEnable bool Enable/Disable snapshot function.


hu

Range is [0—255].
a

head. PirLink.Dejitter integer Alarm signal dejitter seconds. Alarm signal


change during this period is ignored.
HT

head. PirLink.MailEnable bool Enable/Disable mail send for alarm.


TP

head. PirLink.AlarmBellEnable bool Enable/Disable mail send for alarm.


AP

Range is [10, 300]


head. PirLink.AlarmBellLatch integer
Unit is seconds
I

head. PirLink.LogEnable bool Enable/Disable log for alarm.


fo
r
We
st
Eu
ro
pe
Te
c hn
ic
a l

Comm 222
15 Other APIs
15.1 Discover Devices

15.1.1 Discover Devices on Internet


Table 15-1
Syntax http://<server>/cgi-bin/deviceDiscovery.cgi?action=attach[&DeviceClass=<deviceClass>]
Method GET
Description Discover devices on internet.
Da

Example http://192.168.1.108/cgi-bin/deviceDiscovery.cgi?action=attach&DeviceClass=VTO
hu

deviceInfo[index].AlarmInputChannels=8
a

deviceInfo[index].AlarmOutputChannels=0
HT

deviceInfo[index].DeviceClass=VTO
TP

deviceInfo[index].DeviceType=VTO2000A
deviceInfo[index].HttpPort=80
AP

deviceInfo[index].IPv4Address.DefaultGateway=172.12.0.1
I

deviceInfo[index].IPv4Address.DhcpEnable=false
fo

deviceInfo[index].IPv4Address.IPAddress=172.12.7.102
deviceInfo[index].IPv4Address.SubnetMask=255.255.0.0
r

deviceInfo[index].IPv6Address.DefaultGateway=2008::1
We

Success
deviceInfo[index].IPv6Address.DhcpEnable=false
st

Return
deviceInfo[index].IPv6Address.IPAddress=2008::6/112
deviceInfo[index].Mac=00:01:5b:01:44:77
Eu

deviceInfo[index].MachineName=YZZ4DZ008D00031
ro

deviceInfo[index].Port=37777
pe

deviceInfo[index].RemoteVideoInputChannels=0
deviceInfo[index].SerialNo=YZZ4DZ008D00031
Te

deviceInfo[index].Vendor=Multi
c

deviceInfo[index].Version=1.200.0.0
hn

deviceInfo[index].VideoInputChannels=1
ic

deviceInfo[index].VideoOutputChannels=16
a

Parameters in URL:
l

deviceClass: in range of {VTO, VTH, VTT, VTS, VTNC, SHG}


Comment Parameters in Response:
index: the array index which starts from 0.
Version: Software Version

15.2 Flashlight

15.2.1 Flashlight Config


 Get Flashlight Config

Other APIs 223


Table 15-2
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FlashLight
Method GET
Description Get Flashlight config. It does not recommend using it.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FlashLight
head.Brightness=50
head.Enable=false
Success head.TimeSection[0][0]=1 00:00:00-23:59:59
Return head.TimeSection[0][1]=0 00:00:00-23:59:59

head.TimeSection[6][5]=0 00:00:00-23:59:59
Parameters in Response:
Comment
head = table.FlashLight
Da

 Set flashlight config


hu

Table 15-3
a

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
HT

Syntax
alue>[&<paramName>=<paramValue>…]
TP

Method GET
Description Set Flashlight config.
AP

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FlashLight.Enable=tr
Example
I

ue&FlashLight.TimeSection[1][0]=1%2012:00:00-18:00:00
fo

Success
OK
r

Return

We

Comment
st

Appendix:
Eu

ParamName ParamValue type Description


FlashLight. Enable bool Enable
ro

FlashLight. Brightness integer Brightness


pe

It is an effective time period for flash light every day.


Te

wd (week day) range is [0—6] (Sunday—Saturday)


ts (time section) range is [0—23], it's index of time
c hn

section table.
ic

Format: mask hh:mm:ss-hh:mm:ss


a l

FlashLight. Mask: {0,1}, hh: [0—24], mm: [00—59], ss: [00—59]


string
TimeSection[wd][ts] Mask 0: this time section is not used.
Mask 1: this time section is used.

Example:
TimeSection[1][0]=1 12:00:00—18:00:00
Means flash light is effective between 12:00:00 and
18:00:00 at Monday.

Other APIs 224


15.3 Open Platform

15.3.1 Application Start and Stop


 Start Application
Syntax http://<server>/cgi-bin/installManager.cgi?action=start&appname=xxx&appid=yyy
Method GET
Description Start application.
http://192.168.1.108/cgi-bin/installManager.cgi?action=start&appname=FaceDemo&ap
Example
pid=1
Success
OK
Return
Da

Comment —
hu

 Stop Application
a

Syntax http://<server>/cgi-bin/installManager.cgi?action=stop&appname=xxx&appid=yyy
HT

Method GET
Description Stop application.
TP

http://192.168.1.108/cgi-bin/installManager.cgi?action=stop&appname=FaceDemo&ap
Example
AP

pid=1
I

Success
OK
Return
fo

Comment —
r
We
st
Eu
ro
pe
Te
c hn
ic
a l

Other APIs 225


16 AI APIs
16.1 Video Analyse APIs

16.1.1 People Counting

16.1.1.1 Get Summary


Da

Table 16-1
hu

URL http://<server>/cgi-bin/videoStatServer.cgi?action=getSummary
Method GET
a

Description Get summary information of video Stat.


HT

[ Request Params ] ( key=value format in URL )


TP

Name Type R/O Param Description


channel int O Video channel index which starts from 1, default is 1.
AP

[ Response Params ] (key=value format)


I

Name Type R/O Param Description


fo

summary object R Summary information of video Stat.


r

+Channel int R Video channel index which starts from 0.


We

Rule type, it can be:


st

 "ManNumDetection": count the people num in region,


and the detail stat is in "InsideSubtotal" param.
+RuleName string R
Eu

 "NumberStat": count the people entering and leaving the


ro

region, and the detail stat is in "EnteredSubtotal" and


pe

"ExitedSubtotal"param.
+EnteredSubto
object O People enter stat.
Te

tal
c

++Total int R Total enter num.


hn

++Today int R Today enter num.


ic

++Hour int R This hour enter num.


a

++TotalInTime
l

int O Today enter num after call clearSectionStat.


Section
+ExitedSubtota
object O People leave stat.
l
++Total int R Total leave num.
++Today int R Today leave num.
++Hour int R This hour leave num.
++TotalInTime
int O Today leave num after call clearSectionStat.
Section
+InsideSubtotal object O People inside region stat.
++Total int R Today inside num.

AI APIs 226
++ManStayStat array<object> O The entering and leaving stat of people that leaved.
+++EnterTime string O People enter time, ex: 2012-01-04 00:00:00.
+++ExitTime string O People leave time, ex: 2012-01-04 00:00:45.
[ Example ]
Request GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=getSummary&channel=1
summary.Channel=0
summary.RuleName=NumberStat
summary.EnteredSubtotal.Today=0
summary.EnteredSubtotal.Total=14
summary.EnteredSubtotal.TotalInTimeSection=0
summary.ExitedSubtotal.Today=0
Respons
summary.ExitedSubtotal.Total=32
e
summary.ExitedSubtotal.TotalInTimeSection=0
Da

summary.InsideSubtotal.Total=65
hu

summary.InsideSubtotal.ManStayStat[0].EnterTime=2012-01-04 00:00:00
a

summary.InsideSubtotal.ManStayStat[0].ExitTime=2012-01-04 00:00:45
summary.InsideSubtotal.ManStayStat[1].EnterTime=2012-01-04 00:00:00
HT

summary.InsideSubtotal.ManStayStat[1].ExitTime=2012-01-04 00:00:45
TP
AP

16.1.1.2 Query the Count of People


I

 Start to find
fo

Table 16-2
r

URL http://<server>/cgi-bin/videoStatServer.cgi?action=startFind
We

Method GET
st

Start to find video stat info, in response, there is a token for further info finding process,
Description
and there is a totalCount shows how many data count(s).
Eu

[ Request Params ] ( key=value format in URL )


ro

Name Type R/O Param Description


pe

channel int O Video channel index which starts from 1, default is 1.


condition object R Find condition.
Te

+StartTime string R Find time range start, ex: 2012-01-04 00:00:00.


c hn

+EndTime string R Find time range end, ex: 2012-01-04 00:02:00.


ic

The information granularity returned by the query


requirements. The range is {Hour, Day, Week, Month,
a

+Granularity string R
l

Season, Year}(Note: Most devices only support Hour, Day,


Week.)
Rule type, it can be: NumberStat, ManNumDetection. If
+RuleType string O
omit, default is NumberStat
Valid when ruleType is ManNumDetection, report people
+MinStayTime int O
stay over this minimal time.
[ Response Params ] (key=value format)
Name Type R/O Param Description
Token for this search, use this token to get result and stop
token int R
search.
totalCount int R Number of find result.

AI APIs 227
[ Example ]
GET
http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=startFind&channel=1&condition.St
Request
artTime=2011-01-01%2012:00:00&condition.EndTime=2011-01-10%2012:00:00&condition
.Granularity=Hour&condition.RuleType=NumberStat&condition.MinStayTime=20
token=12345
Response
totalCount=56
 Get the find result

Table 16-3
URL http://<server>/cgi-bin/videoStatServer.cgi?action=doFind
Method GET
Description Get the find result of Video Stat info with channel, token, begin Number and count.
Da

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
hu

Video channel index which starts from 1, default is 1.


a

channel int O
NOTE: must be the same as startFind.
HT

Token for this search, use this token to get result and stop
token int R
TP

searching.
beginNumber int R The start count. It must be between 0 and totalCount -1.
AP

count int R The count of info for this query.


I

[ Response Params ] (key=value format)


fo

Name Type R/O Param Description


r

found int R Number of result that return.


We

info array<object> R Result information of video Stat.


+Channel int R Video channel index which starts from 0.
st

Rule name, it can be:


Eu

 "ManNumDetection": count people num in region, detail


ro

stat is in "InsideSubtotal"param
+RuleName string R
 "NumberStat": count people enter and leave region,
pe

detail stat is in "EnteredSubtotal"and


Te

"ExitedSubtotal"param.
+StartTime string O Find time range start, ex: 2012-01-04 00:00:00.
chn

+EndTime string O Find time range end, ex: 2012-01-04 00:02:00.


ic

+EnteredSubto
int O Total enter num.
a

tal
l

+ExitedSubtota
int O Total leave num.
l
+InsideSubtotal int O Total inside num.
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=doFind&channel=1&token=1234
5&beginNumber=0&count=20

AI APIs 228
found=20
info[0].Channel=0
info[0].RuleName=NumberStat
info[0].StartTime=2012-03-14 00:00:00
info[0].EndTime=2012-04-14 00:00:00
info[0].EnteredSubtotal=14
info[0].ExitedSubtotal=5
info[0].InsideSubtotal=65
Response
info[1].Channel=0
info[1].RuleName=NumberStat
info[1].StartTime=2012-03-14 00:00:00
info[1].EndTime=2012-04-14 00:00:00
info[1].EnteredSubtotal=14
Da

info[1].ExitedSubtotal=5
hu

info[1].InsideSubtotal=65

a

 Stop the searching session


HT
TP

Table 16-4
URL http://<server>/cgi-bin/videoStatServer.cgi?action=stopFind
AP

Method GET
I

Description Stop query video stat by channel and token.


fo

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
r

Video channel index which starts from 1, default is 1.


We

channel int O
NOTE: must be the same as startFind.
st

Token for this search, use this token to get result and stop
token int R
search.
Eu

[ Response Params ] ( OK )
ro

[ Example ]
pe

GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=stopFind&channel=1&token
Request
=12345
Te

Response OK
c hn
ic

16.1.1.3 Clear the People Count Information


a l

Table 16-5
URL http://<server>/cgi-bin/videoStatServer.cgi?action=clearSectionStat
Method GET
Description Clear the people count information.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
channel int O Video channel index which starts from 1, default is 1.
[ Response Params ] ( OK )
[ Example ]
Request GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=clearSectionStat&channel=1

AI APIs 229
Response OK

16.1.1.4 Subscribe the People Count Information

Table 16-6
URL http://<server>/cgi-bin/videoStatServer.cgi?action=attach
Method GET
Description Subscribe the people count information.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
channel int O Video channel index which starts from 1, default is 1.
Send heartbeat interval, range is [1, 60],unit is second. If the
Da

URL contains this parameter, and the value is 5, it means every


heartbeat int O 5 seconds the device should send the heartbeat message to
hu

the client, the heartbeat meaage are "Heartbeat". If this


a

parameter is not present, its default value is 60.


HT

[ Response Params ] (key=value format)


TP

Name Type R/O Param Description


summary object R Summary information of video Stat.
AP

+Channel int R Video channel index which starts from 0.


I

Rule type, it can be:


fo

 "ManNumDetection": Count people num in region, detail


r

stat is in "InsideSubtotal" param.


+RuleName string R
We

 "NumberStat": Count people entering and leaving region,


detail stat is in "EnteredSubtotal" and "ExitedSubtotal"
st

param.
Eu

+EnteredSubtota
object O People enter stat.
l
ro

++Total int R Total enter num.


pe

++Today int R Today enter num.


Te

++Hour int R This hour enter num.


++TotalInTimeSe
c

int O Today enter num after call clearSectionStat.


hn

ction
ic

+ExitedSubtotal object O People leave stat.


a

++Total int R Total leave num.


l

++Today int R Today leave num.


++Hour int R This hour leave num.
++TotalInTimeSe
int O Today leave num after call clearSectionStat.
ction
+InsideSubtotal object O People inside region stat.
++Total int R Today inside num.
array<obj
++ManStayStat O The entering and leaving stat of people that leaved.
ect>
+++EnterTime string O People enter time, ex: 2012-01-04 00:00:00.
+++ExitTime string O People leave time, ex: 2012-01-04 00:00:45.
[ Example ]

AI APIs 230
GET
Request
http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=attach&channel=1&heartbeat=5
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

--<boundary>
Content-Type: text/plain
Content-Length: <length>

summary.Channel=0
summary.RuleName=NumberStat
Da

summary.EnteredSubtotal.Today=0
hu

summary.EnteredSubtotal.Total=14
summary.EnteredSubtotal.TotalInTimeSection=0
a

summary.ExitedSubtotal.Today=0
HT

summary.ExitedSubtotal.Total=32
TP

summary.ExitedSubtotal.TotalInTimeSection=0
summary.InsideSubtotal.Total=65
AP

Response
summary.InsideSubtotal.ManStayStat[0].EnterTime=2012-01-04 00:00:00
I

summary.InsideSubtotal.ManStayStat[0].ExitTime=2012-01-04 00:00:45
fo

summary.InsideSubtotal.ManStayStat[1].EnterTime=2012-01-04 00:00:00
r

summary.InsideSubtotal.ManStayStat[1].ExitTime=2012-01-04 00:00:45
We

--<boundary>
Content-Type: text/plain
st

Content-Length: 11
Eu
ro

Heartbeat
--<boundary>
pe

Content-Type: text/plain
Te

Content-Length: <length>
c hn

summary.Channel=0
ic

summary.RuleName=NumberStat
summary.EnteredSubtotal.Today=0
a l

summary.EnteredSubtotal.Total=14

16.1.1.5 [Event] NumberStat

Table 16-7
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
Description When people number triggers the rule, send this event.
[ Event Params ] ( JSON format )
Name Type R/O Param Description

AI APIs 231
Number int R Total number in detect region.
EnteredNumber int R Total number that enter the detect region.
ExitedNumber int R Total number that leave the detect region.
Number overrun type, it can be: "EnterOver", "ExitOver",
Type string R
"InsideOver".
[ Example ]
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Code=NumberStat;action=Start;index=0;data={
Event "Number": 120,
"EnteredNumber": 180,
Da

"ExitedNumber": 60,
hu

"Type": "EnterOver"
a

}
--<boundary>
HT
TP

16.1.1.6 [Event] ManNumDetection


AP
I

Table 16-8
fo

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


r

Description When people number triggers the rule, send this event.
[ Event Params ] ( JSON format )
We

Name Type R/O Param Description


st

Array<obje
ManList R The people info list.
Eu

ct>
The detected people bounding box, 4 interge, refer to x's value
ro

of left-top point, y's value of left-top point, x's value of


pe

+BoundingBox Array<int> R
right-bottom point, y's value of right-bottom point. Coordinate
remap to 0 — 8192.
Te

+Stature int R The people's stature, unit is cm.


chn

[ Example ]
ic

--<boundary>
Content-Type: text/plain
a l

Content-Length: <length>

Code=ManNumDetection;action=pulse;index=0;data={
Event
"ManList": [ { "BoundingBox": [2992,1136,4960,5192], "Stature": 170 },
{ "BoundingBox": [4392,4136,6960,6512], "Stature": 175 },
{…}, … ]
}
--<boundary>

AI APIs 232
16.1.2 FaceRecognitionServer

16.1.2.1 Create Face Group

Table 16-9
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=createGroup
Method GET
Description Create a face group.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
groupName string R The face group name, max string length is 127.
Da

The description detail of the face group, max string length is


groupDetail string O
255.
hu

[ Response Params ] ( key=value format )


a

Name Type R/O Param Description


HT

groupID string R The identity of the created face group, max string length is 63.
TP

[ Example ]
GET
AP

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=createGroup&groupName
I

=Test1&groupDetail=ForTest1
fo

Response groupID=10000
r
We

16.1.2.2 Modify Face Group


st

Table 16-10
Eu

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=modifyGroup
ro

Method GET
pe

Description Modify a face group.


[ Request Params ] ( key=value format at URL )
Te

Name Type R/O Param Description


c

groupID string R The identity of the face group, max string length is 63.
hn

groupName string R The name of the the face group, max string length is 127.
ic

groupDetail string O Description detail of the face group, max string length is 255.
a l

[ Response Params ] ( OK )
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=modifyGroup&groupID=10
000&groupName=Test1&groupDetail=ForTest1
Response OK

16.1.2.3 Delete Face Group

Table 16-11
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=deleteGroup

AI APIs 233
Method GET
Description Delete a face group.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
groupID string R The identity of the face group, max string length is 63.
[ Response Params ] ( OK )
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=deleteGroup&groupID=100
00
Response OK
Da

16.1.2.4 Deploy Face Group


hu

There are two ways to deploy the group. One is based on the group (putDisposition), and the
a

another one is based on the channel (setGroup).


HT

 Put disposition to group


TP

Table 16-12
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=putDisposition
AP

Method GET
I

Deploy the face group to some video channels. If the video channel has been deployed
fo

Description
already, it will change the similary.
r

[ Request Params ] ( key=value format at URL )


We

Name Type R/O Param Description


st

groupID string R The identity of the face group, max string length is 63.
list Array<object> R List of disposition info.
Eu

+channel int R Video channel index which starts from 1.


ro

+similary int R The threshold of the face similary, 0 — 100.


pe

[ Response Params ] ( key=value format )


Name Type R/O Param Description
Te

report array<bool> R Result of putting disposition for each request channel.


c

[ Example ]
hn

GET
ic

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=putDisposition&groupID=1
a

0000&list[0].channel=1&list[0].similary=80&list[1].channel=2&list[1].similary=70
l

report[0]=true
Response
report[1]=false
 Delete some disposition from group

Table 16-13
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=deleteDisposition
Method GET
Descripti
Remove the deployment of face group from some video channels.
on
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description

AI APIs 234
groupID string R The identity of the face group, max string length is 63.
channel Array<int> R Video channel index which starts from 1.
[ Response Params ] ( key=value format )
Name Type R/O Param Description
report array<bool> R Result of deleting disposition for each request channel.
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=deleteDisposition&groupID
=10000&channel[0]=1&channel[1]=2
report[0]=true
Response
report[1]=false
 set disposition group to channel
Da

Table 16-14
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=setGroup
hu

Method GET
a

Deploy some face groups to one video channel. If the video channel has been deployed
HT

Descripti
already, it will change the similary.
on
TP

Note: This method will do an overwrite operation.


[ Request Params ] ( key=value format at URL )
AP

Name Type R/O Param Description


I

channel int R Video channel index which starts from 1.


fo

List of disposition info, if not exist, remove all disposition from


list Array<object> O
r

channel.
We

+groupID int R The identity of the face group, max string length is 63.
+similary int R The threshold of the face similary, 0 — 100.
st

[ Response Params ] ( OK )
Eu

[ Example ]
ro

GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=setGroup&channel=1&list
pe

[0].groupID=10000&list[0].similary=80&list[1].groupID=10002&list[1].similary=75
Te

Response OK
c

 get disposition group from channel


hn

Table 16-15
ic

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=getGroup
a l

Method GET
Get the Deployment about the video channel.
Descripti
Note: If the video channel does not deploy any group, then the response will be success
on
with empty http body.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
channel int R Video channel index which starts from 1.
[ Response Params ] (key=value format)
Name Type R/O Param Description
groupID Array<int> R The identity of the face group, max string length is 63.
similary Array<int> R The threshold of the face similary, 0 — 100.

AI APIs 235
[ Example ]
Request GET http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=getGroup&channel=1
groupID[0]=10001
groupID[1]=10003
groupID[2]=10006
….
Response
similary[0]=80
similary[1]=75
similary[2]=85
….

16.1.2.5 Find Face Group


Da

Table 16-16
hu

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=findGroup
a

Method GET
HT

Description Find the face group. If the groupID is not present in the URL, it will return all the groups.
TP

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
AP

groupID string O The identity of the face group, max string length is 63.
I

[ Response Params ] ( key=value format )


fo

Name Type R/O Param Description


r

GroupList Array<object> R The face group information list.


We

+groupID string R The identity of the face group, max string length is 63.
+groupName string R Name of the face group, max string length is 127.
st

+groupDetail string O Description detail of the face group, max string length is 255.
Eu

+groupSize int R The number of face in this face group.


ro

+channels Array<int> R Video channel index which starts from 0.


+similarity Array<int> R The threshold of the face similary.
pe

[ Example ]
Te

Request GET http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=findGroup


c hn
ic
a l

AI APIs 236
GroupList[0].groupID=00001
GroupList[0].groupName=Test1
GroupList[0].groupDetail=ForTest1
GroupList[0].groupSize=30
GroupList[0].channels[0]=1
GroupList[0].channels[1]=2

GroupList[0].similarity[0]=80
GroupList[0].similarity[1]=75

Response
GroupList[1].groupID=00003
GroupList[1].groupName=Test3
GroupList[1].groupDetail=ForTest3
Da

GroupList[1].groupSize=50
hu

GroupList[1].channels[0]=1
GroupList[1].channels[1]=2
a


HT

GroupList[1].similarity[0]=70
TP

GroupList[1].similarity[1]=85

AP
I

16.1.2.6 Re-Abstract Feature By Group


fo
r

 Start ReAbstract
We

Table 16-17
st

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=groupReAbstract
Method GET
Eu

Abstract features for the groups.


ro

Description About the process of the re-extract, the device will use an event named
pe

"FaceFeatureAbstract" to report the process.


[ Request Params ] ( key=value format at URL )
Te

Name Type R/O Param Description


c hn

groupID Array<int> R The identity of the face group, max string length is 63.
[ Response Params ] (key=value format)
ic

Name Type R/O Param Description


a l

token int R The identity of this operation.


[ Example ]
GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=groupReAbstract&groupID[
0]=10000&groupID[1]=10001
Response token=12345
 Stop ReAbstract

Table 16-18
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopGroupReAbstract
Method GET

AI APIs 237
Descripti
Stop the abstract features process.
on
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
token int R The identity of this operation.
[ Response Params ] ( OK )
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=stopGroupReAbstract&tok
en=12345
Response OK
Da

16.1.2.7 Add Person


hu

Table 16-19
a

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=addPerson
HT

Method POST
TP

Description Add a person to a group.


[ Request Params ] ( key=value format in URL )
AP

Name Type R/O Param Description


I

The identity of the face group that this person to add. Max string
groupID string R
fo

length is 63.
r

name string R The person name, max string length is 63.


We

birthday string O The person's birthday, ex: "1980-01-01".


sex string O Sex, it can be "Male", "Female", "Unknown".
st

The country name, length must be 2, and value should be


country string O
Eu

according to ISO3166.
ro

province string O The province name, max string length is 63.


city string O The city name, max string length is 63.
pe

The certificate type. It can be: "IC', "Passport", "Military",


certificateType string O
Te

"Unknown".
c

id string O The ID of certificate type, max string length is 31.


hn

[ Response Params ] (key=value format )


ic

Name Type R/O Param Description


a

uid string R The id for this Person, max string length is 31.
l

[ Example ]
POST
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=addPerson&groupID=10000&na
me=ZhangSan&birthday=1980-01-05&sex=Male&country=CN&province=ZheZhang&city=
Hangzhou HTTP/1.1
Request
Content-Type: image/jpeg
Content-Length: <image size>

<JPEG image data>


Response uid=0005

AI APIs 238
16.1.2.8 Modify Person

Table 16-20
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=modifyPerson
Method POST
Modify a person's info.
Note: If you do not want to change the image about the person, the request should not
Description
contain the image data.
Note: You should provide at lease one optional param to update.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
uid string R The identity of the Person, max string length is 31.
Da

The identity of the Face Group that this Person in. max string
groupID string R
length is 63.
hu

name string O The person's name, max string length is 63.


a

birthday string O The person's birthday, ex: "1980-01-01".


HT

sex string O Sex, it can be "Male", "Female", "Unknown".


TP

The country name, length must be 2, and value should be


country string O
according to ISO3166.
AP

province string O The province name, max string length is 63.


I

city string O The city name, max string length is 63.


fo

The certificate type. It can be: "IC', "Passport", "Military",


certificateType string O
r

"Unknown".
We

id string O The ID of certificate type, max string length is 31.


[ Response Params ] ( OK )
st

[ Example ]
Eu

POST
ro

http://<server>/cgi-bin/faceRecognitionServer.cgi?action=modifyPerson&uid=0005&grou
pID=10000&name=ZhangSan&birthday=1980-01-05&sex=Male&country=CN&province=
pe

ZheZhang&city=Hangzhou HTTP/1.1
Request
Te

Content-Type: image/jpeg
Content-Length: <image size>
c hn
ic

<JPEG image data>


a

Response OK
l

16.1.2.9 Delete Person

Table 16-21
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=deletePerson
Method GET
Description Delete a person from a group.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
uid string R The identity of the person, max string length is 31.

AI APIs 239
The identity of the face group that this Person in. max string
groupID string R
length is 63.
[ Response Params ] ( OK )
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=deletePerson&uid=001&gr
oupID=10000
Response OK

16.1.2.10 Find Person


 Start to find

Table 16-22
Da

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFind
hu

Method GET
a

Start to find person in face groups.


HT

Description
Note: the returned token will be expired after 60 seconds without any doFind call.
TP

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
AP

condition Object R Search scope condition.


I

+GroupID Array<string> R The list of identity of the face group, max string length is 63.
fo

person object O Person condition.


r

+Name string O Person Name, max string length is 63.


We

+Sex string O Sex, it can be "Male", "Female", "Unknown".


string O Country name, length must be 2, and value should be
st

+Country
according to ISO3166.
Eu

+Province string O Province name, max string length is 63.


ro

+City string O City name, max string length is 63.


string O Certificate Type. It can be: "IC', "Passport", "Military",
pe

+CertificateType
"Unknown".
Te

+ID string O Person ID of CertificateType, max string length is 31.


c

+FeatureState int O Feature State, 0:Unknown, 1:Failed, 2:OK.


hn

[ Response Params ] ( key=value format )


ic

Name Type R/O Param Description


a

Token for this search, use this token to get result and stop
l

token uint R
search.
totalCount int R Result num, return -1 means still searching.
[ Example ]
GET
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFind&condition.GroupID[0]
Request
=10000&condition.GroupID[1]=10003&person.Sex=Male&person.Country=CN&person.F
eatureState=1
token=123456789
Response
totalCount=24
 Get find result

AI APIs 240
Table 16-23
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFind
Method GET
Descripti Get one result of person's information from the search result set.
on Note: the returned token will be expired after 60 seconds without any doFind call.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Token for this search, use this token to get result and stop
token uint R
search.
The index in search result, should between 0 and totalCount
index uint R
–1.
[ Response Params ] ( JSON format )
Name Type R/O Param Description
Da

person object R Person condition.


hu

+UID string R The identity of the person, max string length is 31.
a

string R The identity of the face group that this Person in. max string
+GroupID
HT

length is 63.
+Name string R The person name, max string length is 63.
TP

+Sex string O Sex, it can be "Male", "Female", "Unknown".


AP

+Birthday string O The person's birthday, ex: "1980-01-01".


I

string O Country name, length must be 2, and value should be


+Country
according to ISO3166.
fo

+Province string O Province name, max string length is 63.


r

+City string O City name, max string length is 63.


We

string O Certificate Type, can be: "IC', "Passport", "Military",


st

+CertificateType
"Unknown".
+ID string O Person ID of CertificateType, max string length is 31.
Eu

+FeatureState int O Feature State, 0:Unknown, 1:Failed, 2:OK.


ro

[ Example ]
pe

GET
Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFind&token=123456789&in
Te

dex=0
c hn

HTTP/1.1 200 OK
Server: Device/1.0
ic

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


a l

Content-Length: <length>

--<boundary>
Content-Type: text/plain
Response
Content-Length: <length>

person.UID=0005
person.GroupID=10000
person.Name=ZhangSan
person.Birthday=1980-01-01
person.Sex=Male

AI APIs 241
person.Country=CN
person.Province=ZheJiang
person.City=HangZhou
person.CertificateType=IC
person.ID=1234567890
person.FeatureState=0
--<boundary>
Content-Type: image/jpeg
Content-Length: <image size>

< jpeg image data ... >


--<boundary>--
 Stop finding
Da

Table 16-24
hu

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFind
a

Method GET
HT

Descripti
Stop the search session.
TP

on
[ Request Params ] ( key=value format in URL )
AP

Name Type R/O Param Description


I

The token for this search, use this token to get result and stop
token uint R
fo

search.
r

[ Response Params ] ( OK )
[ Example ]
We

GET
st

Request
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFind&token=123456789
Eu

Response OK
ro
pe

16.1.2.11 Re-Abstract Features By Person


 Start ReAbstract
Te
c

Table 16-25
hn

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=reAbstract
ic

Method GET
a

Abstract features for the persons.


l

Description About the process of the re-extract, the device will use an event named
"FaceFeatureAbstract"to report the process.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
UID Array<int> O The list of identity of person, max string length is 31.
[ Response Params ] ( OK )
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=reAbstract&uid[0]=001&ui
d[1]=002

AI APIs 242
Response OK
 Stop ReAbstract

Table 16-26
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopReAbstract
Method GET
Descripti
Stop the abstract features process.
on
[ Request Params ] ( None )
[ Response Params ] ( OK )
[ Example ]
Request GET http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=stopReAbstract
Respons
OK
Da

e
hu
a

16.1.2.12 [Config] Face Recognition AlarmOut Setting


HT

 Get FaceRecognitionAlarm config


TP

Table 16-27
AP

http://<server>/cgi-bin/ConfigManager.cgi?action=getConfig&name=FaceRecognitionAla
URL
I

rm
Method GET
fo

Description Get the Face Recognition Alarm Out Setting.


r

[ Request Params ] ( None )


We

[ Response Params ] ( key=value format )


st

Name Type R/O Param Description


table object R Config info table.
Eu

+FaceRecognitio
ro

array<object> R Each face group has one config object in this array.
nAlarm
pe

++GroupID String R The face group ID, max string length is 63.
++GroupName String R The face group name, max string length is 127.
Te

++AlarmOutEna
c

Bool R Enable AlarmOut or not.


ble
hn

++AlarmChannel Array<object> R Each AlarmOut channel has one config object in this array.
ic

Alarm rule mask.


a

+++AlarmRuleM
l

Int R  Bit 0 : recognition success


ask
 Bit 1 : recognition failed
+++AlarmOutLat
Int R Alarm out delay, unit is second, value between 1 anf 300.
ch
[ Example ]
GET
Request http://10.0.0.8/cgi-bin/ConfigManager.cgi?action=getConfig&name=FaceRecognitionAlar
m

AI APIs 243
table.FaceRecognitionAlarm[0].GroupID=0017
table.FaceRecognitionAlarm[0].GroupName=wsd
table.FaceRecognitionAlarm[0].AlarmOutEnable=true
table.FaceRecognitionAlarm[0].AlarmChannel[0].AlarmRuleMask=0
table.FaceRecognitionAlarm[0].AlarmChannel[0].AlarmOutLatch=5
table.FaceRecognitionAlarm[0].AlarmChannel[1].AlarmRuleMask=0
table.FaceRecognitionAlarm[0].AlarmChannel[1].AlarmOutLatch=8

Response
table.FaceRecognitionAlarm[1].GroupID=0018
table.FaceRecognitionAlarm[1].GroupName=cst
table.FaceRecognitionAlarm[1].AlarmOutEnable=true
table.FaceRecognitionAlarm[1].AlarmChannel[0].AlarmRuleMask=0
table.FaceRecognitionAlarm[1].AlarmChannel[0].AlarmOutLatch=10
Da

table.FaceRecognitionAlarm[1].AlarmChannel[1].AlarmRuleMask=0
hu

table.FaceRecognitionAlarm[1].AlarmChannel[1].AlarmOutLatch=15

a

 Set FaceRecognitionAlarm config


HT

URL http://<server>/cgi-bin/ConfigManager.cgi?action=setConfig
TP

Method GET
Descripti
AP

Set the Face Recognition Alarm Out Setting.


on
I

[ Request Params ] ( key=value format at URL )


fo

Name Type R/O Param Description


r

FaceRecognition
array<object> R Each face group has one config object in this array.
We

Alarm
st

+GroupID String R The face group ID, max string length is 63.
+GroupName String R The face group name, max string length is 127.
Eu

+AlarmOutEnabl
Bool R Enable AlarmOut or not.
ro

e
pe

+AlarmChannel Array<object> R Each AlarmOut channel has one config object in this array.
Alarm rule mask.
++AlarmRuleMa
Te

Int R  Bit 0 : recognition success


sk
c

 Bit 1 : recognition failed


hn

++AlarmOutLatc
ic

Int R Alarm out delay, seconds, value between 1 and 300.


h
a

[ Response Params ] ( OK )
l

[ Example ]
GET
http://10.0.0.8/cgi-bin/ConfigManager.cgi?action=setConfig&FaceRecognitionAlarm[0].Gr
Request oupID=0017&FaceRecognitionAlarm[0].GroupName=wsd&FaceRecognitionAlarm[0].Ala
rmOutEnable=true&FaceRecognitionAlarm[0].AlarmChannel[0].AlarmRuleMask=0&Face
RecognitionAlarm[0].AlarmChannel[0].AlarmOutLatch=5
Response OK

16.1.2.13 Find Person by Picture


 Start to find

AI APIs 244
Table 16-28
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindByPic
Method POST
Start to find person in face groups by picture. The search may last for some time, so the
response may push at regular intervals until 100% Progress
Description Note: If you want to find person in face groups by person info, see above "Find
Person"API.
Note: The returned token will be expired after 60 seconds without any doFind call.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
GroupID array<string> R Face groups to find, max string length is 63.
Similarity int R Similarity percent, 1 — 100.
MaxCandidate int O Max Candidate result number.
Da

[ Response Params ] ( JSON format )


hu

Name Type R/O Param Description


a

The token of this search, use this token to get result and stop
token uint R
HT

search.
progress uint R Search Progress, 100 means finished.
TP

totalCount int R Result num, return -1 means still searching.


AP

[ Example ]
I

POST
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindByPic&GroupID[0]=0000
fo

1&GroupID[1]=00003&Similarity=80&MaxCandidate=500
r

Request Content-Type: image/jpeg


We

Content-Length: <image size>


st

<JPEG data>
Eu

HTTP/1.1 200 OK
ro

Server: Device/1.0
pe

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


Connection: closed
Te
c

--<boundary>
hn

Content-Type: application/json
ic

Content-Length: <length>
a l

Respons { "token": 123456789,


e "progress": 20
"totalCount": -1
}
--<boundary>
Content-Type: application/json
Content-Length: <length>

{ "token": 123456789,
"progress": 60
"totalCount": -1

AI APIs 245
}
--<boundary>
Content-Type: application/json
Content-Length: <length>

{ "token": 123456789,
"progress": 100
"totalCount": 350
}
--<boundary>--
 Get the find result

Table 16-29
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindByPic
Da

Method GET
hu

Get the find result, reply using multipart format, first part is json string to describe all
a

Descripti candidate person, then the following parts are the person's pictures, refer by UID and
HT

on GroupID in part header Content-Info.


TP

Note: the returned token will be expired after 60 seconds without any doFind call.
[ Request Params ] ( key=value format in URL )
AP

Name Type R/O Param Description


I

Token for this search, use this token to get result and stop
token uint R
fo

search.
r

The index in search result, should between 0 and totalCount


index uint R
–1.
We

count uint R Number of result person to get.


st

[ Response Params ] ( JSON format )


Eu

Name Type R/O Param Description


Found int R Number of result person that return.
ro

Candidates Array<object> R Candidates Person.


pe

+Person object R Person Info.


Te

++UID string R System id for this Person, max string length is 31.
The identity of the Face Group that this Person in. max string
c

++GroupID string R
hn

length is 63.
ic

++Name string R Person Name, max string length is 63.


a

++Birthday string O Birthday ex: "1980-01-01".


l

++Sex string O Sex, it can be "Male", "Female", "Unknown".


Country name, length must be 2, value should be according
++Country string O
to ISO3166.
++Province string O Province name, max string length is 63.
++City string O City name, max string length is 63.
++CertificateTy Certificate Type. It can be "IC', "Passport", "Military" or
string O
pe "Unknown".
++ID string O Person ID of CertificateType, max string length is 31.
++FeatureState int O Feature State, 0:Unknown, 1:Failed, 2:OK.
+Similarity int R Similarity.
[ Example ]

AI APIs 246
GET
Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindByPic&token=12345678
9&index=0&count=10
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

--<boundary>
Content-Type: application/json
Content-Length: <length>

{ "Found" : 10,
Da

"Candidates" : [
hu

{
"person" : {
a

"UID" : "0001",
HT

"GroupID" : "001",
TP

"Name" : "ZhangSan",
"Birthday" : "1980-01-05",
AP

"Sex" : "Male",
I

...
fo

},
r

"Similarity" : 85
We

},
Response
{
st

"person" : {
Eu

"UID" : "0002",
ro

"GroupID" : "002",
"Name" : "LiSi",
pe

"Birthday" : "1980-01-06",
Te

"Sex" : "Male",
...
c hn

},
ic

"Similarity" : 80
},
a l

{ ... }, ...
]
}
--<boundary>
Content-Info: UID=0001&GroupID=001
Content-Type: image/jpeg
Content-Length: <length>

< jpeg image data ... >


--<boundary>
Content-Info: UID=0002&GroupID=002

AI APIs 247
Content-Type: image/jpeg
Content-Length: <length>

< jpeg image data ... >


--<boundary>
...
 Stop finding

Table 16-30
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindByPic
Method GET
Descripti
Stop the search session.
on
[ Request Params ] ( key=value format in URL )
Da

Name Type R/O Param Description


hu

Token for this search, use this token to get result and stop
a

token uint R
search.
HT

[ Response Params ] ( OK )
TP

[ Example ]
GET
AP

Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindByPic&token=12345678
I

9
fo

Response OK
r
We

16.1.2.14 Find History Person by Picture


st

 Start to find
Eu

Table 16-31
ro

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindHistoryByPic
pe

Method POST
Start to find person in capture history by picture. The search may last for some time, so
Te

the response may push at regular intervals until 100% Progress.


c

Description Note: If you want to find person in capture history by person info, please refer to
hn

"mediaFileFind"API.
ic

Note: the returned token will be expired after 60 seconds without any doFind call.
a

[ Request Params ] ( key=value format in URL )


l

Name Type R/O Param Description


Channel int R Video channel index which starts from 0.
StartTime string R Start time to search, ex: 2018-01-13T00:00:00Z.
EndTime string R End time to search, ex: 2018-01-14T00:00:00Z.
Similarity int R Similarity percent, 1 — 100.
MaxCandidate int O Max Candidate result number.
[ Response Params ] ( JSON format )
Name Type R/O Param Description
Token for this search, use this token to get result and stop
token uint R
search.

AI APIs 248
progress uint R Search Progress, 100 means finished.
totalCount int R Result num, return -1 means still searching.
[ Example ]
POST
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindHistoryByPic&Channe
l=0&StartTime=2018-01-13T00:00:00Z&EndTime=2018-01-14T00:00:00Z&Type=All&Si
milarity=80&MaxCandidate=500
Request
Content-Type: image/jpeg
Content-Length: <image size>

<JPEG data>
HTTP/1.1 200 OK
Server: Device/1.0
Da

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


hu

Connection: closed
a

--<boundary>
HT

Content-Type: application/json
TP

Content-Length: <length>
AP

{ "token": 123456789,
I

"progress": 20
fo

"totalCount": -1
r

}
We

--<boundary>
st

Content-Type: application/json
Response
Content-Length: <length>
Eu
ro

{ "token": 123456789,
"progress": 60
pe

"totalCount": -1
Te

}
--<boundary>
c hn

Content-Type: application/json
ic

Content-Length: <length>
a l

{ "token": 123456789,
"progress": 100
"totalCount": 350
}
--<boundary>--
 Get find result

Table 16-32
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindHistoryByPic
Method GET
Descripti Get the find result, reply by multipart, first part is json string to describe all candidate person,

AI APIs 249
on then the following part is the person's picture, refer by UID in part header Content-Info.
Note: the returned token will be expired after 60 seconds without any doFind call.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Token for this search, use this token to get result and stop
token uint R
search.
The index in search result, should between 0 and totalCount
index uint R
–1.
count uint R Number of result person to get, start from Index.
[ Response Params ] ( JSON format )
Name Type R/O Param Description
Found int R Number of result person that return.
Candidates Array<object> R Candidates Person.
Da

+Person object R Person Info.


hu

++UID string R System id for this Person, max string length is 63.
a

++Sex string O Sex. It can be "Male", "Female" or "Unknown".


HT

++Age int O Age.


TP

++Glasses int O Glasses Status, 0: all, 1: not wear, 2: wear.


+Similarity int R Similarity.
AP

[ Example ]
I

GET
fo

Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindHistoryByPic&token=12
3456789&index=0&count=12
r

HTTP/1.1 200 OK
We

Server: Device/1.0
st

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


Connection: closed
Eu
ro

--<boundary>
pe

Content-Type: application/json
Content-Length: <length>
Te
c

{ "Found" : 12,
hn

"Candidates" : [
ic

Response {
a

"person" : {
l

"UID" : "0001",
"Sex" : "Male",
"Age" : 30,
"Glasses": 1
},
"Similarity" : 85
},
{
"person" : {
"UID" : "0002",

AI APIs 250
"Sex" : "Male",
"Age" : 50,
"Glasses": 2
},
"Similarity" : 80
},
{ ... }, ...
]
}
--<boundary>
Content-Info: UID=0001
Content-Type: image/jpeg
Content-Length: <length>
Da
hu

< jpeg image data ... >


--<boundary>
a

Content-Info: UID=0002
HT

Content-Type: image/jpeg
TP

Content-Length: <length>
AP

< jpeg image data ... >


I

--<boundary>
fo

...
r

 Stop finding
We

Table 16-33
st

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindHistoryByPic
Method GET
Eu

Descripti
ro

Stop finding.
on
pe

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
Te

Token for this search, use this token to get result and stop
c

token uint R
hn

searching.
[ Response Params ] ( OK )
ic

[ Example ]
a l

GET
Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindHistoryByPic&token=1
23456789
Response OK

16.1.2.15 [Event] FaceDetection

Table 16-34
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
When the video channel disposition with some face group, and the video channel detect
Description
a face, send this event.

AI APIs 251
[ Event Params ] ( JSON format )
Name Type R/O Param Description
Faces Array<object> R The detected faces info.
The detected face bounding box, 4 interge, refer to x's value
of left—top point, y's value of left—top point, x's value of right
+BoundingBox Array<int> R
—bottom point, y's value of right—bottom point. Coordinate
remap to 0 — 8192.
+Sex string O Sex, it can be "Man", "Woman".
+Age int O Age.
+Feature array<string> O Face feature, can be some of the following: "WearGlasses",
"SunGlasses", "NoGlasses", "Smile", "Anger", "Sadness",
"Disgust", "Fear", "Surprise", "Neutral", "Laugh", "Happy",
"Confused", "Scream".
Da

+Eye int O Eye status, 0: not detected, 1: close eye, 2: open eye.
hu

+Mouth int O Mouth status, 0: not detected, 1: close mouth, 2: open mouth.
a

+Mask int O Mask status, 0: not detected, 1: not wearing mask, 2: wearing
HT

mask.
+Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard.
TP

[ Example ]
AP

--<boundary>
I

Content-Type: text/plain
Content-Length: <length>
fo
r

Code=FaceDetection;action=Start;index=0;data={
We

"Faces": [ { "BoundingBox": [2992,136,6960,8192],


st

"Sex": "Man",
"Age": 40,
Eu

Event
"Feature": [ "WearGlasses", "Smile"],
ro

"Eye": 2,
pe

"Mouth": 1,
"Mask": 1,
Te

"Beard": 2
c

}, {…}, … ]
hn

}
ic

--<boundary>
a l

16.1.2.16 [Event] FaceRecognition

Table 16-35
Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event
When the video channel disposition with some face group, and the video channel detect
Description
a face, after recognize in the face groups, send this event.
[ Event Params ] ( key=value format )
Name Type R/O Param Description
Events array<object> R Event info array.
+EventBaseInf object R Base info of event.

AI APIs 252
o
++Code String R Event Code. It should be FaceRecognition.
++Action String R Event Action. It can be "Start", "Stop" or "Pulse".
++Index int O The channel index relate to this event, start from 0.
+UID String R The identity of the Person, max string length is 31.
+Candidates array<object> O The Candidates person list.
++Person object O The information of candidate person.
+++UID string R The identity of the Person, max string length is 31.
The identity of the Face Group that this Person in. max string
+++GroupID string R
length is 63.
+++Name string O Person Name, max string length is 63.
+++Birthday string O Birthday ex: "1980-01-01".
+++Sex string O Sex, it can be "Male", "Female", "Unknown".
Da

Country name. The length must be 2, and value should be


hu

+++Country string O
according to ISO3166.
a

+++Province string O Province name, max string length is 63.


HT

+++City string O City name, max string length is 63.


TP

+++CertificateT Certificate Type. It can be: "IC', "Passport", "Military",


string O
ype "Unknown".
AP

+++ID string O Person ID of CertificateType, max string length is 31.


I

Similarity of the Candidates person and the detected person,


++Similarity int O
value between 1 — 100.
fo

+Face object O The attribute information of face.


r

++Sex string O Sex, it can be "Man", "Woman".


We

++Age int O Age.


st

Face feature, can be some of the following : "WearGlasses",


"SunGlasses", "NoGlasses", "Smile", "Anger", "Sadness",
Eu

++Feature array<string> O
"Disgust", "Fear", "Surprise", "Neutral", "Laugh", "Happy",
ro

"Confused", "Scream".
pe

++Eye int O Eye status, 0: not detected, 1: close eye, 2: open eye.
++Mouth int O Mouth status, 0: not detected, 1: close mouth, 2: open mouth.
Te

Mask status, 0: not detected, 1: not wearing mask, 2: wearing


c

++Mask int O
hn

mask.
++Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard.
ic

[ Example ]
a l

--<boundary>
Content-Type: text/plain
Content-Length: <length>

Events[0].EventBaseInfo .Code=FaceRecognition
Event Events[0].EventBaseInfo .Action=Pulse
Events[0].EventBaseInfo .Index=0
Events[0].UID=00105
Events[0].Candidates[0].Person.UID=0012
Events[0].Candidates[0].Person.GroupID=10000
Events[0].Candidates[0].Person.Name=ZhangSan

AI APIs 253
Events[0].Candidates[0].Person.Birthday=1980-01-02
Events[0].Candidates[0].Person.Sex=Male

Events[0].Candidates[0].Similarity=80
Events[0].Candidates[1].Person.UID=0014
Events[0].Candidates[1].Person.GroupID=10000
Events[0].Candidates[1].Person.Name=Lisi
Events[0].Candidates[1].Person.Birthday=1980-01-05
Events[0].Candidates[1].Person.Sex=Male

Events[0].Candidates[1].Similarity=75

Events[0].Face.Sex=Man
Da

Events[0].Face.Age=20
hu

Events[0].Face.Feature[0]=SunGlasses
Events[0].Face.Feature[1]=Smile
a

Events[0].Face.Eye=2
HT

Events[0].Face.Mouth=1
TP

Events[0].Face.Mask=1
Events[0].Face.Beard=2
AP

--<boundary>
I

Content-Type: image/jpeg
fo

Content-Length: <image size>


r
We

<Jpeg image data>


--<boundary>
st
Eu

16.1.2.17 [Event] FaceFeatureAbstract


ro
pe

Table 16-36
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
Te

When Re-Abstract Feature By Group or By Person, the abstract progress detail will send
Description
c

in this event.
hn

[ Event Params ] ( JSON format )


ic

Name Type R/O Param Description


a l

Infos Array<object> R Abstrace detail Info, max size is 100.


Abstract state, it can be :
 "Success" : Abstract success,
+State String R
 "False" : Failed to abstract;
 "Process" : In Process;
+Process int O The abstract progress.
+UID string O The identity of the person, max string length is 31.
+GroupID string O The identity of the face group, max string length is 63.
[ Example ]

AI APIs 254
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Code=FaceFeatureAbstract;action=Start;index=0;data={
"Infos": [ { "State": "Progress",
Event
"Progress": 30,
"UID": "20005",
"GroupID": "10000"
}, {…}, … ]
}
--<boundary>
Da

16.1.3 Video Analyse Event


hu
a

16.1.3.1 [Event] LeftDetection


HT
TP

Table 16-37
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
AP

Description When detect some object left, send this event.


I

[ Event Params ] ( JSON format )


fo

Name Type R/O Param Description


r

Object object R The object that left.


We

The detected object bounding box, 4 interge, refer to x's value


st

of left—top point, y's value of left—top point, x's value of right—


+BoundingBox Array<int> R
bottom point, y's value of right — bottom point. Coordinate
Eu

remap to 0 — 8192.
ro

[ Example ]
pe

--<boundary>
Content-Type: text/plain
Te

Content-Length: <length>
c hn

Event
Code=LeftDetection;action=pulse;index=0;data={
ic

"Object": { "BoundingBox": [2992,1136,4960,5192] }


a

}
l

--<boundary>

16.1.3.2 [Event] TakenAwayDetection

Table 16-38
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
Description When detect some object was taken away, send this event.
[ Event Params ] ( JSON format )
Name Type R/O Param Description
Object object R The object that was taken away.

AI APIs 255
The detected object bounding box, 4 interge, refer to x's value
of left—top point, y's value of left—top point, x's value of right—
+BoundingBox Array<int> R
bottom point, y's value of right — bottom point. Coordinate
remap to 0 — 8192.
[ Example ]
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Event
Code=TakenAwayDetection;action=pulse;index=0;data={
"Object": { "BoundingBox": [2992,1136,4960,5192] }
}
--<boundary>
Da
hu

16.1.3.3 [Event] WanderDetection


a
HT

Table 16-39
TP

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


Description When detect some object was wandering, send this event
AP

[ Event Params ] ( JSON format )


I

Name Type R/O Param Description


fo

Objects Array<object> R The objects that was wandering.


r

The detected object bounding box, 4 interge, refer to x's value


of left—top point, y's value of left—top point, x's value of right
We

+BoundingBox Array<int> R
—bottom point, y's value of right—bottom point. Coordinate
st

remap to 0 — 8192.
The object wandering tracks, array of polyline, one polyline
Eu

Array<Array<
Tracks O for one object, polyline is array of points, point is array of two
ro

Array<int>>>
int, x's value and y's value. Coordinate remap to 0 — 8192.
pe

[ Example ]
--<boundary>
Te

Content-Type: text/plain
c hn

Content-Length: <length>
ic

Code=WanderDetection;action=start;index=0;data={
a l

"Objects": [ { "BoundingBox": [2992,1136,4960,5192] },


Event { "BoundingBox": [4392,4136,6960,6512] },
{…}, … ],
"Tracks": [ [ [1202, 576], [1456, 863], [1921, 1204], [2341, 1823], [3512, 2314] ],
[ [2214, 3412], [3153, 3674], [4512, 4213] ],
[…], … ]
}
--<boundary>

AI APIs 256
16.1.3.4 [Event] StayDetection

Table 16-40
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
Description When detect some object was stay, send this event
[ Event Params ] ( JSON format )
Name Type R/O Param Description
Object object O The object that was stay.
The detected object bounding box, 4 interge, refer to x's value
of left—top point, y's value of left—top point, x's value of right
+BoundingBox Array<int> O
—bottom point, y's value of right—bottom point. Coordinate
remap to 0 — 8192.
Da

Objects array<object> O If detect several object, store in this array.


The detected object bounding box, 4 interge, refer to x's value
hu

of left—top point, y's value of left—top point, x's value of right


a

+BoundingBox Array<int> O
—bottom point, y's value of right—bottom point. Coordinate
HT

remap to 0 — 8192.
TP

[ Example ]
--<boundary>
AP

Content-Type: text/plain
I

Content-Length: <length>
fo
r

Code=StayDetection;action=start;index=0;data={
Event "Object": { "BoundingBox": [2992,1136,4960,5192] },
We

"Objects": [ { "BoundingBox": [2992,1136,4960,5192] },


st

{ "BoundingBox": [4392,4136,6960,6512] },
{…}, … ]
Eu

}
ro

--<boundary>
pe
Te

16.1.3.5 [Event] HumanTrait


c hn

Table 16-41
ic

Usage Refer to "4.4.3 Subscribe to Snapshot "for how to subscribe event


a

Description When detect a human trait, send this event.


l

[ Event Params ] ( key=value format )


Name Type R/O Param Description
Events array<object> O Event info array.
+EventBaseInfo object R Base info of event.
++Code String R Event Code. It should be HumanTrait.
++Action String R Event Action. It can be: "Start", "Stop", "Pulse".
++Index int O The channel index relate to this event, start from 0.
+HumanAttribute
object O The human attributes.
s

AI APIs 257
The detected human bounding box, 4 interge, refer to x's
value of left-top point, y's value of left-top point, x's value of
++BoundingBox Array<int> O
right-bottom point, y's value of right-bottom point.
Coordinate remap to 0 — 8192.
++Sex string O Sex, can be "Man", "Woman", "Unknown".
++Age int O Age.
++Angle int O Angle, 0: unknown, 1: front, 2: side, 3: back.
Coat color, can be: "White", "Orange", "Pink", "Black",
"Red", "Yellow", "Gray", "Blue", "Green", "Purple", "Brown",
"Sliver", "Darkviolet", "Maroon", "Dimgray", "Whitesmoke",
++CoatColor string O "Darkorange", "Mistyrose", "Tomato", "Olive", "Gold",
"Darkolivegreen", "Chartreuse", "Greenyellow",
"Forestgreen", "Seagreen", "Chartreuse", "Deepskyblue",
Da

"Cyan", "Other".
hu

++CoatType int O Coat type, 0: unknown, 1: long sleeve, 2: short sleeve.


a

++TrousersColor string O Trousers color, value can be that of CoatColor.


HT

Trousers type, 0: unknown, 1: long pants, 2: short pants, 3:


++TrousersType int O
skirt.
TP

++HasHat int O Has hat or not, 0: unknown, 1: not has hat, 2: has hat.
AP

++HasBag int O Has bag or not, 0: unknown, 1: not has bag, 2: has bag.
Has umbrella or not, 0: unknown, 1: not has umbrella, 2: has
I

++HasUmbrella int O
umbrella.
fo

Bag type, 0: unknown, 1: handbag, 2: shoulder bag, 3:


r

++Bag int O
knapsack, 4: draw-bar box.
We

Upper clothes pattern, 0: unknown, 1: pure color, 2: stripe,


++UpperPattern int O
st

3: pattern, 4: gap, 5: grid.


Hair style, 0: unknown, 1: long hair, 2: short hair, 3: ponytail,
Eu

++HairStyle int O
4: updo, 5: hiddened.
ro

++Cap int O Cap style, 0: unknown, 1: normal cap, 2: helmet.


pe

+FaceAttributes object O If the human's face can be detected, find it's attributes.
The detected face bounding box, 4 interge, refer to x's value
Te

of left-top point, y's value of left-top point, x's value of


++BoundingBox Array<int> O
c

right-bottom point, y's value of right-bottom point.


hn

Coordinate remap to 0 — 8192.


ic

++Sex string O Sex, it can be "Man", "Woman", "Unknown".


a

++Age int O Age.


l

Face feature, can be some of the following : "WearGlasses",


"SunGlasses", "NoGlasses", "Smile", "Anger", "Sadness",
++Feature array<string> O
"Disgust", "Fear", "Surprise", "Neutral", "Laugh", "Happy",
"Confused", "Scream".
++Eye int O Eye status, 0: not detected, 1: close eye, 2: open eye.
Mouth status, 0: not detected, 1: close mouth, 2: open
++Mouth int O
mouth.
Mask status, 0: not detected, 1: not wearing mask, 2:
++Mask int O
wearing mask.
++Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard.

AI APIs 258
Glasses status, 0: unknown, 1: not wearing, 2: normal
++Glass Int O
Glasses, 3: sun glasses, 4: black frame glasses.
[ Example ]
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Events[0].EventBaseInfo .Code=HumanTrait
Events[0].EventBaseInfo .Action=Pulse
Events[0].EventBaseInfo .Index=0
Events[0].HumanAttributes.BoundingBox[0]=1341
Events[0].HumanAttributes.BoundingBox[1]=2451
Events[0].HumanAttributes.BoundingBox[2]=4513
Da

Events[0].HumanAttributes.BoundingBox[3]=4135
hu

Events[0].HumanAttributes.Sex=Man
a

Events[0].HumanAttributes.Age=30
Events[0].HumanAttributes.CoatColor=White
HT

Events[0].HumanAttributes.CoatType=1
TP

Events[0].HumanAttributes.TrousersColor=Black
Events[0].HumanAttributes.TrousersType=1
AP

Event Events[0].HumanAttributes.HasHat=1
I

Events[0].HumanAttributes.HasBag=2
fo

Events[0].FaceAttributes.BoundingBox[0]=1341
r

Events[0].FaceAttributes.BoundingBox[1]=2451
We

Events[0].FaceAttributes.BoundingBox[2]=4513
st

Events[0].FaceAttributes.BoundingBox[3]=4135
Events[0].FaceAttributes.Sex=Man
Eu

Events[0].FaceAttributes.Age=30
ro

Events[0].FaceAttributes.Feature[0]=Smile
Events[0].FaceAttributes.Eye=2
pe

Events[0].FaceAttributes.Mouth=1
Te

Events[0].FaceAttributes.Glass=1
--<boundary>
c hn

Content-Type: image/jpeg
ic

Content-Length: <image size>


a l

<Jpeg image data>


--<boundary>

16.1.3.6 [Event] CrossLineDetection

Table 16-42
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
Description When detect some object cross the line, send this event.
[ Event Params ] ( JSON format )
Name Type R/O Param Description

AI APIs 259
Object object R The object that cross the line.
The detected object bounding box, 4 interge, refer to x's value
of left—top point, y's value of left—top point, x's value of right
+BoundingBox Array<int> R
—bottom point, y's value of right-bottom point. Coordinate
remap to 0 — 8192.
Objects array<object> O If detect several object, store in this array.
The detected object bounding box, 4 interge, refer to x's value
of left—top point, y's value of left—top point, x's value of right
+BoundingBox Array<int> R
—bottom point, y's value of right-bottom point. Coordinate
remap to 0 — 8192.
[ Example ]
--<boundary>
Content-Type: text/plain
Da

Content-Length: <length>
hu

Event
a

Code=CrossLineDetection;action=pulse;index=0;data={
"Object": { "BoundingBox": [2992,1136,4960,5192] }
HT

}
TP

--<boundary>
AP
I

16.1.3.7 [Event] CrossRegionDetection


fo

Table 16-43
r

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


We

Description When detect some object cross the region, send this event
st

[ Event Params ] ( JSON format )


R/
Eu

Name Type Param Description


O
ro

Object object R The object that cross the region.


pe

The detected object bounding box, 4 interge, refer to x's value


of left—top point, y's value of left-top point, x's value of right
Te

+BoundingBox Array<int> R
—bottom point, y's value of right-bottom point. Coordinate
c hn

remap to 0 — 8192.
ic

Objects array<object> O If detect several object, store in this array.


The detected object bounding box, 4 interge, refer to x's value
a l

of left—top point, y's value of left—top point, x's value of right


+BoundingBox Array<int> R
—bottom point, y's value of right-bottom point. Coordinate
remap to 0 — 8192.
[ Example ]

AI APIs 260
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Event
Code=CrossRegionDetection;action=pulse;index=0;data={
"Object": { "BoundingBox": [2992,1136,4960,5192] }
}
--<boundary>

16.2 Intelligent Traffic APIs

16.2.1 Traffic Record


Da
hu

16.2.1.1 Insert Traffic BlackList/RedList Record


a
HT

Table 16-44
TP

URL http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=<RecordName>
Method GET
AP

Description Insert traffic BlackList/Red record.


I

[ Request Params ] ( key=value format in URL )


fo

Name Type R/O Param Description


r

The record table name, "TrafficBlackList"for BlackList and


name string R
"TrafficRedList"for RedList.
We

The number of car plate, max string length is 31. It must be


st

PlateNumber string R
unique.
MasterOfCar string O The car owner, max string length is 15
Eu

PlateColor string O Plate color, max string length is 31, ex: "Yellow", "Blue", … etc.
ro

PlateType string O Plate type, max string length is 31.


pe

VehicleType string O Vehicle type, max string length is 31.


Vehicle color, max string length is 31. ex: "Yellow", "Blue", …
Te

VehicleColor string O
etc.
c hn

BeginTime string O Begin time, ex: "2010-05-25 00:00:00".


ic

CancelTime string O Cancel time, ex: "2010-06-25 00:00:00".


[ Response Params ] (key=value format)
a l

Name Type R/O Param Description


The new record’s id, return -1 if the device handles
RecNo int R
asynchronously.
[ Example ]
GET
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=TrafficBlackList&Pla
Request
teNumber=AC00001&MasterOfCar=ZhangSan&PlateColor=Yellow&VehicleColor=Blue&
BeginTime=2011-01-01%2012:00:00&CancelTime=2011-01-10%2012:00:00
Response RecNo=12345

AI APIs 261
16.2.1.2 Update Traffic BlackList/RedList Record

Table 16-45
URL http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=<RecordName>
Method GET
Update Traffic BlackList/Red record.
Descripti
Note: Besides action, name, recno, there should be at least one more parameter to be
on
updated.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
The record table name, "TrafficBlackList" for BlackList and
name string R
"TrafficRedList"for RedList.
Da

recno int R record id


The number of car plate, max string length is 31. It must be
hu

PlateNumber string R
unique.
a

MasterOfCar string O The car owner, max string length is 15


HT

…<See above insert command for other params of the record.


…<other param> - -
TP

They are all optional.>


[ Response Params ] ( OK )
AP

[ Example ]
I

GET
fo

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=update&name=TrafficBlackList&re
r

Request cno=12345&PlateNumber=AC00001&MasterOfCar=ZhangSan&PlateColor=Yellow&Vehi
We

cleColor=Blue&BeginTime=2011-01-01%2012:00:00&CancelTime=2011-01-10%2012:00
:00
st

Response OK
Eu
ro

16.2.1.3 Remove Traffic BlackList/RedList Record


pe

Table 16-46
Te

URL http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=<RecordName>
c

Method GET
hn

Descripti
ic

Remove Traffic BlackList/Red record.


on
a

[ Request Params ] ( key=value format in URL )


l

Name Type R/O Param Description


The record table name, "TrafficBlackList"for BlackList and
name string R
"TrafficRedList"for RedList.
recno int R The record id.
[ Response Params ] ( OK )
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=remove&name=TrafficBlackList&r
ecno=12345
Response OK

AI APIs 262
16.2.1.4 Find Traffic BlackList/RedList Record

Table 16-47
URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=<RecordName>
Method GET
Description Find Traffic BlackList/RedList record.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
The record table name, "TrafficBlackList"for BlackList and
name string R
"TrafficRedList"for RedList.
count int O Max result to return, default is 1024.
StartTime string O The start of the record's CreateTime.
Da

EndTime string O The end of the record's CreateTime.


condition object O Search condition.
hu

+PlateNumber string O Car plate number, max string length is 47.


a

+PlateNumberV Car plate number substring, match any car plate number that
HT

string O
ague contain this substring, max string length is 47.
TP

+PlateNumberV array<string
O Car plate number substring array, max string length is 47.
agueGroup >
AP

+QueryCount int O Query count, default is 1000.


I

+QueryResultBe
int O Begin number in the result set, default is 0.
fo

gin
r

[ Response Params ] (key=value format)


We

Name Type R/O Param Description


totalCount int O Total record num that find.
st

found int O Record num that returned.


Eu

array<object
records R The records that returned.
ro

>
+RecNo int R Record id.
pe

+CreateTime int R The create time of record.


Te

+PlateNumber string R Car plate number.


c

+MasterOfCar string O Car owner.


hn

+…<other …<see above insert command for other params of the


- -
ic

param> record>
a

[ Example ]
l

GET
Request http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=TrafficBlackList&condition.
PlateNumber=AC00001&StartTime=123456700&EndTime=123456800&count=100
totalCount=1000
found=100
records[0].RecNo=12345
Respons records[0].CreateTime=123456789
e records[0].PlateNumber=AC00001
records[0].MasterOfCar=ZhangSan

records[1].RecNo=13579

AI APIs 263
records[1].CreateTime=123456799
records[1].PlateNumber=AC00001
records[1].MasterOfCar=LiSi

16.2.2 Intelligent Traffic Event

16.2.2.1 [Event] TrafficJunction

Table 16-48
Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event
Description When detects vehicle passing, send this event.
Da

[ Event Params ] ( key=value format )


hu

Name Type R/O Param Description


a

Events array<object> R Event info array.


HT

+EventBaseInfo object R Base info of event.


++Code String R Event Code. It should be TrafficJunction.
TP

++Action String R Event Action. It can be "Start", "Stop" or "Pulse".


AP

++Index int O The channel index relate to this event.


I

+GroupID int O The id of event group.


+CountInGroup int O Event count in the event group.
fo

+IndexInGroup int O The index of this event in the event group, start from 1.
r

+Lane int O Lane number, start from 0.


We

Trigger type. It can be: 0—car detector, 1—radar, 2—


+TriggerType int O
st

video.
+Speed int O Vehicle speed, unit is km/hour.
Eu

+Vehicle Object O The information of vehicle object.


ro

The detected car bounding box, 4 interge, refer to x's


pe

value of left-top point, y's value of left-top point, x's value of


++BoundingBox Array<int> R
right-bottom point, y's value of right-bottom point.
Te

Coordinate remap to 0 — 8192.


c

++Text string O Vehicle logo.


hn

++SubText string O Vehicle sub logo.


ic

++SubBrand int O Vehicle sub brand index.


a l

++BrandYear int O Vehicle brand year index.


+TrafficCar object O Traffic Car info.
++RecNo int R The record id.
++PlateNumber string R Car plate number.
++PlateType string O Plate type.
++PlateColor string O Plate color, ex: "Yellow", "Blue", … etc.
++VehicleColor string O Vehicle color, ex: "Yellow", "Blue", … etc.
The detected plate bounding box, 4 interge, refer to x's
value of left-top point, y's value of left-top point, x's value of
++BoundingBox Array<int> R
right-bottom point, y's value of right-bottom point.
Coordinate remap to 0 — 8192.

AI APIs 264
++Country string O Country info. Max string length is 19.
++Speed int O Vehicle speed, unit is km/hour.
++Event string O The event info, ex: "TrafficJunction".
+CommInfo object O Traffic event common info.
++Seat array<object> O Vehicle front seat info.
+++Type string O Front seat type. It can be: "Main""Slave".
Some driver status. It can be some of the following:
+++Status array<string> O
"Smoking", "Calling".
Sunshade status. It can be: "Unknow", "WithSunShade",
+++SunShade string O
"WithoutSunShade".
The detected sun shade bounding box, 4 interge, refer to
x's value of left-top point, y's value of left-top point, x's
+++ShadePos Array<int> O
value of right-bottom point, y's value of right-bottom point.
Da

Coordinate remap to 0 — 8192.


hu

SafeBelt status. It can be: "Unknow", "WithSafeBelt",


+++SafeBelt string O
a

"WithoutSafeBelt".
HT

[ Example ]
--<boundary>
TP

Content-Type: text/plain
AP

Content-Length: <length>
I

Events[0].EventBaseInfo.Code=TrafficJunction
fo

Events[0].EventBaseInfo.Action=Pulse
r

Events[0].EventBaseInfo.Index=0
We

Events[0].GroupID=123
st

Events[0].CountInGroup=3
Events[0].IndexInGroup=1
Eu

Events[0].Lane=0
ro

Events[0].Vehicle.BoundingBox[0]=1341
pe

Events[0].Vehicle.BoundingBox[1]=2451
Events[0].Vehicle.BoundingBox[2]=4513
Te

Events[0].Vehicle.BoundingBox[3]=4135
Event
c

Events[0].Vehicle.Text=Audi
hn

Events[0].Vehicle.SubText=A6L
ic

Events[0].Vehicle.SubBrand=5
a

Events[0].Vehicle.BrandYear=2
l

Events[0].TrafficCar.RecNo=123
Events[0].TrafficCar.PlateNumber=AC00003
Events[0].TrafficCar.PlateColor=Yellow
Events[0].TrafficCar.VehicleColor=Blue
Events[0].TrafficCar.BoundingBox[0]=1341
Events[0].TrafficCar.BoundingBox[1]=2451
Events[0].TrafficCar.BoundingBox[2]=4513
Events[0].TrafficCar.BoundingBox[3]=4135
Events[0].TrafficCar.Country=China
Events[0].CommInfo.Seat[0].Type=Main
Events[0].CommInfo.Seat[0].Status[0]=Smoking

AI APIs 265
Events[0].CommInfo.Seat[0].SunShade=WithSunShade
Events[0].CommInfo.Seat[0].ShadePos[0]=2021
Events[0].CommInfo.Seat[0].ShadePos[1]=3041
Events[0].CommInfo.Seat[0].ShadePos[2]=2151
Events[0].CommInfo.Seat[0].ShadePos[3]=3661
Events[0].CommInfo.Seat[0].SafeBelt=WithoutSafeBelt

--<boundary>
Content-Type: image/jpeg
Content-Length: <image size>

<Jpeg image data>


--<boundary>
Da
hu

16.2.2.2 [Event] TrafficRetrograde


a
HT

When detects vehicle retrograde, send this event.


TP

Event params is the same as TrafficJunction, except for event Code is TrafficRetrograde.
AP

16.2.2.3 [Event] TrafficJam


I
fo

Table 16-49
r

Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event


We

Description When detects traffic jam, send this event.


[ Event Params ] ( key=value format )
st

Name Type R/O Param Description


Eu

Events array<object> R Event info array.


ro

+EventBaseInfo object R Base info of event.


++Code String R Event Code. It should be TrafficJam.
pe

++Action String R Event Action. It can be "Start", "Stop" or "Pulse".


Te

++Index int O The channel index relate to this event.


c

+GroupID int O The id of event group.


hn

+CountInGroup int O Event count in the event group.


ic

+IndexInGroup int O The index of this event in the event group, start from 1.
a

+Lane int O Lane number, start from 0.


l

+StartJaming int O Start jam time, UTC seconds.


+AlarmInterval int O Alarm interval, unit is second.
+JamLenght int O Jam length, percentage of the lane.
+JamRealLengt
int O Jam real length, unit is metre.
h
[ Example ]
--<boundary>
Content-Type: text/plain
Event Content-Length: <length>

Events[0].EventBaseInfo.Code=TrafficJam

AI APIs 266
Events[0].EventBaseInfo.Action=Pulse
Events[0].EventBaseInfo.Index=0
Events[0].GroupID=123
Events[0].CountInGroup=3
Events[0].IndexInGroup=1
Events[0].Lane=0
Events[0].StartJaming=123456789
Events[0].AlarmInterval=180
Events[0].JamLenght=70
Events[0].JamRealLength=120

--<boundary>
Content-Type: image/jpeg
Da

Content-Length: <image size>


hu

<Jpeg image data>


a

--<boundary>
HT
TP

16.2.2.4 [Event] TrafficUnderSpeed


AP

When detects vehicle under speed, send this event.


I

Event params is the same as TrafficJunction, except for event Code is TrafficUnderSpeed,
fo

and add following params:


r
We

Table 16-50
[ Extra Event Params ] ( key=value format )
st

Name Type R/O Param Description


Eu

+SpeedLimit array<int> O Speed limit, 2 integer, min speed and max speed.
ro

+UnderSpeeding
int O Percentage of under speed.
Percentage
pe
Te

16.2.2.5 [Event] TrafficOverSpeed


chn

When detects vehicle over speed, send this event.


ic

Event params is the same as TrafficJunction, except for event Code is TrafficOverSpeed, and add
a

following params:
l

Table 16-51
[ Extra Event Params ] ( key=value format )
Name Type R/O Param Description
+SpeedLimit array<int> O Speed limit, 2 integer, min speed and max speed.
+SpeedingPerce
int O Percentage of over speed.
ntage

16.2.2.6 [Event] TrafficPedestrain

Table 16-52

AI APIs 267
Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event
Description When detects human in the lane, send this event
[ Event Params ] ( key=value format )
Name Type R/O Param Description
Events array<object> R Event info array.
+EventBaseInfo object R Base info of event.
++Code String R Event Code. It should be TrafficPedestrain.
++Action String R Event Action. It can be "Start", "Stop" or "Pulse".
++Index int O The channel index relate to this event.
+GroupID int O The id of event group.
+CountInGroup int O Event count in the event group.
+IndexInGroup int O The index of this event in the event group, start from 1.
+Lane int O Lane number, start from 0.
Da

+Vehicle object O Actually this is the human that detected, not vehicle.
hu

++Category string R Must be "Passerby", means this actually is a human.


a

++BoundingBox Array<int> R The detected car bounding box, 4 interge, refer to x's value
HT

of left-top point, y's value of left-top point, x's value of


TP

right-bottom point, y's value of right-bottom point.


Coordinate remap to 0 — 8192.
AP

[ Example ]
I

Event --<boundary>
fo

Content-Type: text/plain
Content-Length: <length>
r
We

Events[0].EventBaseInfo.Code=TrafficPedestrain
st

Events[0].EventBaseInfo.Action=Pulse
Events[0].EventBaseInfo.Index=0
Eu

Events[0].GroupID=123
ro

Events[0].CountInGroup=3
pe

Events[0].IndexInGroup=1
Events[0].Lane=0
Te

Events[0].Vehicle.Category=Passerby
c

Events[0].Vehicle.BoundingBox[0]=1341
hn

Events[0].Vehicle.BoundingBox[1]=2451
ic

Events[0].Vehicle.BoundingBox[2]=4513
a

Events[0].Vehicle.BoundingBox[3]=4135
l


--<boundary>
Content-Type: image/jpeg
Content-Length: <image size>

<Jpeg image data>


--<boundary>

AI APIs 268
16.2.2.7 [Event] TrafficParking
When detects vehicle illegal parking, send this event.
Event params is the same as TrafficJunction, except for event Code is TrafficParking, and
remove param "speed", add following params:

Table 16-53
[ Extra Event Params ] ( key=value format )
Name Type R/O Param Description
+StartParking int O The start time of parking, UTC seconds.
+AlarmInterval int O The alarm interval.
+ParkingAllowed
int O The allowed time of parking.
Time
Da
hu

16.2.3 Traffic Flow


a
HT

16.2.3.1 [Event] TrafficFlowStat


TP

Table 16-54
AP

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


I

Description When traffic flow trigger the rule, send this event
fo

[ Event Params ] ( JSON format )


r

Name Type R/O Param Description


We

FlowStates array<object> R Traffic flow info, each object in list is traffic flow info about
st

one lane.
+Lane int R Lane number, start from 0.
Eu

+Flow int R Traffic flow number.


ro

+Period int R Traffic stat time, unit is minute.


pe

+PeriodByMili int O Traffic stat time, unit is millisecond, value should


between 0 and 59999.
Te

+DrivingDirectio array<string> O Driving direction, should be an array of three strings:


c

n  1st string: direction, can be: "Approach", "Leave"


hn

 2nd string: Approach position name


ic

 3rd string: Leave position name


a

[ Example ]
l

Event --<boundary>
Content-Type: text/plain
Content-Length: xxxx

Code=TrafficFlowStat;action=Pulse;index=0;data={
"FlowStates": [ { "Lane": 0,
"Flow": 50,
"Period": 5,
"DrivingDirection": [ "Approach", "Hangzhou", "Shanghai"]
}, {…}, … ]
}

AI APIs 269
--<boundary>

16.2.3.2 Find Traffic Flow History

Table 16-55
URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=TrafficFlow
Method GET
Description Find traffic flow history record.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
name string R The name of record table. It should be "TrafficFlow".
count int O Max result to return, default is 1024.
Da

StartTime string O The start of the record's CreateTime.


EndTime string O The End of the record's CreateTime.
hu

condition object O Search condition.


a

+Channel int O Video channel index which starts from 0.


HT

+Lane int O Lane index, starts from 0.


TP

[ Response Params ] (key=value format)


Name Type R/O Param Description
AP

totalCount int O Total record num that find.


I

found int O Record num that returned.


fo

records array<object> R The records that returned.


r

+RecNo int R Record id.


We

+CreateTime int R The create time of record.


st

+StatisticsTime int R Traffic flow statistics time, UTC seconds.


+Period string R Statistics period, unit is second.
Eu

+Channel int R Video channel index which starts from 0.


ro

+Lane int R Lane index, starts from 0.


pe

+Vehicles int R Total vehicle num.


+AverageSpeed float O Average speed of the vehicle, -1 means no vehicle, 0
Te

means congestion.
c

[ Example ]
hn

Request GET
ic

http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=TrafficFlow&condition.Cha
a

nnel=0&condition.Lane=0&StartTime=123456700&EndTime=123456800&count=100
l

Respons totalCount=1000
e found=100
records[0].RecNo=12345
records[0].CreateTime=123456789
records[0].StaticsticsTime=123456789
records[0].Period=300
records[0].Channel=0
records[0].Lane=0
records[0].Vehicles=250
records[0].AverageSpeed=25.4

AI APIs 270
records[1].RecNo=13579
records[1].CreateTime=123456799
records[1].StaticsticsTime=123456799
records[1].Period=300
records[1].Channel=0
records[1].Lane=0
records[1].Vehicles=220
records[1].AverageSpeed=21.8

16.3 Access Control APIs

16.3.1 Access User


Da
hu
a

16.3.1.1 Add Access User


HT
TP

Table 16-56
URL http://<server>/cgi-bin/Attendance.cgi?action=addUser
AP

Method GET
I

Description Add an access user.


fo

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
r

UserID string R The user's id.


We

UserName string O The user's name.


st

CardNo string O The user's card number.


Password string O The user's password.
Eu

[ Response Params ] ( OK )
ro

[ Example ]
pe

GET
Request http://<server>/cgi-bin/Attendance.cgi?action=addUser&UserID=102&UserName=Zhang
Te

San&Password=123456
c
hn

Response OK
ic
a

16.3.1.2 Modify Access User


l

Table 16-57
URL http://<server>/cgi-bin/Attendance.cgi?action=modifyUser
Method GET
Modify an access user.
Description
Note: You should provide at lease one optional param to update.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
UserID string R The user's id.
UserName string O The user's name.

AI APIs 271
CardNo string O The user's card number.
Password string O The user's password.
[ Response Params ] ( OK )
[ Example ]
GET
Request http://<server>/cgi-bin/Attendance.cgi?action=modifyUser&UserID=102&UserName=Zhan
gSan&Password=123456
Response OK

16.3.1.3 Delete Access User

Table 16-58
Da

URL http://<server>/cgi-bin/Attendance.cgi?action=deleteUser
Method GET
hu

Description Delete an access user.


a

[ Request Params ] ( key=value format in URL )


HT

Name Type R/O Param Description


TP

UserID string R The user's id.


[ Response Params ] ( OK )
AP

[ Example ]
I

Request GET http://<server>/cgi-bin/Attendance.cgi?action=deleteUser&UserID=102


fo

Response OK
r
We

16.3.1.4 Find Access User


st

 Find access user by UserID


Eu

Table 16-59
ro

URL http://<server>/cgi-bin/Attendance.cgi?action=getUser
pe

Method GET
Description Get an access user's information.
Te

[ Request Params ] ( key=value format in URL )


c

Name Type R/O Param Description


hn

UserID string R The user's id


ic

[ Response Params ] ( JSON format )


a l

Name Type R/O Param Description


UserInfo object R The user's info
+UserID string R The user's id
+UserName string O The user's name
+CardNo string O The user's card number
+Password string O The user's password
[ Example ]
Request GET http://<server>/cgi-bin/Attendance.cgi?action=getUser&UserID=102

AI APIs 272
{ "UserInfo": {
"UserID": 102,
Response "UserName": "ZhangSan",
"Password": "123456"
}
 Find all access user

Table 16-60
URL http://<server>/cgi-bin/Attendance.cgi?action=findUser
Method GET
Description Get all information of access user.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Da

Offset int R The offset of the user record table


Count int R The count of user info record, max is 100.
hu

[ Response Params ] ( JSON format )


a

Name Type R/O Param Description


HT

Total int R Total user num


TP

UserInfo array<object> R The user's info


+UserID string R The user's id
AP

+UserName string O The user's name


I

+CardNo string O The user's card number


fo

+Password string O The user's password


r

[ Example ]
We

Request GET http://<server>/cgi-bin/Attendance.cgi?action=findUser&Offset=0&Count=100


st

{ "Total": 1000,
"UserInfo": [ {
Eu

"UserID": 102,
ro

Response "UserName": "ZhangSan",


"Password": "123456"
pe

}, { … } … ]
Te

}
c hn

16.3.1.5 Add Access User Face


ic
a

Table 16-61
l

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=add
Method POST
Description Add an access user face.
[ Request Params ] ( JSON format in body )
Name Type R/O Param Description
UserID string R The user's id.
Info object R The user's info.
+UserName string O The user's name.
The user's room num list, max array size is 32, max string
+RoomNo array<string> O
size is 12.

AI APIs 273
The user's face feature, encode with base64, max array size
is 20, and max string size is 2k.
+FaceData array<string> O
Note: There must be at least one between FaceData and
PhotoData.
The user's face photo, encode with base64, max array size is
5, and max string size is 200k.
+PhotoData array<string> O
Note: There must be at least one between FaceData and
PhotoData.
[ Response Params ] ( OK )
[ Example ]
POST http://<server>/cgi-bin/FaceInfoManager.cgi?action=add
Content-Type: application/json
Content-Length: <length>
Da
hu

{ "UserID": "102",
a

"Info": {
Request
"UserName": "ZhangSan",
HT

"RoomNo": [ "301", "303", … ],


TP

"FaceData": [ "xxxx", "xxxx", … ],


"PhotoData": [ "yyyy", "yyyy", … ]
AP

}
I

}
fo

Response OK
r
We

16.3.1.6 Modify Access User Face


st

Table 16-62
Eu

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=update
ro

Method POST
pe

Description Update an access user face.


[ Request Params ] ( JSON format in body )
Te

Name Type R/O Param Description


c hn

UserID string R The user's id.


ic

Info object R The user's info.


+UserName string O The user's name.
a l

The user's room num list, max array size is 32, max string
+RoomNo array<string> O
size is 12.
The user's face feature, encode with base64, max array size
is 20, and max string size is 2k.
+FaceData array<string> O
Note: There must be at least one between FaceData and
PhotoData.
The user's face photo, encode with base64, max array size is
5, max string size is 200k.
+PhotoData array<string> O
Note: There must be at least one between FaceData and
PhotoData.
[ Response Params ] ( OK )

AI APIs 274
[ Example ]
POST http://<server>/cgi-bin/FaceInfoManager.cgi?action=update
Content-Type: application/json
Content-Length: <length>

{ "UserID": "102",
"Info": {
Request
"UserName": "ZhangSan",
"RoomNo": ["301", "303", …],
"FaceData": ["xxxx", "xxxx", …],
"PhotoData": ["yyyy", "yyyy", …]
}
}
Da

Response OK
hu
a

16.3.1.7 Delete Access User Face


HT
TP

Table 16-63
URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=remove
AP

Method GET
I

Description Delete an access user face.


fo

[ Request Params ] ( key=value format in URL )


r

Name Type R/O Param Description


UserID string R The user's id.
We

[ Response Params ] ( OK )
st

[ Example ]
Eu

Request GET http://<server>/cgi-bin/FaceInfoManager.cgi?action=remove&UserID=102


Response OK
ro
pe

16.3.1.8 Find Access User Face


Te

 Start to find access user face


c hn

Table 16-64
ic

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=startFind
a

Method GET
l

Descripti
Start to find access user face.
on
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Condition object O Search condition.
+UserID string O The user's id.
[ Response Params ] ( JSON format )
Name Type R/O Param Description
The token of this search, use this token to get result and stop
Token int O
search.

AI APIs 275
Total int O Result num, return 0 if not found.
[ Example ]
Request GET http://<server>/cgi-bin/FaceInfoManager.cgi?action=startFind
{ "Token": 1234,
Response "Total": 20
}
 Get the find result

Table 16-65
URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=doFind
Method GET
Descripti
Get the find result.
on
Da

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
hu

The token of this search, use this token to get result and stop
a

Token int R
search.
HT

Offset int R Offset in the result record set, range is [0, Total – 1].
TP

Count int R Count of result to get.


[ Response Params ] ( JSON format )
AP

Name Type R/O Param Description


I

Info array<object> R The face information of user.


fo

+UserID string R The user's id.


r

The user's face photo's MD5 hash string, max array size is 5,
+MD5 array<string> O
We

max string size is 33.


st

[ Example ]
GET
Eu

Request http://<server>/cgi-bin/FaceInfoManager.cgi?action=doFind&Token=1234&Offset=0&Coun
ro

t=20
{ "Info": [ {
pe

"UserID": "102",
Te

Response "MD5": [ "xxxx", "xxxx", … ]


c

}, { … }, … ]
hn

}
ic

 Stop the find session


a l

Table 16-66
URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=stopFind
Method GET
Description Stop the find session.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Token for this search, use this token to get result and stop
Token int R
search.
[ Response Params ] ( OK )
[ Example ]
Request GET http://<server>/cgi-bin/FaceInfoManager.cgi?action=stopFind&Token=1234

AI APIs 276
Response OK

16.3.1.9 Add Access User Card and Fingerprint


 Add Access user card only

Table 16-67
URL http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControlCard
Method GET
Description Insert access user card info.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
Da

"AccessControlCard".
CardName string R Access user card name, max string length is 32.
hu

CardNo string R Access user card number.


a

UserID string R The user's id.


HT

Card status, 0 means normal, and abnormal status can be sum


TP

of following:
 1 << 0: report the loss of the card
AP

 1 << 1: the card is withdrawed


I

CardStatus int R  1 << 2: the card is frozen


fo

 1 << 3: the card is arrearage


r

 1 << 4: the card exceeds the time limit


 1 << 5: the card is arrearage but still can open the door, and
We

there will be voice prompts.


st

The card type:


Eu

CardType int O 0 : Normal Card, 1: VIP Card, 2: Visitor Card, 3: Patrol Card, 4:
Blacklist Card, 5: Stress Card, 0xff: Mother Card
ro

Password string O The Access card's password.


pe

Doors array<int> O The index of the doors that this card can open.
Te

The index of the time sections of each door that this card can
TimeSections array<int> O
open.
c hn

VTOPosition string O VTO position number.


ic

ValidDateStart string O The start of valid date, format is "yyyyMMdd hhmmss".


a

ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".


l

IsValid bool O Is the card still valid.


[ Response Params ] (key=value format)
R/
Name Type Param Description
O
RecNo int R The record id.
[ Example ]
GET
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControlCard&
Request CardName=ZhangSan&CardNo=12345&UserID=102&CardStatus=0&CardType=0&Pass
word=123456&Doors[0]=1&Doors[1]=3&Doors[2]=5&VTOPosition=01018001&ValidDateSt
art=20151022%20093811&ValidDateEnd=20151222%20093811

AI APIs 277
Response RecNo=12345
 Add access user card with fingerprint

Table 16-68
URL http://<server>/cgi-bin/recordUpdater.cgi?action=insertEx&name=AccessControlCard
Method POST
Description Insert access user card and fingerprint.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
CardName string R Access user card name, max string length is 32.
CardNo string R Access user card number.
Da

UserID string R The user's id.


Card status, 0 means normal, and abnormal status can be sum
hu

of following:
a

 1 << 0: report the loss of the card


HT

 1 << 1: the card is withdrawed


TP

CardStatus int R  1 << 2: the card is frozen


 1 << 3: the card is arrearage
AP

 1 << 4: the card exceeds the time limit


I

 1 << 5: the card is arrearage but still can open the door,
fo

and there will be voice prompts.


r

The card type:


We

CardType int O 0: Normal Card, 1: VIP Card, 2: Visitor Card, 3: Patrol Card, 4:
Blacklist Card, 5: Stress Card, 0xff: Mother Card
st

Password string O The Access card's password.


Eu

Doors array<int> O The index of the doors that this card can open.
The index of the time sections of each door that this card can
ro

TimeSections array<int> O
open.
pe

VTOPosition string O VTO position number.


Te

ValidDateStart string O The start of valid date, format is "yyyyMMdd hhmmss".


ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".
c hn

IsValid bool O Is the card still valid.


ic

FingerprintPack
object O The fingerprint packet info.
a

et
l

+Length int O The length of each fingerprint packet.


+Count int O The count of fingerprint packet.
[ Response Params ] (key=value format)
R/
Name Type Param Description
O
RecNo int R The record id.
[ Example ]

AI APIs 278
POST
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insertEx&name=AccessControlCar
d&CardName=ZhangSan&CardNo=12345&UserID=102&CardStatus=0&Password=12345
6&Doors[0]=1&Doors[1]=3&Doors[2]=5&VTOPosition=01018001&ValidDateStart=201510
22%20093811&ValidDateEnd=20151222%20093811&FingerprintPacket.Length=500&Fin
Request
gerprintPacket.Count=3
Content-Type: application/octet-stream
Content-Length: <length>

<fingerprint packet binary data>


Response RecNo=12345

16.3.1.10 Modify Access User Card and Fingerprint


Da
hu

 Update Access user card only


a

Table 16-69
HT

URL http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=AccessControlCard
TP

Method GET
Update access user card info.
Description
AP

Note: You should provide at lease one optional param to update.


I

[ Request Params ] ( key=value format in URL )


fo

Name Type R/O Param Description


r

Access user card and fingerprint record name, should be


name string R
"AccessControlCard".
We

recno int R The record id.


st

CardName string O Access user card name, max string length is 31.
Eu

CardNo string O Access user card number.


UserID string O The user's id.
ro

…<See above insert command for other params of the record,


pe

…<other param> — —
They are all optional.>
[ Response Params ] ( OK )
Te

[ Example ]
c hn

GET
ic

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=update&name=AccessControlCar
Request d&recno=12345&CardName=ZhangSan&CardNo=12345&UserID=102&CardStatus=0&
a l

CardType=0&Password=123456&Doors[0]=1&Doors[1]=3&Doors[2]=5&ValidDateStart=
20151022%20093811&ValidDateEnd=20151222%20093811
Response OK
 Update access user card and fingerprint

Table 16-70
URL http://<server>/cgi-bin/recordUpdater.cgi?action=updateEx&name=AccessControlCard
Method POST
Update access user card info and fingerprint.
Description
Note: You should provide at lease one optional param to update.
[ Request Params ] ( key=value format in URL )

AI APIs 279
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
recno int R The record id.
CardName string O Access user card name, max string length is 32.
CardNo string O Access user card number.
UserID string O The user's id.
…<See above insert command for other params of the record.
…<other param>
They are all optional.>
FingerprintPack
object O The fingerprint packet info.
et
+Length int O The length of each fingerprint packet.
+Count int O The count of fingerprint packet.
Da

[ Response Params ] ( OK )
hu

[ Example ]
a

POST
HT

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=updateEx&name=AccessControlC
ard&recno=12345&CardName=ZhangSan&CardNo=12345&UserID=102&CardStatus=0
TP

&CardType=0&Password=123456&Doors[0]=1&Doors[1]=3&Doors[2]=5&ValidDateStart
AP

=20151022%20093811&ValidDateEnd=20151222%20093811&FingerprintPacket.Length
Request
I

=500&FingerprintPacket.Count=3
Content-Type: application/octet-stream
fo

Content-Length: <length>
r
We

<fingerprint packet binary data>


st

Response OK
Eu

16.3.1.11 Delete Access User Card and Fingerprint


ro
pe

 Delete Access user card and fingerprint record by recno

Table 16-71
Te

URL http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=AccessControlCard
c hn

Method GET
ic

Descriptio
Remove the access user card and fingerprint record.
n
a l

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
recno int R The record id.
[ Response Params ] ( OK )
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=remove&name=AccessControlCar
d&recno=12345
Response OK

AI APIs 280
 Delete all Access user card and fingerprint records

Table 16-72
URL http://<server>/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControlCard
Method GET
Descriptio
Remove all the access user card and fingerprint records.
n
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
[ Response Params ] ( OK )
[ Example ]
Da

GET
Request
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControlCard
hu

Response OK
a
HT

16.3.1.12 Find Access User Card and Fingerprint


TP

 Find Access user card by condition


AP

Table 16-73
I

URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCard
fo

Method GET
r

Description Find Access user card record by condition.


We

[ Request Params ] ( key=value format in URL )


st

Name Type R/O Param Description


name string R Record Name, should be "AccessControlCard".
Eu

count int O Max result to return, default is 1024.


ro

StartTime string O The start of the record's CreateTime.


pe

EndTime string O The End of the record's CreateTime.


condition object O Search condition.
Te

+CardNo string O Access user card number.


c

+UserID string O The user's id.


hn

+IsValid bool O The access card valid or not.


ic

[ Response Params ] (key=value format)


la

Name Type R/O Param Description


totalCount int O The total record num that find.
found int O The record num that returned.
records array<object> R The records that returned.
+RecNo int R The record id.
+CreateTime int R The create time of record.
+CardName string R The access user card name, max string length is 32.
+CardNo string R The access user card number.
+UserID string R The user's id.

AI APIs 281
Card status, 0 means normal, and abnormal status can be
sum of following:
 1 << 0: report the loss of the card
 1 << 1: the card is withdrawed
+CardStatus int R  1 << 2: the card is frozen
 1 << 3: the card is arrearage
 1 << 4: the card exceeds the time limit
 1 << 5: the card is arrearage but still can open the door,
and there will be voice prompts.
The card type:
+CardType int O 0: Normal Card, 1: VIP Card, 2: Visitor Card, 3: Patrol Card, 4:
Blacklist Card, 5: Stress Card, 0xff: Mother Card
+Password string O The Access card's password.
Da

+Doors array<int> O The index of the doors that this card can open.
hu

The index of the time sections of each door that this card can
+TimeSections array<int> O
a

open.
+VTOPosition string O VTO position number.
HT

+ValidDateStart string O The start of valid date, format is "yyyyMMdd hhmmss".


TP

+ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".


AP

+IsValid bool O Is the card still valid.


[ Example ]
I

GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCard
fo

Request
&condition.UserID=103&StartTime=123456700&EndTime=123456800&count=100
r
We
st
Eu
ro
pe
Te
c hn
ic
a l

AI APIs 282
totalCount=1000
found=100
records[0].RecNo=12345
records[0].CreateTime=123456789
records[0].CardName=ZhangSan
records[0].CardNo=300
records[0].UserID=103
records[0].CardStatus=0
records[0].CardType=0
records[0].Doors[0]=1
records[0].Doors[1]=3
records[0].Doors[2]=5
records[0].VTOPosition=01018001
Da

records[0].ValidStart=20151022 093811
hu

records[0].ValidEnd=20151222 093811
records[0].IsValid=true
a

Response …
HT

records[1].RecNo=13579
TP

records[1].CreateTime=123456799
records[1].StaticsticsTime=123456799
AP

records[1].CardName=ZhangSan
I

records[1].CardNo=302
fo

records[1].UserID=103
r

records[1].CardStatus=0
We

records[1].CardType=0
records[1].Doors[0]=2
st

records[1].Doors[1]=4
Eu

records[1].Doors[2]=6
records[1].VTOPosition=01018002
ro

records[1].ValidStart=20151022 093811
pe

records[1].ValidEnd=20151222 093811
Te

records[1].IsValid=true

c
hn

 Find Access user card by recno


ic

Table 16-74
a

URL http://<server>/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCard
l

Method GET
Description Find Access user card record by recno.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
name string R Record Name, should be "AccessControlCard".
recno int R The record id.
[ Response Params ] (key=value format)
Name Type R/O Param Description
record object R The record that returned.
+RecNo int R The record id.

AI APIs 283
+CreateTime int R The create time of record.
+CardName string R The access user card name, max string length is 32.
+CardNo string R The access user card number.
+UserID string R The user's id.
…<other param> — — …<See above find command for other params of the record.>
[ Example ]
GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCar
Request
d&recno=4
record.RecNo=4
record.CreateTime=123456789
record.CardName=ZhangSan
record.CardNo=300
record.UserID=103
Da

record.CardStatus=0
hu

record.CardType=0
a

Response record.Doors[0]=1
HT

record.Doors[1]=3
record.Doors[2]=5
TP

record.VTOPosition=01018001
AP

record.ValidStart=20151022 093811
record.ValidEnd=20151222 093811
I

record.IsValid=true
fo


r

 Find Access user card and fingerprint by recno


We

Table 16-75
st

URL http://<server>/cgi-bin/recordUpdater.cgi?action=getEx&name=AccessControlCard
Method GET
Eu

Description Find Access user card and fingerprint record by recno.


ro

[ Request Params ] ( key=value format in URL )


pe

Name Type R/O Param Description


name string R
Te

Record Name, should be "AccessControlCard".


recno int R The record id.
c
hn

[ Response Params ] (key=value format)


ic

Name Type R/O Param Description


a

record object R The record that returned.


l

+RecNo int R The record id.


+CreateTime int R The create time of record.
+CardName string R The access user card name, max string length is 32.
+CardNo string R The access user card number.
+UserID string R The user's id.
…<other param> — — …<See above find command for other params of the record.>
+FingerprintPac
object O The fingerprint packet info.
ket
++Length int O The length of each fingerprint packet.
++Count int O The count of fingerprint packet.
[ Example ]

AI APIs 284
GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=getEx&name=AccessControl
Request
Card&recno=4
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Content-Length: <length>

--<boundary>
Content-Type: text/plain
Content-Length: <length>

record.RecNo=4
record.CreateTime=123456789
Da

record.CardName=ZhangSan
hu

record.CardNo=300
record.UserID=103
a

record.CardStatus=0
HT

record.CardType=0
TP

Response
record.Doors[0]=1
record.Doors[1]=3
AP

record.Doors[2]=5
I

record.VTOPosition=01018001
fo

record.ValidStart=20151022 093811
r

record.ValidEnd=20151222 093811
We

record.IsValid=true

st

record.FingerprintPacket.Length=500
Eu

record.FingerprintPacket.Count=3
ro

--<boundary>
Content-Type: application/octet-stream
pe

Content-Length: <length>
Te

<fingerprint packet binary data>


c hn

--<boundary>--
ic
a
l

16.3.1.13 Get the Total Number of Records of Access User Card and

Fingerprint

Table 16-76
http://<server>/cgi-bin/recordFinder.cgi?action=getQuerySize&name=AccessControlCar
URL
d
Method GET
Description Get the total number of records of the access user card record.
[ Request Params ] ( key=value format in URL )

AI APIs 285
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
[ Response Params ] ( key=value )
count int R The total number of records.
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/recordFinder.cgi?action=getQuerySize&name=AccessContr
olCard
Response count=150

16.3.2 Access control


Da
hu

16.3.2.1 [Event] AccessControl


a
HT

Table 16-77
Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event
TP

Description When user trying to open the door, send this event.
AP

[ Event Params ] ( key=value format )


I

Name Type R/O Param Description


Events array<object> R Event info array
fo

+EventBaseInfo object R Base info of event


r

++Code String R Event Code. It should be AccessControl


We

++Action String R Event Action. It can be: "Start", "Stop", "Pulse"


st

++Index int O The channel index relate to this event.


+RecNo int R The record id
Eu

+Name string O The name of the door


ro

+Type string R The event type. It can be: "Entry", "Exit"


pe

Open door result, can be: 0—failed, 1—success


+Status int O
If this param does not exist, that means success.
Te

Open door method, can be:


c

0: by password
hn

1: by access card
ic

+Method int R 2: by access card and then password


a l

3: by password and then access card


6: by fingerprint
15: by face recognition
+CardNo string O Card number if the door is opened by card
+UserID string R The user id
[ Example ]
--<boundary>
Content-Type: text/plain
Event Content-Length: <length>

Events[0].EventBaseInfo.Code=TrafficJam

AI APIs 286
Events[0].EventBaseInfo.Action=Pulse
Events[0].EventBaseInfo.Index=0
Events[0].RecNo=123
Events[0].Name=Door1
Events[0].Type=Entry
Events[0].Status=1
Events[0].Method=1
Events[0].CardNo=09DDAABB
Events[0].UserID=101

--<boundary>
Content-Type: image/jpeg
Content-Length: <image size>
Da
hu

<Jpeg image data>


--<boundary>
a
HT
TP

16.3.2.2 Find AccessControl Record


AP

Table 16-78
I

URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=<RecordName>
fo

Method GET
Description Find AccessControl record.
r

[ Request Params ] ( key=value format in URL )


We

Name Type R/O Param Description


st

The record table name. It should be


name string R
"AccessControlCardRec".
Eu

count int O Max result to return, default is 1024.


ro

StartTime string O The start of the record's CreateTime.


pe

EndTime string O The end of the record's CreateTime.


condition object O Search condition.
Te

+CardNo string O Access user card number.


chn

[ Response Params ] (key=value format)


ic

Name Type R/O Param Description


totalCount int O Total record num that find.
a l

found int O Record num that returned.


array<object
records R The records that returned.
>
+RecNo int R Record id.
+CreateTime int R Record create time, UTC time.
+CardNo int R Access user card number.
+CardName string O Access user card name, max string length is 31.
The card type:
+CardType int O 0: Normal Card, 1: VIP Card, 2: Visitor Card, 3: Patrol Card,
4: Blacklist Card, 5: Stress Card, 0xff: Mother Card
+Password string O The Access card's password.

AI APIs 287
+UserID string R The user's id.
+Type string R The event type. It can be: "Entry", "Exit".
Open door result. It can be: 0—failed, 1—success.
+Status int O
If this param does not exist, that means success.
Open door method. It can be:
 0: by password
 1: by access card
+Method int R  2: by access card and then password
 3: by password and then access card
 6: by fingerprint
 15: by face recognition
+Door int O The index of the door.
+ReaderID string O The access user card ID of reader.
Da

+ErrorCode int O The error code, valid only when Status is 0.


hu

+URL string O The picture's URL, max string length is 127.


a

+RecordURL string O The record video's URL, max string length is 127.
HT

[ Example ]
GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCard
TP

Request
Rec&StartTime=123456700&EndTime=123456800&condition.CardNo=12001&count=100
AP

totalCount=1000
I

found=100
records[0].RecNo=12345
fo

records[0].CreateTime=123456789
r

records[0].CardNo=12001
We

records[0].CardName=ZhangSan
st

records[0].UserID=ZhangSan
records[0].Type=Entry
Eu

records[0].Method=1
Response
ro


pe

records[1].RecNo=13579
records[1].CreateTime=123456799
Te

records[1].CardNo=12001
c

records[1].CardName=ZhangSan
hn

records[1].UserID=ZhangSan
ic

records[1].Type=Exit
a

records[1].Method=1
l

AI APIs 288
AI APIs 289
al
ic
chn
Te
pe
ro
Eu
st
We
r
fo
I
AP
TP
HT
a
hu
Da

You might also like