NetSDK Programming Manual (Intelligent AI)
NetSDK Programming Manual (Intelligent AI)
Programming Manual
V1.0.5
Foreword
Purpose
Welcome to use NetSDK (hereinafter referred to be "SDK") programming manual (hereinafter referred
to as "the Manual").
SDK, also known as network device SDK, is a development kit for developer to develop the interfaces
for network communication among surveillance products such as Network Video Recorder (NVR),
Network Video Server (NVS), IP Camera (IPC), Speed Dome (SD), and intelligence devices.
The Manual describes the SDK interfaces and processes of the intelligent function modules for
Intelligent Video Surveillance System (IVSS), Network Video Recorder (NVR), IP Camera (IPC),
Intelligent Traffic Camera (ITC), people flow statistics devices and barrier. For more function modules
and data structures, refer to NetSDK Development Manual.
The example codes provided in the Manual are only for demonstrating the procedure and not
assured to copy for use.
Readers
Safety Instructions
The following categorized signal words with defined meaning might appear in the manual.
Signal Words Meaning
TIPS Provides methods to help you solve a problem or save you time.
I
Revision History
As the device user or data controller, you might collect personal data of others 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.
The manual is for reference only. Slight differences might be found between the manual and the
product.
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
jurisdictions. For detailed information, refer to the paper manual, CD-ROM, QR code or our
official website. If there is inconsistency between paper manual and the electronic version, the
electronic version shall prevail.
All the designs and software are subject to change without prior written notice. The product
updates might cause some differences between the actual product and the manual. Please
contact the customer service for the latest program and supplementary documentation.
There still might be deviation in technical data, functions and operations description, or errors
in print. If there is any doubt or dispute, we reserve the right of final explanation.
II
Upgrade the reader software or try other mainstream reader software if the manual (in PDF
format) cannot be opened.
All trademarks, registered trademarks and the company names in the manual are the properties
of their respective owners.
Please visit our website, contact the supplier or customer service if there is any problem
occurring when using the device.
If there is any uncertainty or controversy, we reserve the right of final explanation.
III
Glossary
This chapter provides the definitions to some of the terms appear in the Manual to help you
understand the function of each module.
Term Definition
Intelligent Video Surveillance System is different with the NVR
devices which only support the storage function. The IVSS adds the
IVSS
intelligent analysis function to form an integrated management
system.
Do the intelligent analysis to detect the people face, age, sex and
Face Detection
expression in the video.
It contains the face detection. You can detect whether the faces in
object Recognition the video are in the face library or not through the intelligent
analysis.
It can be used to storage the face pictures that captured by the
History library
device.
You can detect whether the faces are in the face library or not
Face library through importing some face images to the IVSS, NVR or the
front-end devices in advance.
Arm/Disarm one or multiple face library to one channel. The scene:
Arm by channel The detected face in this channel contrast with the arm library and
return the result. It belongs to one mode of the face library arming.
Arm the face library to one or multiple channel. The scene: The
people face detected by the channel contrast with this face library
Arm by library
and return the result. It belongs to one mode of the face library
arming.
You can import a picture and a similarity value, and then the IVSS and
Search picture by NVR will search the history library and the face library by this picture
picture to make sure whether there have two same faces between the two
libraries. And then it will return the right picture.
Intelligent Traffic Camera. It can capture the vehicle pictures and
ITC
automatically analyze the traffic events.
Tripwire detect Automatically detect the cross trip wire.
Intrusion detect Automatically detect whether the object enter the alert area or not.
People flow People information in the camera marking area.
Real-time count the number of people entering or leaving the
People counting
camera marking area.
People counting in area Real-time count the number of people in the camera marking area.
IV
Table of Contents
Foreword ..................................................................................................................................................... I
Glossary ..................................................................................................................................................... IV
1 Overview................................................................................................................................................. 1
1.1 General ........................................................................................................................................... 1
1.2 Applicability .................................................................................................................................... 2
1.3 Application Scenario ........................................................................................................................ 2
1.3.1 People Flow Statistics ............................................................................................................. 2
1.3.2 Intelligent Traffic .................................................................................................................... 2
1.3.3 General Behavior ................................................................................................................... 4
1.3.4 Access Control System ........................................................................................................... 5
2 Function Module.................................................................................................................................... 7
2.1 SDK Initialization.............................................................................................................................. 7
2.1.1 Introduction .......................................................................................................................... 7
2.1.2 Interface Overview................................................................................................................. 7
2.1.3 Process .................................................................................................................................. 7
2.1.4 Example Code........................................................................................................................ 8
2.2 Device Login.................................................................................................................................... 9
2.2.1 Introduction .......................................................................................................................... 9
2.2.2 Interface Overview................................................................................................................. 9
2.2.3 Process .................................................................................................................................. 9
2.2.4 Example Code.......................................................................................................................11
2.3 Real-time Monitoring ......................................................................................................................11
2.3.1 Introduction .........................................................................................................................11
2.3.2 Interface Overview................................................................................................................11
2.3.3 Process ................................................................................................................................ 12
2.3.4 Example Code...................................................................................................................... 15
2.4 Subscribing to Intelligent Event ...................................................................................................... 16
2.4.1 Introduction ........................................................................................................................ 16
2.4.2 Interface Overview............................................................................................................... 16
2.4.3 Process ................................................................................................................................ 17
2.4.4 Example Code...................................................................................................................... 18
2.5 Searching for/Playbacking/Downloading Video and Picture ............................................................ 18
2.5.1 Introduction ........................................................................................................................ 18
2.5.2 Interface Overview............................................................................................................... 19
2.5.3 Process ................................................................................................................................ 20
2.5.4 Example Code...................................................................................................................... 22
3 Face Detection and Recognition ....................................................................................................... 27
3.1 Subscribing Face Event .................................................................................................................. 27
3.2 Adding/Deleting/Modifying/Searching the Face Library .................................................................. 27
3.2.1 Introduction ........................................................................................................................ 27
3.2.2 Interface Overview............................................................................................................... 27
3.2.3 Process ................................................................................................................................ 28
3.2.4 Example Code...................................................................................................................... 29
3.3 Adding/Deleting/Modifying/Searching People Face ........................................................................ 31
V
3.3.1 Introduction ........................................................................................................................ 31
3.3.2 Interface Overview............................................................................................................... 31
3.3.3 Process ................................................................................................................................ 32
3.3.4 Example Code...................................................................................................................... 33
3.4 Arming by Channel or Library......................................................................................................... 35
3.4.1 Introduction ........................................................................................................................ 35
3.4.2 Interface Overview............................................................................................................... 35
3.4.3 Process ................................................................................................................................ 36
3.4.4 Example Code...................................................................................................................... 37
3.5 Searching for Picture by Picture ...................................................................................................... 39
3.5.1 Introduction ........................................................................................................................ 39
3.5.2 Interface Overview............................................................................................................... 39
3.5.3 Process ................................................................................................................................ 40
3.5.4 Example Code...................................................................................................................... 41
3.6 Searching for and Downloading Face Video and Picture .................................................................. 43
4 Body Detection .................................................................................................................................... 44
4.1 Subscribing Body Event ................................................................................................................. 44
4.2 Searching for the Body Picture ....................................................................................................... 44
4.2.1 Introduction ........................................................................................................................ 44
4.2.2 Interface Overview............................................................................................................... 44
4.2.3 Process ................................................................................................................................ 45
4.2.4 Example Code...................................................................................................................... 45
5 People Flow Statistics ........................................................................................................................ 47
5.1 Subscribing to People Flow Event ................................................................................................... 47
5.1.1 Introduction ........................................................................................................................ 47
5.1.2 Interface Overview............................................................................................................... 47
5.1.3 Process ................................................................................................................................ 48
5.1.4 Example Code...................................................................................................................... 48
5.2 Alarm of People Flow Event ............................................................................................................ 49
5.3 Searching for History Data of People Flow Statistics ........................................................................ 49
5.3.1 Introduction ........................................................................................................................ 49
5.3.2 Interface Overview............................................................................................................... 49
5.3.3 Process ................................................................................................................................ 50
5.3.4 Example Code...................................................................................................................... 50
6 General Behavior Event...................................................................................................................... 52
6.1 Subscribing to General Behavior Event ........................................................................................... 52
6.2 Video Searching and Downloading of General Behavior Event ......................................................... 52
7 Intelligent Traffic.................................................................................................................................. 53
7.1 Subscribing to Intelligent Traffic Event ............................................................................................ 53
7.2 Searching for History Data of Vehicle Flow Statistics ........................................................................ 53
7.2.1 Introduction ........................................................................................................................ 53
7.2.2 Interface Overview............................................................................................................... 53
7.2.3 Process ................................................................................................................................ 54
7.2.4 Example Code...................................................................................................................... 55
7.3 Adding/deleting/modifying/searching for Blockist and Allowlist of Vehicle ...................................... 57
7.3.1 Introduction ........................................................................................................................ 57
7.3.2 Interface Overview............................................................................................................... 57
VI
7.3.3 Process ................................................................................................................................ 58
7.3.4 Example Code...................................................................................................................... 59
7.4 Searching for and Downloading Vehicle Picture .............................................................................. 61
7.4.1 Introduction ........................................................................................................................ 61
7.4.2 Interface Overview............................................................................................................... 61
7.4.3 Process ................................................................................................................................ 62
7.4.4 Example Code...................................................................................................................... 63
8 Barrier ................................................................................................................................................... 65
8.1 Subscribing to Access Control Event ............................................................................................... 65
8.2 Manager Information of Access Control Card .................................................................................. 65
8.2.1 Introduction ........................................................................................................................ 65
8.2.2 Interface Overview............................................................................................................... 65
8.2.3 Process ................................................................................................................................ 66
8.2.4 Example Code...................................................................................................................... 67
8.3 Face Management ......................................................................................................................... 71
8.3.1 Introduction ........................................................................................................................ 71
8.3.2 Interface Overview............................................................................................................... 71
8.3.3 Process ................................................................................................................................ 72
8.3.4 Example Code...................................................................................................................... 73
8.4 Searching for the Record of In-Out the Door ................................................................................... 75
8.4.1 Introduction ........................................................................................................................ 75
8.4.2 Interface Overview............................................................................................................... 76
8.4.3 Process ................................................................................................................................ 77
8.4.4 Example Code...................................................................................................................... 78
9 Object Monitoring................................................................................................................................ 79
9.1 Subscribing to Object Monitoring Events ........................................................................................ 79
9.2 Searching for and Downloading Object Monitoring Video ............................................................... 79
10 City Management............................................................................................................................... 80
10.1 Subscribing to management events ............................................................................................. 80
10.2 Searching for and Downloading City Management Video .............................................................. 80
11 Parking Space Detection .................................................................................................................. 82
11.1 Subscribing to Detection Event of Parking Space .......................................................................... 82
11.2 Searching for and Downloading Event Detection Video of Parking Space ....................................... 82
11.3 Subscribing to Designated Parking Space Picture .......................................................................... 83
11.3.1 Overview ........................................................................................................................... 83
11.3.2 Interface Overview ............................................................................................................. 83
11.3.3 Process Description ............................................................................................................ 83
11.3.4 Example Code .................................................................................................................... 84
12 Crowd Map ......................................................................................................................................... 85
12.1 Subscribing to Crowd Map Event .................................................................................................. 85
12.2 Searching for and Downloading Video of Crowd Map .................................................................... 85
13 Vehicle Density Map .......................................................................................................................... 86
13.1 Subscribing to Vehicle Density Event ............................................................................................ 86
13.2 Searching for and Downloading Video of Vehicle Density Event ..................................................... 86
14 Heat Map............................................................................................................................................. 87
14.1 Subscribing to Heat Map Data ...................................................................................................... 87
14.1.1 Overview ........................................................................................................................... 87
VII
14.1.2 Interface Overview ............................................................................................................. 87
14.1.3 Process Description ............................................................................................................ 87
14.1.4 Example Code .................................................................................................................... 88
14.2 Subscribing to Gray Map Data ...................................................................................................... 88
14.2.1 Overview ........................................................................................................................... 88
14.2.2 Interface Overview ............................................................................................................. 89
14.2.3 Process Description ............................................................................................................ 89
14.2.4 Example Code .................................................................................................................... 90
15 Stereo Analysis.................................................................................................................................. 91
15.1 Subscribing to Stereo Analysis Event............................................................................................. 91
15.2 Searching for and Downloading Video of Stereo Analysis Event ..................................................... 91
15.3 Subscribing to Video Statistics ...................................................................................................... 92
15.3.1 Overview ........................................................................................................................... 92
15.3.2 Interface Overview ............................................................................................................. 92
15.3.3 Process Description ............................................................................................................ 92
15.3.4 Example Code .................................................................................................................... 93
16 Interface Definition ............................................................................................................................ 94
16.1 SDK Initialization .......................................................................................................................... 94
16.1.1 SDK CLIENT_Init ................................................................................................................. 94
16.1.2 CLIENT_Cleanup ................................................................................................................ 94
16.1.3 CLIENT_SetAutoReconnect................................................................................................. 94
16.1.4 CLIENT_SetNetworkParam ................................................................................................. 95
16.2 Device Login ................................................................................................................................ 95
16.2.1 CLIENT_LoginWithHighLevelSecurity .................................................................................. 95
16.2.2 CLIENT_Logout .................................................................................................................. 96
16.3 Real-time Monitoring ................................................................................................................... 96
16.3.1 CLIENT_RealPlayEx ............................................................................................................. 96
16.3.2 CLIENT_StopRealPlayEx ...................................................................................................... 97
16.3.3 CLIENT_SaveRealData ........................................................................................................ 97
16.3.4 CLIENT_StopSaveRealData ................................................................................................. 98
16.3.5 CLIENT_SetRealDataCallBackEx .......................................................................................... 98
16.4 Subscribing to Intelligent Event .................................................................................................... 99
16.4.1 CLIENT_RealLoadPictureEx ................................................................................................. 99
16.4.2 CLIENT_StopLoadPic ........................................................................................................ 100
16.5 Searching for and Downloading Intelligent Video and Picture ..................................................... 100
16.5.1 CLIENT_FindFileEx............................................................................................................ 100
16.5.2 CLIENT_GetTotalFileCount ................................................................................................ 100
16.5.3 CLIENT_FindNextFileEx .................................................................................................... 101
16.5.4 CLIENT_FindCloseEx......................................................................................................... 101
16.5.5 CLIENT_PlayBackByTimeEx2 ............................................................................................. 102
16.5.6 CLIENT_StopPlayBack....................................................................................................... 102
16.5.7 CLIENT_DownloadByTimeEx............................................................................................. 102
16.5.8 CLIENT_StopDownload .................................................................................................... 103
16.5.9 CLIENT_DownloadRemoteFile .......................................................................................... 104
16.6 Subscribing to Face Event........................................................................................................... 104
16.7 Adding/Deleting/Modifying/Searching the Face Library .............................................................. 104
16.7.1 CLIENT_OperateFaceRecognitionGroup ............................................................................ 104
VIII
16.7.2 CLIENT_FindGroupInfo ..................................................................................................... 105
16.8 Adding/Deleting/Modifying/Searching for People Face ............................................................... 105
16.8.1 CLIENT_OperateFaceRecognitionDB ................................................................................. 105
16.8.2 CLIENT_OperateFaceRecognitionDB ................................................................................. 105
16.8.3 CLIENT_DoFindFaceRecognition ....................................................................................... 106
16.8.4 CLIENT_StopFindFaceRecognition .................................................................................... 106
16.8.5 CLIENT_FaceRecognitionPutDisposition ........................................................................... 107
16.8.6 CLIENT_FaceRecognitionDelDisposition ........................................................................... 107
16.8.7 CLIENT_SetGroupInfoForChannel ..................................................................................... 107
16.8.8 CLIENT_AttachFaceFindState ............................................................................................ 108
16.8.9 CLIENT_DetachFaceFindState ........................................................................................... 108
16.9 Body Detection .......................................................................................................................... 109
16.9.1 CLIENT_DownloadRemoteFile .......................................................................................... 109
16.10 People Flow Statistics ............................................................................................................... 109
16.10.1 CLIENT_AttachVideoStatSummary .................................................................................. 109
16.10.2 CLIENT_DetachVideoStatSummary ..................................................................................110
16.10.3 CLIENT_StartFindNumberStat ..........................................................................................110
16.10.4 CLIENT_DoFindNumberStat.............................................................................................110
16.10.5 CLIENT_StopFindNumberStat .......................................................................................... 111
16.11 Intelligent Traffic ....................................................................................................................... 111
16.11.1 CLIENT_FindRecord ......................................................................................................... 111
16.11.2 CLIENT_QueryRecordCount ............................................................................................. 111
16.11.3 CLIENT_FindNextRecord ..................................................................................................112
16.11.4 CLIENT_FindRecordClose.................................................................................................112
16.11.5 CLIENT_OperateTrafficList ...............................................................................................112
16.11.6 CLIENT_DownLoadMultiFile ............................................................................................113
16.11.7 CLIENT_StopLoadMultiFile ..............................................................................................113
16.12 Access Control ..........................................................................................................................113
16.12.1 CLIENT_FindRecord .........................................................................................................113
16.12.2 CLIENT_FindNextRecord ..................................................................................................114
16.12.3 CLIENT_FindRecordClose.................................................................................................114
16.12.4 CLIENT_FindRecordClose.................................................................................................115
16.12.5 CLIENT_FindRecordClose.................................................................................................115
16.13 Parking Space Detection ...........................................................................................................116
16.13.1 Subscribing to designated parking space picture .............................................................116
16.13.2 Unsubscribing from Designated Parking Space Picture .....................................................116
16.14 Heat Map ..................................................................................................................................116
16.14.1 Subscribing to Heat Map Data .........................................................................................116
16.14.2 Unsubscribing from Heat Map Data .................................................................................117
16.14.3 Subscribing to Gray Map Data .........................................................................................117
16.14.4 Unsubscribing from Gray Map Data .................................................................................118
16.15 Stereo Analysis ..........................................................................................................................118
16.15.1 Subscribing to Video Statistics .........................................................................................118
16.15.2 Unsubscribing from Video Statistics .................................................................................118
17 Callback Function Definition.......................................................................................................... 119
17.1 fDisConnect ................................................................................................................................119
17.2 fHaveReConnect .........................................................................................................................119
IX
17.3 fRealDataCallBackEx ................................................................................................................... 120
17.4 fAnalyzerDataCallBack ............................................................................................................... 120
17.5 fDownLoadPosCallBack .............................................................................................................. 121
17.6 fDataCallBack............................................................................................................................. 121
17.7 fFaceFindState ........................................................................................................................... 122
17.8 fVideoStatSumCallBack .............................................................................................................. 122
17.9 fMultiFileDownLoadPosCB ......................................................................................................... 123
17.10 fNotifySnapData ...................................................................................................................... 124
17.11 fRawStreamCallBack ................................................................................................................. 124
17.12 fHeatMapGrayCallBack ............................................................................................................. 124
17.13 fVideoStatisticsInfoCallBack ...................................................................................................... 125
Appendix 1 Cybersecurity Recommendations ....................................................................................... 126
X
1 Overview
1.1 General
The Manual introduces SDK interfaces reference information that includes main function modules,
interface definition, and callback definition.
The main function contains the general functions, face detection and object recognition, body
detection, people flow statistics, general behavior event, intelligent traffic and barrier.
The development kit might be different dependent on the different environments.
1
The auxiliary library decodes the audio and video streams for the functions such as monitoring
and voice talk, and collects the local audio.
1.2 Applicability
Recommended memory: No less than 512 M.
System supported by SDK:
Windows
Windows 10/ Windows 8.1/ Windows 7/ vista/ 2000 and Windows Server 2008/ 2003.
Linux
The common Linux systems such as Red Hat/SUSE
2
Figure 1-2 ITC and ITSET used at the traffic junction
ITC, ITSE and IPMECK used at the parking access control the vehicle enter and exit the parking and
monitor whether there is any parking space.
3
Figure 1-3 ITC, ITSE and IPMECK used at the parking access
4
Figure 1-5 General behavior scenario (intrusion)
5
Figure 1-7 Open barrier by people face
6
2 Function Module
2.1.1 Introduction
Initialization is the first step of SDK to conduct all the function modules. It does not have the
surveillance function but can set some parameters that affect the SDK overall functions.
Initialization occupies some memory.
Only the first initialization is valid within one process.
After using this function, call CLIENT_Cleanup to release SDK resource.
2.1.3 Process
Figure 2-1 Process of SDK initialization
7
Process Description
Call CLIENT_Init and CLIENT_Cleanup in pairs. It supports multiple calling but it is suggested
to call the pair for only one time overall.
Initialization: Calling CLIENT_Init multiple times is only for internal count without repeating
applying resources.
Cleaning up: The interface CLIENT_Cleanup clears all the opened processes, such as login,
real-time monitoring, and alarm subscription.
Reconnection: SDK can set the reconnection function for the situations such as network
disconnection and power off. SDK will keep logging until succeeded. Only the real-time
monitoring, alarm and snapshot subscription can be resumed after reconnection is successful.
8
2.2 Device Login
2.2.1 Introduction
Device login, also called user authentication, is the precondition of all the other function modules.
You will obtain a unique login ID upon logging in to the device and should call login ID before using
other SDK interfaces. The login ID becomes invalid once logged out.
2.2.3 Process
Figure 2-2 Proces of login
Start
Logout
CLIENT_Logout
Stop
9
Process Description
Login handle: When the login is successful, the returned value is not 0 (even the handle is
smaller than 0, the login is also successful). One device can login multiple times with different
handle at each login. If there is not special function module, it is suggested to login only one
time. The login handle can be repeatedly used on other function modules.
Logout: The interface will release the opened functions internally, but it is not suggested to rely
on the cleaning up function. For example, if you opened the monitoring function, you should
call the interface that stops the monitoring function when it is no longer required.
Use login and logout in pairs: The login consumes some memory and socket information and
release sources once logout.
Login failure: It is suggested to check the failure through the error parameter of the login
interface.
10
2.2.4 Example Code
NET_IN_LOGIN_WITH_HIGHLEVEL_SECURITY stInparam;
memset(&stInparam, 0, sizeof(stInparam));
stInparam.dwSize = sizeof(stInparam);
strncpy(stInparam.szIP, “192.168.1.108”, sizeof(stInparam.szIP) - 1);
strncpy(stInparam.szPassword, “123456”, sizeof(stInparam.szPassword) - 1);
strncpy(stInparam.szUserName, “admin”, sizeof(stInparam.szUserName) - 1);
stInparam.nPort = 37777;
stInparam.emSpecCap = EM_LOGIN_SPEC_CAP_TCP;
NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY stOutparam;
memset(&stOutparam, 0, sizeof(stOutparam));
stOutparam.dwSize = sizeof(stOutparam);
LLONG lLoginID = CLIENT_LoginWithHighLevelSecurity(&stInparam, &stOutparam);
2.3.1 Introduction
Real-time monitoring obtains the real-time stream from the storage device or front-end device,
which is an important part of the surveillance system.
SDK can get the main stream and sub stream from the device once it logged.
Supports calling the window handle for SDK to directly decode and play the stream (Windows
system only).
Supports calling the real-time stream for you to perform independent treatment.
Supports saving the real-time record to the specific file though saving the callback stream or
calling the SDK interface.
11
2.3.3 Process
You can realize the real-time monitoring through SDK decoding library or your play library.
Call PlaySDK library from the SDK auxiliary library to realize real-time play.
Figure 2-3 Process of playing by SDK decoding library
Start
Initialize SDK
CLIENT_Init
Close
Mandotory Optional
Process Description
12
Notes for Process
SDK decoding play only supports Windows system. You need to call the decoding after getting
the stream in other systems.
Multi-thread calling: Multi-thread calling is not supported for the functions within the same
login session; however, multi-thread calling can deal with the functions of different login
sessions although such calling is not recommended.
Timeout: The request on applying for monitoring resources should have made some agreement
with the device before requiring the monitoring data. There are some timeout settings (see
"NET_PARAM structure"), and the field about monitoring is nGetConnInfoTime. If there is
timeout due to the reasons such as bad network connection, you can modify the value of
nGetConnInfoTime bigger. The example code is as follows. Call it for only one time after having
called CLIENT_Init.
NET_PARAM stuNetParam = {0};
stuNetParam. nGetConnInfoTime = 5000; // unit ms
CLIENT_SetNetworkParam (&stuNetParam);
Failed to repeat opening: For some models, the same channel cannot be opened for multiple
times during a login. If you are trying to open it repeatedly, you will success in the first try but
get failed afterwards. In this case, you can try the following:
Close the opened channel. For example, if you have already opened the main stream video
on the channel 1 and still want to open the sub stream video on the same channel, you can
close the main stream first and then open the sub stream.
Login twice to obtain two login handles to deal with the main stream and sub stream
respectively.
Calling succeeded but no image: SDK decoding needs to use dhplay.dll. It is suggested to
check if dhplay.dll and its auxiliary library are missing under the running directory. See Table 1-1.
If the system resource is insufficient, the device might return error instead of stream. You can
receive an event DH_REALPLAY_FAILD_EVENT in the alarm callback that is set in
CLIENT_SetDVRMessCallBack. This event includes the detailed error codes. See
"DEV_PLAY_RESULT Structure" in Network SDK Development Manual.chm.
32 channels limit: The decoding consumes resources especially for the high definition videos.
Considering the limited resources at the client, currently the maximum channels are set to be 32.
If more than 32, it is suggested to use third party play library. See "2.3.3.2 Call Third Party
Library".
SDK calls back the real-time monitoring stream to you and you call PlaySDK to decode and play.
13
Figure 2-4 Process of calling the third party library
Start
Initialize SDK
CLIENT_Init
Logout
CLIENT_Logout
Stop
Process Description
14
SDK callbacks can only moves into the next process after returning from you. It is not
recommended for you to consume time for the unnecessary operations; otherwise the
performance could be affected.
// Take opening the main stream monitoring of channel 1 as an example. The parameter hWnd is a handle of
interface window.
LLONG lRealHandle = CLIENT_RealPlayEx(lLoginHandle, 0, hWnd, DH_RType_Realplay);
if (NULL == lRealHandle)
{
printf("CLIENT_RealPlayEx: failed! Error code: %x.\n", CLIENT_GetLastError());
}
printf("input any key to quit!\n");
getchar();
// Stop preview
if (NULL != lRealHandle)
{
CLIENT_StopRealPlayEx(lRealHandle);
}
15
}
2.4.1 Introduction
Intelligent event subscribe, is that the front-end devices or the back-end devices do the real-time
stream analyzing. When detect the preset intelligent event, it uploads the event to the user. The
intelligent events in this manual contain general action analysis (such as tripwire, Intrusion), face
detection, object recognition, body detection, the intelligent events of intelligent traffic (such as
traffic junction, over speed, low speed and traffic jam).
16
2.4.3 Process
Figure 2-5 Process of uploading face event
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
Support to subscribe single intelligent event and all the intelligent events (EVENT_IVS_ALL).
Setting of cache for receiving pictures: Because SDK default cache is 2M, when the data is over
2M, call CLIENT_SetNetworkParam to set the receiving cache; otherwise the data pack will be
lost.
17
Set whether to receive picture or not: You can call CLIENT_RealLoadPictureEx to set
bNeedPicFile as False, and then SDK will only receive the face event without picture.
2.5.1 Introduction
When the device intelligent calculation analysis the real-time stream, once one intelligent event is
detected, and then the video and picture of this intelligent event will be saved. You can search the
18
video and picture of the intelligent events which are saved in the device, and also you can do the
downloading and playing back operation to the searching result.
19
2.5.3 Process
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
20
Step 6 Call CLIENT_FindCloseEx to stop the searching.
Step 7 After using the function module, call CLIENT_Logout to logout the device.
Step 8 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
Picture
Figure 2-7 Process of playing back and downloading video and downloading picture
Video playback by time
Stop video playback
CLIENT_PlayBackByTimeEx
Video CLIENT_StopPlayBack
playback
2
Video
Select one video download Video download Stop video download
or picture CLIENT_DownloadByTimeEx CLIENT_StopDownload
Picture
download Picture download
CLIENT_DownloadRemoteFile
Process Description
Select one result searched by CLIENT_FindNextFileEx, and then download or playback the result.
Playing back the video
Step 1 If is video file, use start time and end time in the video searching result, call
CLIENT_PlayBackByTimeEx2 to playback the video.
Step 2 During the playback process or after playing back, call CLIENT_StopPlayBack to stop
playing back the video.
Download video
Step 1 If is video file, use start time and end time in the video searching result, call
CLIENT_DownloadByTimeEx to download the video.
Step 2 After downloading, call CLIENT_StopDownload to stop downloading the video.
Download the picture
If is picture file, use file name and picture type in the picture searching result, call
CLIENT_DownloadRemoteFile to download the picture.
21
Notes for Process
The video playing back and downloading and picture downloading are all relied on the searching
result of video and picture, and then you can take the result as the condition of playing back and
downloading.
// Searching conditions
MEDIAFILE_FACE_DETECTION_PARAM param;
memset(¶m, 0, sizeof(param));
param.dwSize = sizeof(param);
param.stuDetail.dwSize = sizeof(MEDIAFILE_FACE_DETECTION_DETAIL_PARAM);
param.nChannelID = -1;
param.stuStartTime = startTime;
param.stuEndTime = endTime
param.emPicType = NET_FACEPIC_TYPE_SMALL; // The small picture of people face.
param.bDetailEnable = FALSE;
param.emSex = EM_DEV_EVENT_FACEDETECT_SEX_TYPE_MAN;
param.bAgeEnable = FALSE;
param.nEmotionValidNum = 0;
param.emGlasses = EM_FACEDETECT_WITH_GLASSES;
22
}
// Searching number
int nMaxConut = 10;
MEDIAFILE_FACE_DETECTION_INFO* pMediaFileInfo = NEW MEDIAFILE_FACE_DETECTION_INFO[nMaxConut];
memset (pMediaFileInfo, 0, sizeof (MEDIAFILE_FACE_DETECTION_INFO) * nMaxConut);
for (int i = 0; i < nMaxConut; i++)
{
pMediaFileInfo[i].dwSize = sizeof(MEDIAFILE_FACE_DETECTION_INFO);
}
// Start searching
int nRet = CLIENT_FindNextFileEx(lFindFileHandle, nMaxConut, (void*)pMediaFileInfo, nMaxConut *
sizeof(MEDIAFILE_FACE_DETECTION_INFO), NULL,3000);
if (nRet < 0)
{
printf("CLIENT_FindNextFileEx: failed! Error code: %x.\n", CLIENT_GetLastError());
return;
}
Close searching
CLIENT_FindCloseEx(lFindFileHandle);
// Set the stream type when the video is playing back, here set it as the main stream
int nStreamType = 0; // 0-main and sub stream, 1-main stream, 2-sub stream
CLIENT_SetDeviceMode(lLoginHandle, DH_RECORD_STREAM_TYPE, &nStreamType);
// Set the file type of the video when playing back, here set it as all video.
NET_RECORD_TYPE emFileType = NET_RECORD_TYPE_ALL; // All video
CLIENT_SetDeviceMode(lLoginHandle, DH_RECORD_TYPE, &emFileType);
/ / Start playing back the video
int nChannelID = 0; // Channel number.
NET_IN_PLAY_BACK_BY_TIME_INFO stIn = {0};
NET_OUT_PLAY_BACK_BY_TIME_INFO stOut = {0};
memcpy(&stIn.stStartTime, &stuStartTime, sizeof(stuStartTime));
memcpy(&stIn.stStopTime, &stuStopTime, sizeof(stuStopTime));
stIn.hWnd = hWnd;
stIn.fDownLoadDataCallBack = DataCallBack;
stIn.dwDataUser = NULL;
stIn.cbDownLoadPos = NULL;
stIn.dwPosUser = NULL;
23
stIn.nPlayDirection = emDirection;
stIn.nWaittime = 10000;
LLONG lPlayHandle = CLIENT_PlayBackByTimeEx2(lLoginHandle, nChannelID, &stIn, &stOut);
if (0 == lPlayHandle)
{
printf("CLIENT_PlayBackByTimeEx2: failed! Error code: %x.\n", CLIENT_GetLastError());
}
if (FALSE == CLIENT_StopPlayBack(lPlayHandle))
{
printf("CLIENT_StopPlayBack Failed, lRealHandle[%x]!Last Error[%x]\n" , lPlayHandle,
CLIENT_GetLastError());
}
int main()
{
// Set the video stream type when searching, here set it as the main and sub stream.
int nStreamType = 0; // 0-main and sub stream, 1-main stream, 2-sub stream
CLIENT_SetDeviceMode(lLoginHandle, DH_RECORD_STREAM_TYPE, &nStreamType);
24
stuStopTime.dwMonth = 9;
stuStopTime.dwDay = 18;
25
case 1://Standard video data
break;
case 2: //yuv data
break;
case 3://pcm audio data
break;
default:
break;
}
return 0;
}
DH_IN_DOWNLOAD_REMOTE_FILE stuRemoteFileParm;
memset(&stuRemoteFileParm, 0, sizeof(DH_IN_DOWNLOAD_REMOTE_FILE));
stuRemoteFileParm.dwSize = sizeof(DH_IN_DOWNLOAD_REMOTE_FILE);
stuRemoteFileParm.pszFileName = pInfo->stObjectPic.szFilePath ;
stuRemoteFileParm.pszFileDst = szFileName;
26
3 Face Detection and Recognition
3.2.1 Introduction
A face library includes face picture and face information, supports the adding, deleting, modifying
and searching the face library function.
27
3.2.3 Process
Figure 3-1 Process of face library operation
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
28
Deleting face library: The corresponding value of operation type emOperateType is
NET_FACERECONGNITION_GROUP_DELETE, the corresponding structure is
NET_DELETE_FACERECONGNITION_GROUP_INFO. If you specify GroupID when deleting face
library, the corresponding GroupID of face library is deleted; If you do not specify GroupID, all of
the face libraries are deleted.
enum EM_OPERATION_TYPE
{
FACEDB_DELETE, // Delete
FACEDB_ADD, // Add
FACEDB_MODIFY // Modify
};
// Set the face library ID for deleting.
NET_FACERECONGNITION_GROUP_INFO *pstGroupInfo = m_pstSelectGroup;
NET_IN_OPERATE_FACERECONGNITION_GROUP stuInParam = {sizeof(stuInParam)};
29
NET_OUT_OPERATE_FACERECONGNITION_GROUP stuOutParam = {sizeof(stuOutParam)};
NET_ADD_FACERECONGNITION_GROUP_INFO stuAddGroupInfo = {sizeof(stuAddGroupInfo)};
NET_MODIFY_FACERECONGNITION_GROUP_INFO stuEditGroupInfo = {sizeof(stuEditGroupInfo)};
strncpy(stuAddGroupInfo.stuGroupInfo.szGroupName,pcGroupName,sizeof(stuAddGroupInfo.stuGr
oupInfo.szGroupName)-1);
stuInParam.pOPerateInfo = &stuAddGroupInfo;
break;
}
Modifying the face library
case FACEDB_MODIFY:
{
stuInParam.emOperateType = NET_FACERECONGNITION_GROUP_MODIFY;
stuEditGroupInfo.stuGroupInfo.dwSize = sizeof(stuEditGroupInfo.stuGroupInfo);
stuEditGroupInfo.stuGroupInfo.emFaceDBType = NET_FACE_DB_TYPE_BLACKLIST;
strncpy(stuEditGroupInfo.stuGroupInfo.szGroupName, pcGroupName,
sizeof(stuEditGroupInfo.stuGroupInfo.szGroupName)-1);
strncpy(stuEditGroupInfo.stuGroupInfo.szGroupId, m_stuGroupInfo.szGroupId,
sizeof(stuEditGroupInfo.stuGroupInfo.szGroupId)-1);
30
stuInParam.pOPerateInfo = &stuEditGroupInfo;
break;
}
default:
break;
}
BOOL bRet = CLIENT_OperateFaceRecognitionGroup(m_lLoginID, &stuInParam, &stuOutParam, 5000);
if(FALSE == bRet)
{
printf("CLIENT_OperateFaceRecognition: failed! Error code %x.\n", CLIENT_GetLastError());
return -1;
}
3.3.1 Introduction
The face library includes face information. This function supports adding, deleting, modifying and
searching people face information.
31
3.3.3 Process
Figure 3-2 Process of adding/deleting/modifying/searching people face
Start
Initialize SDK
CLIENT_Init
Start searching
CLIENT_DoFindFaceRecognition
Stop searching
CLIENT_StopFindFaceRecognition
Stop
Process Description
Adding people face to the library: The corresponding value of operation type emOperateType is
NET_FACERECONGNITIONDB_ADD. The input parameter in the structure, pBuffer can save
32
people face you need. You can request and release the resource by yourself. GroupID must be
filled-in. If people add successful, the device returns UID, is also called the only people ID, means
the only people. See pstOutParam -> szUID.
Modify the people face in the library: The corresponding value of operation type
emOperateType is NET_FACERECONGNITIONDB_MODIFY, The input parameter in the structure
pBuffer can save people face you need. You can request and release the resource by yourself.
The GroupID and szUID must be filled-in in the stPersonInfo.
Delete the people face in the library: The corresponding value of operation type
emOperateType is NET_FACERECONGNITIONDB_DELETE. The GroupID and szUID must be
filled-in in the stPersonInfo.
stuInParam.bUsePersonInfoEx = TRUE;
stuInParam.stPersonInfoEx.bySex = 1; // Male
stuInParam.stPersonInfoEx.byIDType = 1; // ID card
stuInParam.stPersonInfoEx.wYear = time.GetYear();
stuInParam.stPersonInfoEx.byMonth = time.GetMonth();
stuInParam.stPersonInfoEx.byDay = time.GetDay();
strncpy(stuInParam.stPersonInfoEx.szPersonName, pstrName,sizeof(stuInParam.stPersonInfoEx.szPersonName)
- 1);
strncpy(stuInParam.stPersonInfoEx.szID, pstrCardID, sizeof(stuInParam.stPersonInfoEx.szID) - 1);
strncpy(stuInParam.stPersonInfoEx.szGroupName, m_szGroupName,
sizeof(stuInParam.stPersonInfoEx.szGroupName) - 1);
strncpy(stuInParam.stPersonInfoEx.szGroupID, m_szGroupId, sizeof(stuInParam.stPersonInfoEx.szGroupID) - 1);
stuInParam.nBufferLen = nPictureBufferLen;
stuInParam.pBuffer = pPictureBuffer;
stuInParam.stPersonInfoEx.wFacePicNum = 1;
stuInParam.stPersonInfoEx.szFacePicInfo[0].dwOffSet = 0;
stuInParam.stPersonInfoEx.szFacePicInfo[0].dwFileLenth = nLength;
33
bRet = CLIENT_OperateFaceRecognitionDB(m_lLoginID, &stuInParam, &stuOutParam, 5000);
if (FACE_PERSON_ADD == m_nOpreateType)
{
printf("CLIENT_OperateFaceRecognitionDB failed! Error code %x.\n", CLIENT_GetLastError());
return -1;
}
stuInParam.stMatchOptions.dwSize = sizeof(stuInParam.stMatchOptions);
stuInParam.stFilterInfo.dwSize = sizeof(stuInParam.stFilterInfo);
stuInParam.bPersonExEnable = TRUE;
stuInParam.stFilterInfo.nRangeNum = 1;
stuInParam.stFilterInfo.szRange[0] = (BYTE)NET_FACE_DB_TYPE_BLACKLIST;
strncpy(stuInParam.stPersonInfoEx.szPersonName, m_PersonName,
sizeof(stuInParam.stPersonInfoEx.szPersonName)-1);
stuInParam.stPersonInfoEx.bySex = 0;
stuInParam.stFilterInfo.stBirthdayRangeStart = BirthdayRangeStart;
stuInParam.stFilterInfo.stBirthdayRangeEnd = BirthdayRangeEnd;
strncpy(stuInParam.stPersonInfoEx.szID, pcCard, sizeof(stuInParam.stPersonInfoEx.szID)-1);
strncpy(stuInParam.stFilterInfo.szGroupId[0], m_szGroupId, sizeof(m_szGroupId)-1);
34
stuInParam.stFilterInfo.nGroupIdNum = 1;
strncpy(stuInParam.stPersonInfoEx.szGroupID, m_szGroupId, sizeof(stuInParam.stPersonInfoEx.szGroupID)-1);
// Start searching
NET_IN_DOFIND_FACERECONGNITION stuInDoFind = {sizeof(stuInDoFind)};
NET_OUT_DOFIND_FACERECONGNITION stuOutDoFind = {sizeof(stuOutDoFind)};
stuOutDoFind.bUseCandidatesEx = TRUE;
stuInDoFind.lFindHandle = m_lFindPersonHandle;
stuInDoFind.emDataType = EM_NEEDED_PIC_TYPE_HTTP_URL;
stuInDoFind.nCount = 10;
stuInDoFind.nBeginNum = m_nCurPos;
bRet = CLIENT_DoFindFaceRecognition(&stuInDoFind, &stuOutDoFind, WAIT_TIMEOUT);
if (!bRet)
{
printf("CLIENT_DoFindFaceRecognition failed! Error code %x.\n", CLIENT_GetLastError());
return;
}
3.4.1 Introduction
Arm by channel, means one channel arm one or multiple face libraries.
Arm by library, means one face library arm one or multiple channels.
These two ways are all arms of face library.
35
Interface Implication
CLIENT_FaceRecognitionDelDisposition Disarm by library.
CLIENT_SetGroupInfoForChannel Arm by channel.
3.4.3 Process
Figure 3-3 Process of arming by channel or library
Start
Initialize SDK
CLIENT_Init
Arm by library
Arm by channel CLIENT_FaceRecognitionPutDisposition
CLIENT_SetGroupInfoForChannel
Disarm by library
CLIENT_FaceRecognitionDelDisposition
Stop
Process Description
Arm by channel and arm by library are two ways of arming the face library.
Arm by channel, means one channel arm multiple face libraries. Arm by library, means multiple
channel arm one face libraries.
36
When arm by channel, call CLIENT_SetGroupInfoForChannel to cover the old configurations.
Disarm by channel, sent the empty arm information.
When arm by library, call CLIENT_FaceRecognitionDelDisposition to disarm some channels.
For example, 3 channels are armed, you can disarm 2 channels, and the other one stay the same.
// Input parameter
NET_IN_SET_GROUPINFO_FOR_CHANNEL stInChannelDeploy =
{ sizeof(NET_IN_SET_GROUPINFO_FOR_CHANNEL)};
stInChannelDeploy.nChannelID = 0;
stInChannelDeploy.nGroupIdNum = 2; // Set the face library number at this channel.
strncpy(stInChannelDeploy.szGroupId[0], strGroupId1, DH_COMMON_STRING_64-1); // Copy the face library
ID.
strncpy(stInChannelDeploy.szGroupId[1], strGroupId2, DH_COMMON_STRING_64-1);
stInChannelDeploy.nSimilaryNum = 2;// The similarity value number, which is equal to people groups.
stInChannelDeploy.nSimilary[0] = 85; // The similarity value at the first face library.
stInChannelDeploy.nSimilary[1] = 90; // The similarity value at the second face library.
// Output parameter
NET_OUT_SET_GROUPINFO_FOR_CHANNEL stOutChannelDeploy =
{ sizeof(NET_OUT_SET_GROUPINFO_FOR_CHANNEL)};
/ / Arm by library
BOOL bRet = CLIENT_SetGroupInfoForChannel(lLoginHandle, &stInChannelDeploy, &stOutChannelDeploy);
if (flase == bRet)
{
printf("CLIENT_SetGroupInfoForChannel: failed! Error code: %x.\n", CLIENT_GetLastError());
}
37
3.4.4.2 Arm by library
// Input parameter
NET_IN_FACE_RECOGNITION_PUT_DISPOSITION_INFO stInFaceRecognitionDeploy =
{ sizeof(NET_IN_FACE_RECOGNITION_PUT_DISPOSITION_INFO};
strncpy(stInFaceRecognitionDeploy.szGroupId, strGroupId, DH_COMMON_STRING_64-1); // Face library that
need to arm
stInFaceRecognitionDeploy.nDispositionChnNum = 2; // Number of video channel that armed
stInFaceRecognitionDeploy.stuDispositionChnInfo[0].nChannelID = 0; // Face library deploy channel.
stInFaceRecognitionDeploy.stuDispositionChnInfo[0].nSimilary = 90; // Similarity value.
stInFaceRecognitionDeploy.stuDispositionChnInfo[1].nChannelID = 2;
stInFaceRecognitionDeploy.stuDispositionChnInfo[1].nSimilary = 85;
// Output parameter
NET_OUT_FACE_RECOGNITION_PUT_DISPOSITION_INFO stOutFaceRecognitionDeploy =
{sizeof(NET_OUT_FACE_RECOGNITION_PUT_DISPOSITION_INFO)};
38
{
printf("CLIENT_FaceRecognitionDelDisposition: failed! Error code: %x.\n", CLIENT_GetLastError());
}
3.5.1 Introduction
You can import a picture and a similarity value, and then the IVSS and NVR devices will search the
history library and the face library by this picture to make sure whether there is the matched face in
the two libraries. And then it will return the right picture.
39
3.5.3 Process
Figure 3-4 Process of searching picture by picture
Start
Initialize SDK
CLIENT_Init
Start searching
CLIENT_DoFindFaceRecognition
Stop searching
CLIENT_StopFindFaceRecognition
Stop
Process Description
40
Step 8 After using the function module, call CLIENT_Logout to logout the device.
Step 9 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
41
m_lFindHandle = stuOutParam.lFindHandle;
if (-1 == stuOutParam.nTotalCount)
{
// When the total searching number is -1, it means the device searching is not completed. You need to
subscribe the progress of device searching.
NET_IN_FACE_FIND_STATE stuInFindState = { sizeof(stuInFindState) };
NET_OUT_FACE_FIND_STATE stuOutFindState = { sizeof(stuOutFindState) };
stuInFindState.nTokenNum = 1;
int nToken = stuOutParam.nToken;
stuInFindState.nTokens = &nToken;
stuInFindState.cbFaceFindState = FaceFindState; // Progress callback function.
stuInFindState.dwUser = (DWORD)this;
m_lAttachHandle = CLIENT_AttachFaceFindState(m_lLoginId, &stuInFindState, &stuOutFindState, 5000);
}
else
{
// Start searching.
DoFind();
}
void DoFind()
{
NET_IN_DOFIND_FACERECONGNITION stuInDoFind = { sizeof(NET_IN_DOFIND_FACERECONGNITION) };
NET_OUT_DOFIND_FACERECONGNITION stuOutDoFind =
{ sizeof(NET_OUT_DOFIND_FACERECONGNITION) };
stuOutDoFind.bUseCandidatesEx = TRUE;
stuInDoFind.nCount = 20; // Search for 20 information one time, the total searching number is more than
20.
stuInDoFind.lFindHandle = m_lFindHandle;
stuInDoFind.emDataType = EM_NEEDED_PIC_TYPE_HTTP_URL;// The returned picture format by
specified searching result is http link.
stuInDoFind.nBeginNum = 0; // Search from 0.
42
CLIENT_StopFindFaceRecognition(m_lFindHandle);
}
43
4 Body Detection
4.2.1 Introduction
For the code of body detection picture searching, see "2.5 Searching/Playbacking/Downloading
Video and Picture". The following section shows the description for body detection picture
downloading.
44
4.2.3 Process
Figure 4-1 Process of body picture searching
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
45
if (bRet == FALSE)
{
MessageBox(ConvertString("Download Failed"), ConvertString("Prompt"));
return;
}
46
5 People Flow Statistics
5.1.1 Introduction
This is the real-time subscribe of flow statistics data function.
You can install the front-end devices in the specified areas to precise statistics the in and out number
of people real-time in each entrance by the intelligent analysis server according to video data
collected by the front-end devices.
You can also get the total in and out number of people in one single day and real-time in and out
number of people.
47
5.1.3 Process
Figure 5-1 Process of subscribing people flow
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
48
// Produce callback data
}
5.3.1 Introduction
You can specify the start time and the end time of people flow information, and then the device end
will send back the searching data to the SDK.
49
5.3.3 Process
Figure 5-2 Searching process of people flow video and picture
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
50
inParam.nGranularityType = 1; // Searching unit, 0: minute, 1: hour, 2: day, 3: week, 4: month, 5: season, 6: year
inParam.nWaittime = 5000; // Time-out for waiting received data
NET_OUT_FINDNUMBERSTAT outParam { sizeof(NET_OUT_FINDNUMBERSTAT)};
LLONG findHnd = CLIENT_StartFindNumberStat(pLoginHandle, &inParam, &outParam);
if (findHand == 0)
{
printf("CLIENT_StartFindNumberStat failed! Error code %x.\n", CLIENT_GetLastError());
return ;
}
// Search
BOOL bRet = CLIENT_DoFindNumberStat(findHand, &inDoFind, &outDoFind)
if (FALSE == bRet)
{
printf("CLIENT_DoFindNumberStat failed! Error code %x.\n", CLIENT_GetLastError());
delete[] outDoFind.pstuNumberStat;
return ;
}
51
6 General Behavior Event
52
7 Intelligent Traffic
7.2.1 Introduction
Search the history data of vehicle flow statistics.
53
Interface Implication
Search data in the current searching
CLIENT_FindNextRecord
condition.
CLIENT_FindRecordClose Stop searching.
7.2.3 Process
Figure 7-1 Searching history data of vehicle flow statistics
Sart
Initialize SDK
CLIENT_Init
Stop
Process Description
54
conditions.
Step 6 After searching, call CLIENT_FindRecordClose to clean up the searching resource.
Step 7 After using the function module, call CLIENT_Logout to logout the device.
Step 8 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
During searching the vehicle flow, at first, the device must support this function and have the
vehicle flow data during the searching time. In addition, the device should have an SD card to
save the vehicle flow data.
The segment of the average speed is -1, which means that no vehicle has passed this period. If it
is more than 1, it means that the average speed of the vehicle. If it is equal to 0, it means that the
average speed is 0.
55
NET_OUT_QUEYT_RECORD_COUNT_PARAM outQueryCountParam =
{ sizeof(NET_OUT_QUEYT_RECORD_COUNT_PARAM) };
NET_IN_FIND_NEXT_RECORD_PARAM stuFindNextInParam =
{sizeof(NET_IN_FIND_NEXT_RECORD_PARAM)};
stuFindNextInParam.lFindeHandle = stuFindOutParam.lFindeHandle;
stuFindNextInParam.nFileCount = nQueryCount;
NET_OUT_FIND_NEXT_RECORD_PARAM stuFindNextOutParam =
{sizeof(NET_OUT_FIND_NEXT_RECORD_PARAM)};
stuFindNextOutParam.pRecordList = pRecordList;
stuFindNextOutParam.nMaxRecordNum = nQueryCount;
bRet = CLIENT_FindNextRecord(&stuFindNextInParam, &stuFindNextOutParam, MAX_TIMEOUT);
if (!bRet)
{
printf("Query record count failed!");
}
// Stop searching.
CLIENT_FindRecordClose(stuFindOutParam.lFindeHandle);
delete[] pRecordList;
56
7.3 Adding/deleting/modifying/searching for Blockist and
Allowlist of Vehicle
7.3.1 Introduction
You can add, delete, modify and search for blocklist and allowlist of vehicle.
57
7.3.3 Process
Figure 7-2 Adding/deleting/modifying/searching blocklist and allowlist of vehicle
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
58
Step 2 Call CLIENT_LoginWithHighLevelSecurity to login the device.
Step 3 Call CLIENT_OperateTrafficList to add the blocklist and allowlist. The enumeration type is
NET_TRAFFIC_LIST_INSERT.
Step 4 Call CLIENT_FindRecord to set searching conditions for blocklist and allowlist. The
enumeration is NET_RECORD_TRAFFICREDLIST (trusted list) and
NET_RECORD_TRAFFICBLACKLIST (blocklist).
Step 5 Call CLIENT_QueryRecordCount to get the total number in the current searching
conditions.
Step 6 Call CLIENT_FindNextRecord to search the specified number of the blocklist and allowlist
in the current searching conditions.
Step 7 Using the blocklist and allowlist you have searched, call CLIENT_OperateTrafficList
blocklist and allowlist. The enumeration is NET_TRAFFIC_LIST_REMOVE (delete) and
NET_TRAFFIC_LIST_UPDATE (modify).
Step 8 After searching, call CLIENT_FindRecordClose to clean up the searching resource.
Step 9 After using the function module, call CLIENT_Logout to logout the device.
Step 10 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
Call CLIENT_OperateTrafficList to add blocklist and allowlist. When the interface returns -1, it
means that do not generate a record list number but not means the interface failed. At first, the
device saves the blocklist and allowlist to the cache, and then saves the data in the cache to the
database. The device returns -1 because at this time the lists have not been added to the database.
59
stInParam.pstOpreateInfo = &stInsertInfo;
// Modify blocklist.
NET_IN_OPERATE_TRAFFIC_LIST_RECORD stInParam = { sizeof(NET_IN_OPERATE_TRAFFIC_LIST_RECORD) };
NET_OUT_OPERATE_TRAFFIC_LIST_RECORD stOutParam =
{ sizeof(NET_OUT_OPERATE_TRAFFIC_LIST_RECORD) };
stInParam.emOperateType = NET_TRAFFIC_LIST_UPDATE;
stInParam.emRecordType = NET_RECORD_TRAFFICBLACKLIST; // Blocklist
//stInParam.emRecordType = NET_RECORD_TRAFFICREDLIST; // Trusted list
60
stInParam.emOperateType = NET_TRAFFIC_LIST_REMOVE;
stInParam.emRecordType = NET_RECORD_TRAFFICBLACKLIST; // Blocklist
//stInParam.emRecordType = NET_RECORD_TRAFFICREDLIST; // Allowlist
stInParam.pstOpreateInfo = &stRemoveRecord;
NET_OUT_OPERATE_TRAFFIC_LIST_RECORD stOutParam =
{ sizeof(NET_OUT_OPERATE_TRAFFIC_LIST_RECORD) };
7.4.1 Introduction
This function will save the capture picture for intelligent event to the storage in the device. You can
search pictures through the plate number and corresponding intelligent events. This function also
supports picture downloading.
For the vehicle picture searching, see "2.5 Searching for/Playbacking/Downloading Video and
Picture". The interface CLIENT_FindFileEx searching type is DH_FILE_QUERY_TRAFFICCAR_EX.
The following shows the interface and example code.
61
7.4.3 Process
Figure 7-3 Process of searching for and downloading picture
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
62
batches.
Step 7 Call CLIENT_StopLoadMultiFile to stop downloading the picture when the value of
dwDownLoadSize in fMultiFileDownLoadPosCB is the maximum value.
Step 8 Call CLIENT_FindCloseEx to stop the searching.
Step 9 After using the function module, call CLIENT_Logout to logout the device.
Step 10 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
// The data of stTrafficPicture is the file searched from CLIENT_FindFileEx. The type is
MEDIAFILE_TRAFFICCAR_INFO_EX.
pDownLoadInfo[i].nFileSize = stTrafficPicture.stuInfo.sizeEx / 1024;
strncpy(pDownLoadInfo[i].szSourceFilePath, stTrafficPicture.stuInfo.szFilePath, MAX_PATH-1);
63
// The save path after downloading
strncpy(pDownLoadInfo[i].szSavedFileName, szFilePathName[i], MAX_PATH-1);
}
64
8 Barrier
8.2.1 Introduction
You can add, delete, modify and search the information of access control card such as the card
number, user ID and card name.
65
8.2.3 Process
Figure 8-1 Adding/deleting/modifying/searching the information of access control card
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
66
Step 3 Call CLIENT_ControlDevice to add the information of access control card. The enumeration
is DH_CTRL_RECORDSET_INSERT.
Step 4 Call CLIENT_FindRecord to set searching conditions for the information of access control
card. The enumeration is NET_RECORD_ACCESSCTLCARD.
Step 5 Call CLIENT_FindNextRecord to search the specified number of the information data of
access control card in the current searching conditions.
Step 6 After searching, call CLIENT_FindRecordClose to clean up the searching resource.
Step 7 Call CLIENT_ControlDevice to modify the information of access control card. The
enumeration is NET_RECORD_ACCESSCTLCARD.
Step 8 Call CLIENT_ControlDevice to delete the information of access control card. The
enumeration is DH_CTRL_RECORDSET_REMOVE.
Step 9 Call CLIENT_ControlDevice to clean up the information of access control card. The
enumeration is DH_CTRL_RECORDSET_CLEAR.
Step 10 After using the function module, call CLIENT_Logout to logout the device.
Step 11 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
When adding the access control card, make sure the CardNo and UserID are different with the
information of access control card which saved in the device before.
When deleting the access control card, and if the access control card binding with people face
picture information, you should delete the information of access control card before deleting
people face picture.
During searching the information of access control card, firstly the device should support this
function, and the device itself should have the information data of access control card.
stuInParam.emType = NET_RECORD_ACCESSCTLCARD;
FIND_RECORD_ACCESSCTLCARD_CONDITION *pStuCardInfo = NEW
FIND_RECORD_ACCESSCTLCARD_CONDITION;
pStuCardInfo->dwSize = sizeof(FIND_RECORD_ACCESSCTLCARD_CONDITION);
stuInParam.pQueryCondition = (void*)pStuCardInfo;
67
}
if (pStuCardInfo)
{
delete pStuCardInfo;
pStuCardInfo = NULL;
}
if (!nRet)
{
printf("CLIENT_FindNextRecord failed \n");
}
// Stop searching.
CLIENT_FindRecordClose(m_lFindHandle);
Control Card
68
NET_RECORDSET_ACCESS_CTL_CARD *pStrCardInfo = NEW NET_RECORDSET_ACCESS_CTL_CARD;
pStrCardInfo->dwSize = sizeof(NET_RECORDSET_ACCESS_CTL_CARD);
strncpy(pStrCardInfo->szCardNo, m_StuAddCardInfo.szCardNo, DH_MAX_CARDNO_LEN - 1);
strncpy(pStrCardInfo->szCardName, m_StuAddCardInfo.szCardName, DH_MAX_CARDNAME_LEN - 1);
strncpy(pStrCardInfo->szUserID, m_StuAddCardInfo.szUserID, DH_MAX_USERID_LEN - 1);
strncpy(pStrCardInfo->szPsw, m_StuAddCardInfo.szPsw, DH_MAX_CARDPWD_LEN - 1);
pStrCardInfo->emStatus = NET_ACCESSCTLCARD_STATE_NORMAL;
pStrCardInfo->emType = NET_ACCESSCTLCARD_TYPE_GENERAL;
pStrCardInfo->nUserTime = m_StuAddCardInfo.nUserTime;
pStrCardInfo->bFirstEnter = TRUE;
pStrCardInfo->bIsValid = TRUE
pStrCardInfo->stuValidStartTime = m_StuAddCardInfo.stuValidStartTime;
pStrCardInfo->stuValidEndTime = m_StuAddCardInfo.stuValidEndTime;
stuInParam.stuCtrlRecordSetInfo.nBufLen = sizeof(NET_RECORDSET_ACCESS_CTL_CARD);
stuInParam.stuCtrlRecordSetInfo.pBuf = (void*)pStrCardInfo;
69
memset(pStrCardInfo, 0, sizeof(NET_RECORDSET_ACCESS_CTL_CARD));
pStrCardInfo->dwSize = sizeof(NET_RECORDSET_ACCESS_CTL_CARD);
strncpy(pStrCardInfo->szCardNo, m_CardInfo.szCardNo, DH_MAX_CARDNO_LEN - 1);
strncpy(pStrCardInfo->szCardName, m_CardInfo.szCardName, DH_MAX_CARDNAME_LEN - 1);
strncpy(pStrCardInfo->szUserID, m_CardInfo.szUserID, DH_MAX_USERID_LEN - 1);
strncpy(pStrCardInfo->szPsw, m_CardInfo.szPsw, DH_MAX_CARDPWD_LEN - 1);
pStrCardInfo->emStatus = NET_ACCESSCTLCARD_STATE_NORMAL;
pStrCardInfo->emType = NET_ACCESSCTLCARD_TYPE_GENERAL;
pStrCardInfo->nUserTime = m_CardInfo.nUserTime;
pStrCardInfo->bFirstEnter = TRUE;
pStrCardInfo->bIsValid =TRUE;
pStrCardInfo->stuValidStartTime = m_CardInfo.stuValidStartTime;
pStrCardInfo->stuValidEndTime = m_CardInfo.stuValidEndTime;
pStrCardInfo->nRecNo = m_CardInfo.nRecNo;
stuInParam.nBufLen = sizeof(NET_RECORDSET_ACCESS_CTL_CARD);
stuInParam.pBuf = (void*)pStrCardInfo;
70
stuInParam.nBufLen = sizeof(int);
BOOL bRet = CLIENT_ControlDevice(m_lLoginID, DH_CTRL_RECORDSET_REMOVE, &stuInParam,
DEFAULT_WAIT_TIME);
if (FALSE == bRet)
{
printf(("CLIENT_ControlDevice delete cardinfo fail\n");
return;
}
/ / Clean up the information of access control card (Delete all information of access control card)
NET_CTRL_RECORDSET_PARAM stuInParam = sizeof(stuInParam);
stuInParam.emType = NET_RECORD_ACCESSCTLCARD;
8.3.1 Introduction
Add, modify, delete and clean up the face picture.
71
8.3.3 Process
Figure 8-2 Adding/deleting/modifying/cleaning up the information of face picture
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
72
Face information cleaning up: Use EM_FACEINFO_OPREATE_CLEAR as the enumeration.
The face information modifying and deleting are according to the UserID of the access control
card.
stuInParam.stuFaceInfo.nFacePhotoLen[0] = nLength;
stuInParam.stuFaceInfo.pszFacePhoto[0] = new char[nLength];
memset(stuInParam.stuFaceInfo.pszFacePhoto[0], 0, nLength);
int nReadLen = fread(stuInParam.stuFaceInfo.pszFacePhoto[0], 1, nLength, fPic);
fclose(fPic);
fPic = NULL;
if (fPic)
{
fclose(fPic);
fPic = NULL;
}
if (stuInParam.stuFaceInfo.pszFacePhoto[0])
{
delete[] stuInParam.stuFaceInfo.pszFacePhoto[0];
73
stuInParam.stuFaceInfo.pszFacePhoto[0] = NULL;
}
/ / Modify the information of face picture
NET_IN_UPDATE_FACE_INFO stuInParam = sizeof(stuInParam);
strncpy(stuInParam.szUserID, m_CardInfo.szUserID, sizeof(m_CardInfo.szUserID) - 1);
stuInParam.stuFaceInfo.nFacePhoto = 1;
fseek(fPic, 0, SEEK_END);
int nLength = ftell(fPic);
rewind(fPic);
stuInParam.stuFaceInfo.nFacePhotoLen[0] = nLength;
stuInParam.stuFaceInfo.pszFacePhoto[0] = new char[nLength];
memset(stuInParam.stuFaceInfo.pszFacePhoto[0], 0, nLength);
int nReadLen = fread(stuInParam.stuFaceInfo.pszFacePhoto[0], 1, nLength, fPic);
fclose(fPic);
fPic = NULL;
NET_OUT_UPDATE_FACE_INFO stuOutParam;
memset(&stuOutParam, 0, sizeof(stuOutParam));
stuOutParam.dwSize = sizeof(stuOutParam);
if (fPic)
{
fclose(fPic);
fPic = NULL;
}
if (stuInParam.stuFaceInfo.pszFacePhoto[0])
{
delete[] stuInParam.stuFaceInfo.pszFacePhoto[0];
74
stuInParam.stuFaceInfo.pszFacePhoto[0] = NULL;
}
NET_OUT_REMOVE_FACE_INFO stuOutParam;
memset(&stuOutParam, 0, sizeof(stuOutParam));
stuOutParam.dwSize = sizeof(stuOutParam);
8.4.1 Introduction
Search the record list of access control. The searching information includes card No., user serial
number, the status of opening the door, card type, the mode of opening the door and time.
75
8.4.2 Interface Overview
Table 8-3 Interfaces of searching the record of in-out the door
Interface Implication
CLIENT_FindRecord Set searching conditions.
Search data in the current searching
CLIENT_FindNextRecord
condition.
CLIENT_FindRecordClose Close searching.
Delete and clean up the record of access
CLIENT_ControlDevice
control.
76
8.4.3 Process
Figure 8-3 Searching/deleting/cleaning up the record of access control
Start
Initialize SDK
CLIENT_Init
Stop
Process Description
77
in the current searching conditions.
Step 5 Call CLIENT_ControlDevice to delete and clean up the record of access control.
Step 6 After searching, call CLIENT_FindRecordClose to clean up the searching resource
Information.
Step 7 After using the function module, call CLIENT_Logout to logout the device.
Step 8 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
78
9 Object Monitoring
79
10 City Management
80
EVENT_IVS_STREET_SUNCURE: Video search of drying along the street
81
11 Parking Space Detection
82
11.3 Subscribing to Designated Parking Space Picture
11.3.1 Overview
Subscribe to or unsubscribe from the designated parking space picture through the designated
channel number and picture ID.
Start
Login
CLIENT_LoginWithHighLevelSecurity
Logout
CLIENT_Logout
End
Process Description
83
Step 2 After successful initialization, call CLIENT_LoginWithHighLevelSecurity to log in to the
device.
Step 3 Call CLIENT_AttachParkingSpaceData to subscribe to the designated parking space picture
from the device.
Step 4 After the subscription is successful, the parking picture reported by the device is obtained
and notified to the user through the fNotifySnapData callback function.
Step 5 After the parking space picture is reported, call CLIENT_DetachParkingSpaceData to
unsubscribe from the designated parking space picture.
Step 6 After using the function module, call CLIENT_Logout to log out of the device.
Step 7 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
84
12 Crowd Map
85
13 Vehicle Density Map
86
14 Heat Map
14.1.1 Overview
Subscribe to or unsubscribe from heat map
Start
Login
CLIENT_LoginWithHighLevelSecurity
fRawStreamCallBack
Subscribe to heat map data
Acquire heat map data through
CLIENT_AttachHeatMapRawStream
callback function
Logout
CLIENT_Logout
End
87
Process Description
14.2.1 Overview
Subscribe to or unsubscribe from gray map
88
14.2.2 Interface Overview
Table 14-2 Interface description of gray map
Interface Description
CLIENT_AttachHeatMapGrayInfo Subscribe to the grayscale data of heat map
CLIENT_DetachHeatMapGrayInfo Unsubscribe to the grayscale data of heat map
Start
Login
CLIENT_LoginWithHighLevelSecurity
fHeatMapGrayCallBack
Subscribe to heat map grayscale data
Acquire heat map grayscale data
CLIENT_AttachHeatMapGrayInfo
through data callback function
Logout
CLIENT_Logout
End
Process Description
89
14.2.4 Example Code
void CALLBACK HeatMapGrayCallBack(LLONG lAttachHandle, NET_CB_HEATMAP_GRAY_INFO*
pstGrayInfo, LDWORD dwUser)
{
// Process the callback data
}
90
15 Stereo Analysis
91
15.3 Subscribing to Video Statistics
15.3.1 Overview
Subscribe to or unsubscribe from the video statistics of stereo analysis.
Start
Login
CLIENT_LoginWithHighLevelSecurity
Logout
CLIENT_Logout
End
Process Description
92
device.
Step 3 Call CLIENT_AttachVideoStatistics to subscibe to real-time people counting statistics from
device.
Step 4 After the subscription is successful, the real-time people counting statistics reported by the
device is notified to the user through the fVideoStatisticsInfoCallBack callback function.
Step 5 After real-time people counting statistics is reported, call CLIENT_DetachVideoStatistics to
unsubscribe from the real-time people counting statistics.
Step 6 After using the function module, call CLIENT_Logout to log out of the device.
Step 7 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
93
16 Interface Definition
16.1.2 CLIENT_Cleanup
Table 16-2 Clean up SDK
Item Description
Name Clean up SDK.
Function void CLIENT_Cleanup()
Parameter None.
Return value None.
Note Call SDK cleanup interface before the process stops.
16.1.3 CLIENT_SetAutoReconnect
Table 16-3 Set reconnection callback
Item Description
Name Set auto reconnection callback.
void CLIENT_SetAutoReconnect(
fHaveReConnect cbAutoConnect,
Function
LDWORD dwUser
);
[in]cbAutoConnect Reconnection callback.
Parameter
[in]dwUser User parameter of disconnection callback.
Return value None.
94
Item Description
Set the reconnection callback interface. If the callback is set as NULL, it will not
Note
connect automatically.
16.1.4 CLIENT_SetNetworkParam
Table 16-4 Set network parameter
Item Description
Name Set the related parameters for network environment.
void CLIENT_SetNetworkParam(
Function NET_PARAM *pNetParam
);
Parameters such as network delay, reconnection
Parameter [in]pNetParam
times and cache size.
Return value None.
Note Adjust the parameters according to the actual network environment.
16.2.1 CLIENT_LoginWithHighLevelSecurity
Table 16-5 Log in with high level security
Item Description
Name Login the device with high level security.
LLONG CLIENT_LoginWithHighLevelSecurity (
NET_IN_LOGIN_WITH_HIGHLEVEL_SECURITY* pstInParam,
Function
NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY* pstOutParam
);
Parameter [in] pstInParam [in] dwSize
[in] szIP
[in] nPort
[in] szUserName
[in] szPassword
[in] emSpecCap
[in] pCapParam
[out] pstOutParam [in]dwSize
[out] stuDeviceInfo
[out] nError
Success: Not 0.
Return value
Failure: 0.
Login the device with high level security.
CLIENT_LoginEx2 can still be used,but there are security risks,so it is highly
Note
recommended to use the latest interface CLIENT_LoginWithHighLevelSecurity
to log in to the device.
95
Table 16-6 Error code and meaning
Error code Meaning
1 Wrong password.
2 The user name does not exist.
3 Login timeout.
4 The account has logged in.
5 The account has been locked.
6 The account is in the blocklist.
7 The device resource is insufficient and the system is busy.
8 Sub connection failed.
9 Main connection failed.
10 Exceeds the maximum allowed number of user connections.
11 Lack avnetsdk or the dependent libraries of avnetsdk.
USB flash disk is not inserted into device, or the USB flash disk information
12
error.
13 The IP at client is not authorized for login.
16.2.2 CLIENT_Logout
Table 16-7 Log out
Item Description
Name Logout the device.
BOOL CLIENT_Logout(
Function LLONG lLoginID
);
Parameter [in]lLoginID Return value of CLIENT_LoginWithHighLevelSecurity.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.3.1 CLIENT_RealPlayEx
Table 16-8 Start the real-time monitoring
Item Description
Name Open the real-time monitoring.
LLONG CLIENT_RealPlayEx(
LLONG lLoginID,
int nChannelID,
Function
HWND hWnd,
DH_RealPlayType rType
);
[in]lLoginID Return value of CLIENT_LoginWithHighLevelSecurity.
Parameter Video channel number is a round number starting
[in]nChannelID
from 0.
96
Item Description
[in]hWnd Window handle valid only under Windows system.
[in]rType Preview type.
Return value Success: Not 0. Failure: 0.
Windows system:
When hWnd is valid, the corresponding window displays picture.
Note
When hWnd is NULL, get the video data through setting a callback and send to
user for treatment.
16.3.2 CLIENT_StopRealPlayEx
Table 16-10 Stop the real-time monitoring
Item Description
Name Stop the real-time monitoring.
BOOL CLIENT_StopRealPlayEx(
Function LLONG lRealHandle
);
Parameter [in]lRealHandle Return value of CLIENT_RealPlayEx.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.3.3 CLIENT_SaveRealData
Table 16-11 Save the real-time monitoring data as file
Item Description
Name Save the real-time monitoring data as file.
97
Item Description
BOOL CLIENT_SaveRealData(
LLONG lRealHandle,
Function
const char *pchFileName
);
[in] lRealHandle Return value of CLIENT_RealPlayEx.
Parameter
[in] pchFileName Save path.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.3.4 CLIENT_StopSaveRealData
Table 16-12 Stop saving the real-time monitoring data as file
Item Description
Name Stop saving the real-time monitoring data as file.
BOOL CLIENT_StopSaveRealData(
Function LLONG lRealHandle
);
Parameter [in] lRealHandle Return value of CLIENT_RealPlayEx.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.3.5 CLIENT_SetRealDataCallBackEx
Table 16-13 Set the callback of real-time monitoring data
Item Description
Name Set the callback of real-time monitoring data.
BOOL CLIENT_SetRealDataCallBackEx(
LLONG lRealHandle,
fRealDataCallBackEx cbRealData,
Function
LDWORD dwUser,
DWORD dwFlag
);
[in] lRealHandle Return value of CLIENT_RealPlayEx.
[in] cbRealData Callback of monitoring data flow.
Parameter [in] dwUser Parameter of callback for monitoring data flow.
Type of monitoring data in callback. The type is
[in] dwFlag
EM_REALDATA_FLAG and supports OR operation.
Return value Success: TRUE. Failure: FALSE.
Note None.
98
16.4 Subscribing to Intelligent Event
16.4.1 CLIENT_RealLoadPictureEx
Table 16-15 Subscribe intelligent event interface
Item Description
Name Subscribe intelligent event interface.
LLONG CLIENT_RealLoadPictureEx(
LLONG lLoginID,
int nChannelID,
DWORD dwAlarmType,
Function BOOL bNeedPicFile,
fAnalyzerDataCallBack cbAnalyzerData,
LDWORD dwUser,
void* Reserved
);
[in] lLoginID Login handle.
[in] nChannelID Channel number.
[in] dwAlarmType Alarm type.
Whether to subscribe picture file, 1-yes, return
intelligent picture information in the callback
Parameter [in] bNeedPicFile function; 0-no, do not return intelligent picture
information(in this case, it can reduce the network
flow).
[in] cbAnalyzerData Intelligent data analysis callback function.
[in] dwUser The user parameters.
[in] Reserved Reserve parameter.
Return value Success: the subscribe handle of LLONG type. Failure: 0.
Note If the interface return failed, call CLIENT_GetLastError to get error code.
99
16.4.2 CLIENT_StopLoadPic
Table 16-17 Stop subscribing intelligent event.
Item Description
Name Stop subscribing intelligent event.
BOOL CLIENT_StopLoadPic(
Function LLONG lAnalyzerHandle
);
Parameter [in] lAnalyzerHandle Event subscribing handle.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.5.1 CLIENT_FindFileEx
Table 16-18 Search files by conditions
Item Description
Name Search files by conditions.
LLONG CLIENT_FindFileEx(
LLONG lLoginID,
EM_FILE_QUERY_TYPE emType,
Function void* pQueryCondition,
void* reserved,
int waittime
);
[in] lLoginID Login handle.
[in] emType Searched file type.
Parameter [in] pQueryCondition Searching conditions.
[in] reserved Reserve bytes.
[in] waittime Waiting time.
Return value Success: the searching handle of LLONG type. Failure: 0.
Note None.
16.5.2 CLIENT_GetTotalFileCount
Table 16-19 Get the number of searched files
Item Description
Name Get the number of searched files.
100
Item Description
BOOL CLIENT_GetTotalFileCount(
LLONG lFindHandle,
int* pTotalCount,
Function
void * reserved,
int waittime
);
[in] lFindHandle Searching handle.
[out] pTotalCount The searched number.
Parameter
[in] reserved Reserve bytes.
[in] waittime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.5.3 CLIENT_FindNextFileEx
Table 16-20 Search a file
Item Description
Name Search a file.
int CLIENT_FindNextFileEx(
LLONG lFindHandle,
int nFilecount,
void* pMediaFileInfo,
Function
int maxlen,
void* reserved,
int waittime
);
[in] lFindHandle Searching handle.
[in] nFilecount The searched file number.
[out] pMediaFileInfo File cache area.
Parameter
[in] maxlen Search for cache size of file array.
[in] reserved Reserve bytes.
[in] waittime Timeout.
Return value Success: File number. Failure: -1. Return 0 means search complete.
Note None.
16.5.4 CLIENT_FindCloseEx
Table 16-21 Stop searching files
Item Description
Name Stop searching files.
BOOL CLIENT_FindCloseEx(
Function LLONG lFindHandle
);
Parameter [in] lFindHandle Searching handle.
Return value Success: TRUE. Failure: FALSE.
101
Item Description
Note None.
16.5.5 CLIENT_PlayBackByTimeEx2
Table 16-22 Start playing back the video
Item Description
Name Start playing back the video.
LLONG CLIENT_PlayBackByTimeEx2(
LLONG lLoginID,
Int nChannelID,
Function
NET_IN_PLAY_BACK_BY_TIME_INFO* pstNetIn,
NET_OUT_PLAY_BACK_BY_TIME_INFO* pstNetOut
);
[in] lLoginID Login handle.
[in] nChannelID Channel number.
Parameter
[in] pstNetIn Playback input parameter.
[out] pstNetOut Playback output parameter.
Return value Success: the playback handle of LLONG type. Failure: 0.
Note None.
16.5.6 CLIENT_StopPlayBack
Table 16-23 Stop playing back the video
Item Description
Name Stop playing back the video.
BOOL CLIENT_StopPlayBack(
Function LLONG lPlayHandle
);
Parameter [in] lPlayHandle Playback handle.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.5.7 CLIENT_DownloadByTimeEx
Table 16-24 Start downloading video
Item Description
Name Start downloading video.
102
Item Description
LLONG CLIENT_DownloadByTimeEx(
LLONG lLoginID,
int nChannelId,
int nRecordFileType,
LPNET_TIME tmStart,
LPNET_TIME tmEnd,
Function
char* sSavedFileName,
fTimeDownLoadPosCallBack cbTimeDownLoadPos,
LDWORD dwUserData,
fDataCallBack fDownLoadDataCallBack,
LDWORD dwDataUser,
void* pReserved = NULL)
[in] lLoginID Login handle.
[in] nChannelId Channel number.
[in] nRecordFileType Video type.
[in] tmStart Start time of video download
[in] tmEnd End time of video download
Storage path of specific video data. if the path is
[in] sSavedFileName
empty, the video data will not be saved.
Parameter [int]
Callback function of video download progress.
cbTimeDownLoadPos
[in] dwUserData Callback user data of video download progress.
[in]
fDownLoadDataCallBa Callback function of video download data.
ck
[in] dwDataUser Callback user data of video download data.
[in] pReserved Reserved parameter.
Return value Success: the playback handle of LLONG type. Failure: 0.
Note None.
16.5.8 CLIENT_StopDownload
Table 16-25 Stop downloading the video
Item Description
Name Stop downloading the video.
BOOL CLIENT_StopDownload(
Function LLONG lFileHandle
);
Parameter [in] lFileHandle Download handle.
Return value Success: TRUE. Failure: FALSE.
Note None.
103
16.5.9 CLIENT_DownloadRemoteFile
Table 16-26 Download files by file name
Item Description
Name Download files by file name.
BOOL CLIENT_DownloadRemoteFile(
LLONG lLoginID,
const DH_IN_DOWNLOAD_REMOTE_FILE* pInParam,
Function
DH_OUT_DOWNLOAD_REMOTE_FILE* pOutParam,
int nWaitTime
);
[in] lLoginID Login handle.
[in] pInParam Download file input parameter.
Parameter
[out] pOutParam Download file output parameter.
[in] nWaitTime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.7.1 CLIENT_OperateFaceRecognitionGroup
Table 16-27 Add, delete and modify the face library
Item Description
Name Add, delete and modify the face library.
BOOL CLIENT_OperateFaceRecognitionGroup(
LLONG lLoginID,
const NET_IN_OPERATE_FACERECONGNITION_GROUP* pstInParam,
Function
NET_OUT_OPERATE_FACERECONGNITION_GROUP *pstOutParam,
int nWaitTime
);
[in] lLoginID Login handle.
[in] pInParam Input parameter.
Parameter
[out] pstOutParam Output parameter.
[in] nWaitTime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
104
16.7.2 CLIENT_FindGroupInfo
Table 16-28 Searching the of face library
Item Description
Name Searching the of face library.
BOOL CLIENT_FindGroupInfo(
LLONG lLoginID,
const NET_IN_FIND_GROUP_INFO* pstInParam,
Function
NET_OUT_FIND_GROUP_INFO *pstOutParam,
int nWaitTime
);
[in] lLoginID Login handle.
[in] pInParam Input parameter.
Parameter
[out] pstOutParam Output parameter.
[in] nWaitTime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.8.1 CLIENT_OperateFaceRecognitionDB
Table 16-29 Add, delete and modify the people face
Item Description
Name Add, delete and modify the people face.
BOOL CLIENT_OperateFaceRecognitionDB(
LLONG lLoginID,
const NET_IN_OPERATE_FACERECONGNITIONDB* pstInParam,
Function
NET_OUT_OPERATE_FACERECONGNITIONDB *pstOutParam,
Int nWaitTime
);
[in] lLoginID Login handle.
[in] pInParam Input parameter.
Parameter
[out] pstOutParam Output parameter.
[in] nWaitTime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.8.2 CLIENT_OperateFaceRecognitionDB
Table 16-30 Set the searching conditions of people face
Item Description
Name Set the searching conditions of people face.
105
Item Description
BOOL CLIENT_StartFindFaceRecognition(
LLONG lLoginID,
const NET_IN_STARTFIND_FACERECONGNITION* pstInParam,
Function
NET_OUT_STARTFIND_FACERECONGNITION *pstOutParam,
int nWaitTime
);
[in] lLoginID Login handle.
[in] pInParam Input parameter.
Parameter
[out] pstOutParam Output parameter.
[in] nWaitTime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.8.3 CLIENT_DoFindFaceRecognition
Table 16-31 Search the face information
Item Description
Name Search the face information.
BOOL CLIENT_DoFindFaceRecognitionRecord(
const NET_IN_DOFIND_FACERECONGNITIONRECORD* pstInParam,
Function NET_OUT_DOFIND_FACERECONGNITIONRECORD *pstOutParam,
int nWaitTime
);
[in] pInParam Input parameter.
Parameter [out] pstOutParam Output parameter.
[in] nWaitTime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.8.4 CLIENT_StopFindFaceRecognition
Table 16-32 Stop searching face information
Item Description
Name Stop searching face information.
BOOL CLIENT_StopFindFaceRecognition(
Function LLONG lFindHandle
);
Parameter [in] lFindHandle Searching handle.
Return value Success: TRUE. Failure: FALSE.
Note None.
106
16.8.5 CLIENT_FaceRecognitionPutDisposition
Table 16-33 Arm by library
Item Description
Name Arm by library.
BOOL CLIENT_FaceRecognitionPutDisposition(
LLONG lLoginID,
const NET_IN_FACE_RECOGNITION_PUT_DISPOSITION_INFO* pstInParam,
Function
NET_OUT_FACE_RECOGNITION_PUT_DISPOSITION_INFO *pstOutParam,
int nWaitTime
);
[in] lLoginID Login handle.
[in] pInParam Input parameter.
Parameter
[out] pstOutParam Output parameter.
[in] nWaitTime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.8.6 CLIENT_FaceRecognitionDelDisposition
Table 16-34 Disarm by library
Item Description
Name Disarm by library.
Function BOOL CLIENT_FaceRecognitionDelDisposition(
LLONG lLoginID,
const NET_IN_FACE_RECOGNITION_DEL_DISPOSITION_INFO* pstInParam,
NET_OUT_FACE_RECOGNITION_DEL_DISPOSITION_INFO *pstOutParam,
int nWaitTime
);
Parameter [in] lLoginID Login handle.
[in] pInParam Input parameter.
[out] pstOutParam Output parameter.
[in] nWaitTime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.8.7 CLIENT_SetGroupInfoForChannel
Table 16-35 Arm by channel
Item Description
Name Arm by channel.
107
Item Description
BOOL CLIENT_SetGroupInfoForChannel(
LLONG lLoginID,
const NET_IN_SET_GROUPINFO_FOR_CHANNEL* pstInParam,
Function
NET_OUT_SET_GROUPINFO_FOR_CHANNEL *pstOutParam,
int WaitTime
);
[in] lLoginID Login handle.
[in] pInParam Input parameter.
Parameter
[out] pstOutParam Output parameter.
[in] nWaitTime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.8.8 CLIENT_AttachFaceFindState
Table 16-36 Subscribe searching progress of people face
Item Description
Name Subscribe searching progress of people face.
LLONG CLIENT_AttachFaceFindState(
LLONG lLoginID,
const NET_IN_FACE_FIND_STATE* pstInParam,
Function
NET_OUT_FACE_FIND_STATE *pstOutParam,
Int nWaitTime
);
[in] lLoginID Login handle.
[in] pInParam Input parameter.
Parameter
[out] pstOutParam Output parameter.
[in] nWaitTime Timeout.
Return value Success: Face progress handle. Failure: 0.
Note None.
16.8.9 CLIENT_DetachFaceFindState
Table 16-37 Cancel subscribing the searching progress of people face
Item Description
Name Cancel Subscribing the searching progress of people face.
BOOL CLIENT_DetachFaceFindState(
Function LLONG lAttachHandle
);
The handle returned by
Parameter [in] lAttachHandle
CLIENT_AttachFaceFindState.
Return value Success: TRUE. Failure: FALSE.
Note None.
108
16.9 Body Detection
16.9.1 CLIENT_DownloadRemoteFile
Table 16-38 Download the picture
Item Description
Name Download the picture.
BOOL CLIENT_DownloadRemoteFile(
LLONG lLoginID,
const DH_IN_DOWNLOAD_REMOTE_FILE* pInParam,
Function
DH_OUT_DOWNLOAD_REMOTE_FILE* pOutParam,
int nWaitTime = 1000
);
[in] lLoginID Login handle.
[in] pInParam Input parameter.
Parameter
[out] pOutParam Output parameter.
[in] nWaitTime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.10.1 CLIENT_AttachVideoStatSummary
Table 16-39 Subscribe flow statistics event
Item Description
Name Subscribe flow statistics event.
LLONG CLIENT_AttachVideoStatSummary(
LLONG lLoginID,
const NET_IN_ATTACH_VIDEOSTAT_SUM* pInParam,
Function
NET_OUT_ATTACH_VIDEOSTAT_SUM* pOutParam,
int nWaitTime
);
[in] lLoginID Login handle.
[in] pInParam Subscribe input parameter of people flow.
Parameter
[out] pOutParam Subscribe output parameter of people flow.
[in] nWaitTime Timeout.
Return value Flow statistics subscribing handle.
Note None.
109
16.10.2 CLIENT_DetachVideoStatSummary
Table 16-40 Cancel subscribing flow statistics event
Item Description
Name Cancel subscribing flow statistics event.
BOOL CLIENT_DetachVideoStatSummary(
Function LLONG lAttachHandle
);
Parameter [in] lAttachHandle Flow statistics subscribing handle.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.10.3 CLIENT_StartFindNumberStat
Table 16-41 Start searching people history data (set searching conditions)
Item Description
Name Start searching people history data (set searching conditions).
LLONG CLIENT_StartFindNumberStat(
LLONG lLoginID,
Function NET_IN_FINDNUMBERSTAT* pstInParam,
NET_OUT_FINDNUMBERSTAT* pstOutParam
);
[in] lLoginID Login handle.
Parameter [in] pstInParam Input searching conditions.
[out] pstOutParam Output query result.
Return value Searching handle.
Note None.
16.10.4 CLIENT_DoFindNumberStat
Table 16-42 Start searching people history data (Set searching conditions)
Item Description
Name Start searching people history data (Set searching conditions).
int CLIENT_DoFindNumberStat(
LLONG lFindHandle,
Function NET_IN_DOFINDNUMBERSTAT* pstInParam,
NET_OUT_DOFINDNUMBERSTAT* pstOutParam
);
[in] lLoginID Login handle.
Parameter [in] pInParam Searching input parameter.
[out] pstOutParam Searching output parameter.
Return value Searching number.
Note None.
110
16.10.5 CLIENT_StopFindNumberStat
Table 16-43 Stop searching history data
Item Description
Name Stop searching history data.
BOOL CLIENT_StopFindNumberStat(
Function LLONG lFindHandle
);
Parameter [in] lFindHandle Searching handle.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.11.1 CLIENT_FindRecord
Table 16-44 Start searching data (Set searching conditions)
Item Description
Name Start searching data (Set searching conditions).
BOOL CLIENT_FindRecord(
LLONG lLoginID,
NET_IN_FIND_RECORD_PARAM* pInParam,
Function
NET_OUT_FIND_RECORD_PARAM* pOutParam,
int waittime=1000
);
[in] lLoginID Login handle.
Parameter [in] pInParam Input searching conditions.
[out] pOutParam Output query result.
Return value Searching handle.
Note None.
16.11.2 CLIENT_QueryRecordCount
Table 16-45 Search the total number of data
Item Description
Name Search the total number of data.
BOOL CLIENT_QueryRecordCount(
NET_IN_QUEYT_RECORD_COUNT_PARAM* pInParam,
Function NET_OUT_QUEYT_RECORD_COUNT_PARAM* pOutParam,
int waittime=1000
);
[in] pInParam Searching input parameter.
Parameter [out] pOutParam Searching output parameter.
[in] waittime Timeout.
111
Item Description
Return value Success: TRUE. Failure: FALSE.
Note None.
16.11.3 CLIENT_FindNextRecord
Table 16-46 Search the data of specified number
Item Description
Name Search the data of specified number.
int CLIENT_FindNextRecord(
NET_IN_FIND_NEXT_RECORD_PARAM* pInParam,
Function NET_OUT_FIND_NEXT_RECORD_PARAM* pOutParam,
int waittime=1000
);
[in] pstInParam Searching input parameter.
Parameter [out] pstOutParam Searching output parameter.
[in] waittime Timeout.
Return value Searching number.
Note None.
16.11.4 CLIENT_FindRecordClose
Table 16-47 Stop searching vehicle flow
Item Description
Name Stop searching vehicle flow.
BOOL CLIENT_FindRecordClose(
Function LLONG lFindHandle
);
Parameter [in] lFindHandle Searching handle.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.11.5 CLIENT_OperateTrafficList
Table 16-48 Add, delete and modify the blocklist and allowlist
Item Description
Name Add, delete and modify the blocklist and allowlist.
BOOL CLIENT_OperateTrafficList(
LLONG lLoginID ,
Function NET_IN_OPERATE_TRAFFIC_LIST_RECORD* pstInParam ,
NET_OUT_OPERATE_TRAFFIC_LIST_RECORD *pstOutParam ,
int waittime)
[in] lLoginID Login handle.
[in] pstInParam Input parameter for blocklist and allowlist operation.
Parameter
Output parameter for blocklist and allowlist
[out] pstOutParam
operation.
112
Item Description
[in] waittime Timeout.
Return value Success: TRUE. Failure: FALSE.
NET_TRAFFIC_LIST_INSERT// Add record
Note NET_TRAFFIC_LIST_UPDATE// Update record
NET_TRAFFIC_LIST_REMOVE// Delete record
16.11.6 CLIENT_DownLoadMultiFile
Table 16-49 Download files in batches
Item Description
Name Download files in batches.
BOOL CLIENT_DownLoadMultiFile(
LLONG lLoginID,
NET_IN_DOWNLOAD_MULTI_FILE *pstInParam,
Function
NET_OUT_DOWNLOAD_MULTI_FILE *pstOutParam,
int waittime=1000
);
[in] lLoginID Login handle.
[in] pstInParam Searching input parameter.
Parameter
[out] pstOutParam Searching output parameter.
[in] waittime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.11.7 CLIENT_StopLoadMultiFile
Table 16-50 Stop downloading files in batches
Item Description
Name Stop downloading files in batches.
BOOL CLIENT_StopLoadMultiFile(
Function LLONG lDownLoadHandle
);
Parameter [in] lDownLoadHandle Download handle in batches.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.12.1 CLIENT_FindRecord
Table 16-51 Start searching data (Set searching conditions)
Item Description
Name Start searching data (Set searching conditions).
113
Item Description
BOOL CLIENT_FindRecord(
LLONG lLoginID,
NET_IN_FIND_RECORD_PARAM* pInParam,
Function
NET_OUT_FIND_RECORD_PARAM* pOutParam,
int waittime=1000
);
[in] lLoginID Login handle.
Parameter [int] pInParam Input searching conditions.
[out] pOutParam Output query result.
Return value Searching handle.
Note None.
16.12.2 CLIENT_FindNextRecord
Table 16-52 Search the data of specified number
Item Description
Name Search the data of specified number.
int CLIENT_FindNextRecord(
NET_IN_FIND_NEXT_RECORD_PARAM* pInParam,
Function NET_OUT_FIND_NEXT_RECORD_PARAM* pOutParam,
int waittime=1000
);
[int] pstInParam Searching input parameter.
Parameter [out] pstOutParam Searching output parameter.
[in] waittime Timeout.
Return value Searching number.
Note None.
16.12.3 CLIENT_FindRecordClose
Table 16-53 Stop searching
Item Description
Name Stop searching.
BOOL CLIENT_FindRecordClose(
Function LLONG lFindHandle
);
Parameter [in] lFindHandle Searching handle.
Return value Success: TRUE. Failure: FALSE.
Note None.
114
16.12.4 CLIENT_FindRecordClose
Table 16-54 Operate records of personnel and access conmtrol
Item Description
You can add, delete, modify, search and clean up the people information. You
Name
can also delete and clean up access control record.
BOOL CLIENT_ControlDevice(
LLONG lLoginID ,
CtrlType type ,
Function
void *param ,
int waittime = 1000
);
[in] lLoginID Login handle.
[in] type Control type.
Parameter
[in] param Control parameter, according to different types.
[in] waittime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
16.12.5 CLIENT_FindRecordClose
Table 16-55 Add, delete, modify and clean up the information of face picture
Item Description
Name Add, delete, modify and clean up the information of face picture.
BOOL CLIENT_FaceInfoOpreate(
LLONG lLoginID,
EM_FACEINFO_OPREATE_TYPE emType,
Function void* pInParam,
void* pOutParam,
int nWaitTime = 1000
);
[in] lLoginID Login handle.
[in] emType Control type.
Control parameter, select different structures
[in] pInParam
Parameter according to different types.
Return parameter, select different structures
[out] pOutParam
according to different types.
[in] waittime Timeout.
Return value Success: TRUE. Failure: FALSE.
Note None.
115
16.13 Parking Space Detection
116
Item Description
LLONG CLIENT_AttachHeatMapRawStream (
LLONG lLoginID,
const NET_IN_RAWSTREAM_ATTACH_INFO *pInParam,
Function
NET_OUT_RAWSTREAM_ATTACH_INFO *pOutParam,
int nWaitTime
);
[in] lLoginID Login handle
[in] pInParam Subscribe to input parameter of heat map
Parameter
[in] nWaitTime Timeout duration
[out] pOutParam Subscribe to output parameter of heat map
Return value Heat map subscription handle
Description —
117
16.14.4 Unsubscribing from Gray Map Data
Table 16-61 Unsubscribe from gray map data
Item Description
Name Unsubscribe from heat map grayscale data
BOOL CLIENT_DetachHeatMapGrayInfo(
Function LLONG lAttachHandle,
);
Parameter [in] lAttachHandle Subscription handle
Return value Return TRUE for success, and return FALSE for failure
Note —
118
17 Callback Function Definition
17.1 fDisConnect
Table 17-1 Disconnection callback
Item Description
Name Disconnection callback.
typedef void (CALLBACK *fDisConnect)(
LLONG lLoginID,
char* pchDVRIP,
Function
LONG nDVRPort,
LDWORD dwUser
);
[out] lLoginID Return value of CLIENT_LoginWithHighLevelSecurity.
[out] pchDVRIP Device IP.
Parameter
[out] nDVRPort Device port.
[out] dwUser User parameter of callback.
Return value None.
Note None.
17.2 fHaveReConnect
Table 17-2 Reconnection callback
Item Description
Name Reconnection callback.
typedef void (CALLBACK *fHaveReConnect)(
LLONG lLoginID,
char* pchDVRIP,
Function
LONG nDVRPort,
LDWORD dwUser
);
[out] lLoginID Return value of CLIENT_LoginWithHighLevelSecurity.
[out] pchDVRIP Device IP.
Parameter
[out] nDVRPort Device port.
[out] dwUser User parameter of callback.
Return value None.
Note None.
119
17.3 fRealDataCallBackEx
Table 17-3 Callback of real-time monitoring data
Item Description
Name The callback of real-time monitoring data.
typedef void (CALLBACK *fRealDataCallBackEx)(
LLONG lRealHandle,
DWORD dwDataType,
BYTE* pBuffer,
Function
DWORD dwBufSize,
LONG param,
LDWORD dwUser
);
[out] lRealHandle Return value of CLIENT_RealPlayEx.
[out] dwDataType Data type, 0-original data, 2-YUV data.
[out] pBuffer Monitor block data address.
[out] dwBufSize Monitor the length of block data, unit: byte.
Callback data parameter structure, the types are
Parameter different according to different value of dwDataType.
When dwDataType is 0, param is the empty
[out] param
pointer.
When dwDataType is 2, param is the
tagCBYUVDataParam structure pointer.
[out] dwUser User parameter of callback.
Return value None.
Note None.
17.4 fAnalyzerDataCallBack
Table 17-4 Intelligent event callback
Item Description
Name Intelligent event callback.
typedef int (CALLBACK *fAnalyzerDataCallBack)(
LLONG lAnalyzerHandle,
DWORD dwAlarmType,
void* pAlarmInfo,
BYTE* pBuffer,
Function
DWORD dwBufSize,
LDWORD dwUser,
int nSequence,
void* reserved
);
[out] lAnalyzerHandle Return value of CLIENT_RealLoadPictureEx.
Parameter [out] dwAlarmType Intelligent event type.
[out] pAlarmInfo Event information cache.
120
Item Description
[out] pBuffer Picture cache.
[out] dwBufSize Picture cache size.
[out] dwUser User data.
nSequence is 0, it means the first time appears.
nSequence is 2, it means only appears once or
[out] nSequence the last time appears.
nSequence is 1, it means after this time there is
always one or multiple times.
[out] reserved Reserve.
Return value None.
Note None.
17.5 fDownLoadPosCallBack
Table 17-5 Callback of playback and download by file
Item Description
Name Playback or download progress calling back function by files.
typedef void (CALLBACK *fDownLoadPosCallBack)(
LLONG lPlayHandle,
DWORD dwTotalSize,
Function
DWORD dwDownLoadSize,
LDWORD dwUser
);
[out]lPlayHandle Playback or download return value of interface.
[out]dwTotalSize Total size, unit: KB.
Downloaded size, unit: KB.
Parameter
[out]dwDownLoadSize -1: This time playback complete.
-2: Write file failed.
[out]dwUser User data.
Return value None.
Note None.
17.6 fDataCallBack
Table 17-6 Callback of playback and download data
Item Description
Name Playback or download data callback function.
121
Item Description
typedef int (CALLBACK *fDataCallBack)(
LLONG lRealHandle,
DWORD dwDataType,
Function BYTE *pBuffer,
DWORD dwBufSize,
LDWORD dwUser
);
[out]lPlayHandle Playback or download return value of interface.
[out] dwDataType Is 0 (original data).
Parameter [out] pBuffer Data cache.
[out] dwBufSize cache length, unit: byte.
[out] dwUser User data.
Return value None.
Note None.
17.7 fFaceFindState
Table 17-7 Callback of face searching progress
Item Description
Name Face searching progress callback function.
typedef void (CALLBACK *fFaceFindState)(
LLONG lLoginID,
LLONG lAttachHandle,
Function NET_CB_FACE_FIND_STATE* pstStates,
int nStateNum,
LDWORD dwUser
);
[out] lLoginID Return login handle.
[out] lAttachHandle Event subscribing handle.
Parameter [out] pstStates Status information of searching the people face.
[out] nStateNum Searching progress of people face.
[out] dwUser User data.
Return value None.
Note None.
17.8 fVideoStatSumCallBack
Table 17-8 Callback of subscribing people flow event
Item Description
Name People flow event subscribing callback.
122
Item Description
typedef void (CALLBACK *fVideoStatSumCallBack) (
LLONG lAttachHandle,
NET_VIDEOSTAT_SUMMARY* pBuf,
Function
DWORD dwBufLen,
LDWORD dwUser
);
[out] lAttachHandle Flow statistics subscribing handle.
[out] pBuf Flow statistics return data.
Parameter
[out] dwBufLen Data Length returned.
[out] dwUser User data.
Return value None.
Note None.
17.9 fMultiFileDownLoadPosCB
Table 17-9 Download file progress callback function in batches.
Item Description
Name Download file progress callback function in batches.
typedef void (CALLBACK *fMultiFileDownLoadPosCB)(
LLONG lDownLoadHandle,
DWORD dwID,
DWORD dwFileTotalSize,
Function DWORD dwDownLoadSize,
int nError,
LDWORD dwUser,
void* pReserved
);
[out] lDownLoadHandle Download file handle in batches.
[out] dwID ID is dwFileID set by user.
[out] dwFileTotalSize Total size of downloaded file.
File size that have downloaded, when this value is
[out] dwDownLoadSize
the max value, it means download completed.
Parameter
Download error: 1-cache lack, 2-check error for
[out] nError return data, 3-download the current file failed,
4-create file failed.
[out] dwUser User data.
[out] pReserved Reserve bytes.
Return value None.
Note None.
123
17.10 fNotifySnapData
Table 17-10 Callback function of designated parking space picture
Item Description
Name Callback function of designated parking space picture
typedef int (CALLBACK *fNotifySnapData) (
LLONG lParkingHandle,
NET_CB_PARKINGSPACE_DATA* pDiagnosisInfo,
Function void* pBuf,
int nBufLen,
LDWORD dwUser
);
[out] lParkingHandle Subscription handle of parking space picture
[out] pDiagnosisInfo Returned data of parking space picture
Parameter [out] pBuf Data buffer
[out] nBufLen Buffer length
[out] dwUser User data
Return value —
Note —
17.11 fRawStreamCallBack
Table 17-11 Callback function of original heat map data
Item Description
Name Callback function of original heat map data
typedef void(CALLBACK *fRawStreamCallBack) (
LLONG lAttachHandle,
NET_RAWSTREAM_NOTIFY_INFO* pBuf,
Function
DWORD dwBufLen,
LDWORD dwUser
);
[out] lAttachHandle Subscription handle of original heat map data
[out] pBuf Return the original heat map data
Parameter
[out] dwBufLen Length of returned data
[out] dwUser User data
Return value —
Note —
17.12 fHeatMapGrayCallBack
Table 17-12 Callback function of heat map grayscale data
Item Description
Name Callback function of heat map grayscale data
124
Item Description
typedef void(CALLBACK *fHeatMapGrayCallBack) (
LLONG lAttachHandle,
Function NET_CB_HEATMAP_GRAY_INFO* pstGrayInfo,
LDWORD dwUser
);
[out] lAttachHandle Subscription handle of heat map grayscale data
Parameter [out] pstGrayInfo Return the grayscale data
[out] dwUser User data
Return value —
Note —
17.13 fVideoStatisticsInfoCallBack
Table 17-13 Callback function of the video statistics
Item Description
Name Callback function of video statistics
typedef void(CALLBACK *fVideoStatisticsInfoCallBack) (
LLONG lAttachHandle,
NET_EM_VS_TYPE emType,
Function void* pBuf,
DWORD nBufLen,
LDWORD dwUser
);
[out] lAttachHandle Subscription handle of video statistics
[out] emType Business type
Parameter [out] pBuf Data buffer
[out] nBufLen Buffer length
[out] dwUser User data
Return value —
Note —
125
Appendix 1 Cybersecurity Recommendations
The necessary measures to ensure the basic cyber security of the platform:
1. Use Strong Passwords
Please refer to the following suggestions to set passwords:
The length should not be less than 8 characters.
Include at least two types of characters; character types include upper and lower case
letters, numbers and symbols.
Do not contain the account name or the account name in reverse order.
Do not use continuous characters, such as 123, abc, etc.
Do not use overlapped characters, such as 111, aaa, etc.
2. Customize the Answer to the Security Question
The security question setting should ensure the difference of answers, choose different
questions and customize different answers (all questions are prohibited from being set to the
same answer) to reduce the risk of security question being guessed or cracked.
Recommendation measures to enhance platform cyber security:
1. Enable Account Binding IP/MAC
It is recommended to enable the account binding IP/MAC mechanism, and configure the
IP/MAC of the terminal where the commonly used client is located as allowlist to further
improve access security.
2. Change Password Regularly
We suggest that you change passwords regularly to reduce the risk of being guessed or cracked.
3. Turn On Account Lock Mechanism
The account lock function is enabled by default at the factory, and it is recommended to keep it
on to protect the security of your account. After the attacker has failed multiple password
attempts, the corresponding account and source IP will be locked.
4. Reasonable Allocation of Accounts and Permissions
According to business and management needs, reasonably add new users, and reasonably
allocate a minimum set of permissions for them.
5. Close Non-essential Services and Restrict the Open Form of Essential Services
If not needed, it is recommended to turn off NetBIOS (port 137, 138, 139), SMB (port 445),
remote desktop (port 3389) and other services under Windows, and Telnet (port 23) and SSH
(port 22) under Linux. At the same time, close the database port to the outside or only open to a
specific IP address, such as MySQL (port 3306), to reduce the risks faced by the platform.
6. Patch the Operating System/Third Party Components
It is recommended to regularly detect security vulnerabilities in the operating system and
third-party components, and apply official patches in time.
7. Security Audit
Check online users: It is recommended to check online users irregularly to identify whether
there are illegal users logging in.
View the platform log: By viewing the log, you can get the IP information of the attempt to
log in to the platform and the key operation information of the logged-in user.
126
8. The Establishment of a Secure Network Environment
In order to better protect the security of the platform and reduce cyber security risks, it is
recommended that:
Follow the principle of minimization, restrict the ports that the platform maps externally by
firewalls or routers, and only map ports that are necessary for services.
Based on actual network requirements, separate networks: if there is no communication
requirement between the two subnets, it is recommended to use VLAN, gatekeeper, etc. to
divide the network to achieve the effect of network isolation.
127