Hikvision DeepinMind integration: what the SDK package actually contains

AI work runs over HTTP here. The package ships 287 ISAPI URIs and 340 message schemas, no function reference, and the AI endpoints in a second appendix.

Four interfaces, and which document each one needs

A DeepinMind recorder can be integrated over four interfaces, and they are not alternatives to each other. They cover different layers.

Interface Transport What it is for Where the documentation is
Device Network SDK Proprietary TCP, port 8000, or 8443 with TLS Login, live view, playback, two-way audio, PTZ, alarm callback, and a tunnel that carries text protocol 17 developer guides and 4 headers inside the package
ISAPI HTTP on 80 or HTTPS on 443, Digest auth Configuration and AI features, exchanged as XML or JSON Appendices E to H of the General guide, plus licence-gated per-line documents
ISUP Outbound registration to a platform server, port 1024 to 65535 The device dials out, so no inbound port is needed Section 4.2.3 of the NVR user manual
ONVIF Discovery on 3702, profiles S and G Third-party camera access, not recorder analytics The ONVIF profile specification

The documentation is not one thing. Three artefacts get called the documentation: a function reference for the SDK, a protocol reference for the device, and change logs. The download contains the second and third. It does not contain the first, which is the one people go looking for first.

Hikvision states its own preference on the SDK download page. The description of Device Network SDK reads that it supports remote access and control and provides dynamic link libraries, developer guides and sample code in C++, C# and Java, and then adds that while the tool can be used for functional testing, API integration is recommended for new projects to ensure better compatibility and maintainability. That sentence is worth reading twice, because it tells you the SDK is positioned as a testing and legacy tool, not as the recommended path for new work.

What the download actually is

The current package is Device Network SDK V6.1.11.40, build 20260922. It comes in four builds: Win64 at 297.83 MB, Win32 at 263.10 MB, Linux32 at 64.47 MB and Linux64 at 67.81 MB. A separate WebSDK is published as V3.3.1.0 dated 2023/10/30 at 17.53 MB, for browser-side development.

We downloaded the Linux64 build and unpacked it. It holds 419 entries.

Part Contents
incEn Four headers: DataType.h, DecodeCardSdk.h, HCNetSDK.h, plaympeg4.h
lib 14 shared objects including libhcnetsdk.so, libHCCore.so, libPlayCtrl.so, plus a HCNetSDKCom directory with 17 more files and OpenSSL 3
doc 17 developer guide PDFs, plus three open source licence files and a readme
consoleDemo A C++ console sample, 16 source files
LinuxJavaDemo A Java sample that reaches the SDK through JNA
QtDemo A Qt desktop sample
psdatacall_demo A sample for the PS data callback

The 17 guides are split by business area, not by function, and they carry seven different version numbers, from V6.0.X.X for fisheye and heat map to V6.1.7.X for General, information release, person-based access control and video intercom, inside a package labelled V6.1.11.40. The General guide alone is 1466 pages.

HCNetSDK.h alone is 51,991 lines. The header is the only place where structures and constants are defined, and it ships in the same archive as the documentation, so the two can be diffed against each other when a guide is vague.

The Linux readme answers a question that costs people an afternoon. libhcnetsdk.so depends on libraries in the HCNetSDKCom directory, so that directory has to be on the loader path. The readme gives four ways: export LD_LIBRARY_PATH with the HCNetSDKCom path, add the path to /etc/ld.so.conf and run ldconfig, install the libraries under /lib64, or pass -Wl,-rpath in the makefile and link every library explicitly. It lists the link names for that last option, from -lhcnetsdk and -lHCCore through -lHCPreview, -lHCAlarm, -lHCPlayBack and -lanalyzedata. It also says plainly that keeping the libraries in one directory is the preferred arrangement.

The protocol reference is in the box, in four appendices

This is the part that is easy to miss. The General guide has eight appendices, and four of them are a complete text protocol reference, not a tutorial.

Appendix Contents Pages
E, Request URIs 287 URIs from E.1 to E.287, in 415 method tables: 245 GET, 126 PUT, 23 POST, 20 DELETE, and one table that covers GET or POST 772 to 954
F, Request and Response Messages 340 message schemas: 182 XML and 158 JSON 955 to 1364
G, Response Codes of Text Protocol 7 status classes and 697 code values 1365 to 1403
H, Error Codes Categorized by Functional Modules 20 functional modules and 191 code values, each with a debugging suggestion 1404 to the end

Every entry in Appendix E has the same shape. It names a method, a one line description, a query field, a request message and a response message. The message names are the pointers into Appendix F, where the nodes, types and optional flags are defined. Appendix G splits response codes by status class, from OK through Device Busy, Device Error, Invalid Operation, Invalid Message Format and Invalid Message Content to Reboot Required. Appendix H does the same by module, with the range stated for each one.

Together E and F run from page 772 to page 1364. That is 593 pages of protocol reference, inside a 1466 page guide, shipped in a 67.81 MB archive. For comparison, the AI Open Platform guide that covers the analytics is 243 pages.

The 287 URIs split across 13 root paths.

Root path URIs Covers
/ISAPI/System 129 Device info, time, users, network, storage, upgrade, maintenance
/ISAPI/ContentMgmt 42 Recording search and download, tracks, HDD and SSD management
/ISAPI/Security 33 Users, permissions, authentication
/ISAPI/Event 24 Event capability, arming schedules, trigger linkage, audio and light alarms
/ISAPI/Image 20 Image and OSD parameters
/ISAPI/PTZCtrl 14 PTZ position, presets, patrols, zoom and focus
/ISAPI/MasterSlaveTracking 9 Linked tracking between devices
/ISAPI/SDT 5 Smart data transfer, including intelligent search
/ISAPI/Streaming 4 Encoding parameters and VCA rule overlay
/ISAPI/Thermal 3 Temperature measurement
/ISAPI/AUXInfo 2 Channel attributes
/ISAPI/Intelligent 1 Event type shielding per channel
/ISAPI/Traffic 1 OCR scene capability

One caveat about counting. The appendix is a curated set, not a dump of every endpoint a firmware implements. It documents the configuration surface that the SDK is expected to expose, and the device may answer on paths that are not listed here.

There is no function reference

This is the gap people hit on day one.

HCNetSDK.h declares 839 NET_DVR_API entry points, which resolve to 822 unique function names, because 14 of them are declared twice to cover the Windows and Linux branches. Of those 839 declarations, 52 have a comment block immediately above them. The other 787 have nothing. The header gives you the signature, the parameter types and the structure definitions. It does not give you units, valid ranges, defaults, or what happens on failure.

So the function level documentation is the 17 guides, and each function is described in the guide for its business area. Login, live view, playback, PTZ, recording and general configuration are in General. ANPR, access control, fisheye, heat map, information release, multi-target-type detection, people counting, person arming, queue management, security control, thermal, traffic and video intercom each have their own guide. There is no master index that maps a function name to a page. The table of contents of the right guide is the index, which means knowing which business area a function belongs to before you can look it up.

Two practical consequences. A signature read out of the header is enough to compile against and not enough to call correctly, because the buffer sizes and the reserved fields are explained in prose. And when the header and a guide disagree, the header is what the linker will enforce and the guide is what the device will actually do.

The AI features are HTTP endpoints, not SDK calls

This is the part that changes how a project is scoped. The SDK exposes one generic function for text protocol:

BOOL NET_DVR_STDXMLConfig(
  LONG                            lUserID,
  const NET_DVR_XML_CONFIG_INPUT  *lpInputParam,
  NET_DVR_XML_CONFIG_OUTPUT       *lpOutputParam
);

Everything the AI Open Platform can do is reached through that function, by passing a request URI with a JSON body. The guide says so in its own words: call NET_DVR_STDXMLConfig to transmit the request URI, over and over, for every single function. Every AI Open Platform URI ends in ?format=json.

That function is not an AI feature. It is the general bridge between the SDK and the text protocol, and the General guide uses it 347 times to describe configuration that has nothing to do with analytics: PTZ, image parameters, event schedules, user accounts. The pattern in the guide is always the same sentence, call NET_DVR_STDXMLConfig to transmit the request URI, followed by the method, the URI and the message name. Which means most of what the SDK can configure is also reachable as a plain HTTP request.

Two consequences follow.

First, the AI functions are not SDK-bound. They are HTTP requests carrying JSON. If a system already speaks HTTP with Digest authentication, it can configure algorithm models, rules and tasks without linking a single shared object. The SDK is needed for the alarm push channel and for streaming, not for the AI configuration itself.

Second, the SDK does not wrap or abstract the protocol. It transports it. That means the error handling you get from the SDK is transport-level: a failed call returns FALSE and NET_DVR_GetLastError gives you one of the SDK error codes. Whether the device accepted the JSON is a separate question, answered in the response body, in the code space described by Appendix G and Appendix H rather than by Appendix D.

For the authentication handshake itself, we keep a separate note on Digest and the other auth models used by Chinese devices rather than repeating it here.

The default format is XML, not JSON

The AI Open Platform is all JSON, which sets a false expectation for the rest of the protocol.

Layer URIs JSON
AI Open Platform, Appendix D 42 42
General configuration, Appendix E 287 142

142 of the 287 general URIs carry ?format=json. The other 145 are XML, and their response column names a message such as XML_StreamingChannel or XML_Schedule instead of a JSON document. Appendix F reflects the split: 182 XML schemas against 158 JSON ones.

That 142 is worth a note on method, because the same appendix yields 89 if you count headings instead of tables. The section headings wrap long URIs at the question mark, so on 53 sections the format flag sits on the following line and a line by line scan misses it. Counting the table headers, where each URI is printed whole, gives 142 sections and 189 method tables. The companion page on the URI and message index lists all 287 with their flags, and explains the four defects in the appendix.

A team that has only worked with the AI endpoints will assume the device returns JSON and get an XML document on the first configuration call. The format is a query parameter on the URI, not a header, and it is not universal.

The interface map

Appendix D of the AI Open Platform guide lists 42 request URIs. They fall into eight functional groups plus two root endpoints.

Group URIs What it manages
algorithmModel 12 Model packages and engines: preset, upload, progress, bind, unbind, reset, status, storage space
AIRuleConfig 7 AI rules per task and channel, plus rule linkage and configuration status
AITargetBP 6 Reference picture libraries used for target comparison: capture, upload, download, rename, batch delete
videoTask 3 Live video analysis tasks
videoPollingAnalysisTask 3 Tasks that rotate through channels on a timer
pictureTask 3 Submitted picture analysis tasks
picturePollingAnalysisTask 3 Captured picture polling tasks
historyVideoTask 3 Analysis of recorded video
Root endpoints 2 Device capability, and device computing power

The groups are the surface. What the four identifiers mean, and the order the calls have to run in, from a package your platform names through an engine binding to a task that must be applied before it detects anything, is covered in the AI Open Platform API guide.

None of these 42 appear in Appendix E of the General guide, and none of the 287 appear in Appendix D of the AI guide. The two references are disjoint, which is why a project needs both: one for the recorder, one for the analytics.

The engine is a first-class object in the interface, not an internal detail. There are four URIs that address it directly:

GET  /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/engines?format=json
GET  /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/engine/{ID}?format=json
PUT  /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/engine/{ID}/reset?format=json
PUT  /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/loading/{engineID}?format=json
DELETE /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/unloading/{engineID}?format=json

This matches the hardware. The AF series datasheet states its capacity as KT5 chip count and splits it into small model and large model pools, and the API lets a platform bind a model package to a named engine and read that engine back. On a two chip box, the platform can therefore see and address exactly the two engines the datasheet talks about.

The guide also defines five task types and six event uploads. The event commands are the ones a platform has to subscribe to:

Event Command number Payload structure
Video analysis task detection 0x4021 NET_AIOP_VIDEO_HEAD
Picture analysis task detection 0x4022 NET_AIOP_PICTURE_HEAD
Captured picture polling detection 0x4023 NET_AIOP_POLLING_SNAP_HEAD
Video polling detection 0x4024 NET_AIOP_POLLING_VIDEO_HEAD
History video detection 0x4025 NET_AIOP_HISTORY_VIDEO_HEAD
Model package updating 0x4993 JSON_EventNotificationAlert_MPUpdate

A model update raising its own event is easy to miss when planning. It means a platform can be told that a model package changed on the device, instead of discovering it when detection output shifts.

Ask the device what it supports before you build to this list

There are two checks, and they answer different questions.

The first is whether the recorder has the AI Open Platform at all. That flag lives in the general device capability document, not in the AI guide. A GET on /ISAPI/System/capabilities returns XML_DeviceCap, and when the platform is present the document carries an isSupportAIOpenPlatform node set to true. The guide is explicit about the negative case: if the device does not support it, the node is not returned at all. Absence, not a false value, is the answer. The change log dates that node to version 6.1.5.20, September 2020.

The second is which task types the firmware implements. That comes from the AI guide's own capability endpoint:

GET /ISAPI/Intelligent/AIOpenPlatform/capabilities?format=json

The response document JSON_AIOpenPlatformCapOfDevice includes flags such as isSupportVideoTask, isSupportVideoPollingAnalysisTask, isSupportPictureTask, isSupportPicturePollingAnalysisTask, isSupportHistoryVideoTask, isSupportResetEngine and isSupportUploadModelwithURL. Two more were added in a later revision: isSupportAITargetBP and isSupportAIRuleTrigger.

All of them are marked optional in the message definition. So the 42 URI table tells you what the platform can do, and this endpoint tells you what a specific recorder and firmware will do. A project that codes against the table without calling capabilities first is guessing.

Two switches to turn on first

Both services are off until enabled, and both live under the same menu in the recorder interface.

Service Path Port
ISAPI System, System Settings, Network, Platform Access, ISAPI 80 for HTTP, 443 for HTTPS
SDK service System, System Settings, Network, Platform Access, SDK 8000, plus 8443 for the enhanced TLS service
ISUP System, System Settings, Network, Platform Access, ISUP Platform supplied, 1024 to 65535
ONVIF System, System Settings, Network, Platform Access, ONVIF 3702 discovery

The manual describes ISAPI in one sentence: it is an open protocol based on HTTP which can realise communication between system devices such as a network camera and an NVR. That is the whole explanation. There is no list of endpoints, no example request, and no statement of which endpoints exist on which model. The manual is a recorder manual, not a protocol reference. The protocol reference is the appendix set described above, in a different document.

The SDK entry carries one more useful line: enabling Stream over TLS is a separate optional step, and the enhanced SDK service uses TLS over the SDK port, 8443 by default.

ISUP is the one with the side effect. The manual states that if ISUP is enabled, the Hik-Connect access will automatically be disabled. It also states that only ISUP 5.0 is available, and that the encryption key is mandatory for that version and cannot be empty or the literal string ABCDEF. A project that turns on ISUP to reach a private platform loses remote app access, and that trade needs to be a decision rather than a discovery.

The channel number trap

This is the most expensive detail in the whole package, and it is stated in a note in Chapter 3.

ISAPI channel numbers start at 1. Device Network SDK channel numbers, on rear-end devices with up to 64 network channels, start at 33. So when a platform calls an SDK function that transmits text protocol, the device returns channel numbers starting at 1, while the rest of the platform is indexing from 33. The numbers silently disagree by 32.

The fix is a dedicated function:

BOOL NET_DVR_SDKChannelToISAPI(
  LONG  lUserID,
  LONG  lInChannel,
  BOOL  bSDKToISAPI
);

Two limits matter here.

The conversion is only available for rear-end devices with up to 64 network channels. The models with 128 and 256 channels are outside that stated range, so the note that is supposed to solve the problem does not claim to solve it there. A project on a large recorder cannot assume the helper applies and has to establish the offset from the device.

The parameter is also mislabeled. bSDKToISAPI is documented as OUT, but it is an input that selects the direction: TRUE converts private protocol to text protocol, FALSE converts the other way. A function returning BOOL cannot hand a direction back through an OUT parameter, and the description itself says the caller chooses. Read it as an input.

What the protocol reference does not include

The 287 URIs cover configuration. They do not cover alarm delivery, and they do not cover media.

All 24 Event URIs are about capability, arming schedules and trigger linkage: which event types exist, when they are armed, what they switch on. The word alertStream does not appear anywhere in the General guide, and neither does longPolling. There is no documented endpoint for a long-lived subscription that pushes detections to a platform. The subscription entry that does exist, subscribeEventCap, reports which event types can be subscribed to; it does not deliver them.

The same applies to video. The four Streaming entries are encoding parameters and their capability, with GET, PUT and DELETE on XML_StreamingChannel, plus a smartOverlap setting that controls whether VCA rules are drawn into the stream. None of them returns a media address.

So the two jobs that made the SDK necessary are still SDK jobs: arming the alarm channel and receiving callbacks, and pulling a live or recorded stream through the playback library. Everything else, including all of the AI configuration, can be done over plain HTTP.

Four other gaps

Beyond the alarm and media endpoints, four absences are worth knowing before a schedule is committed.

There is no AI Open Platform sample code. The C++ console sample covers alarm, capture, configuration, streaming, voice and playback, in 16 files, and none of them touches the AI Open Platform. The 243 page guide and the sample set do not overlap. Anyone integrating AIOP is translating documentation into code without a reference implementation.

There is no AcuSeek interface. The string AcuSeek appears zero times in HCNetSDK.h. The recorder interface offers it, the datasheet describes it, and no public SDK entry point carries its name. The text and voice search path on the P series is not reachable through the published header.

There is no per model applicability list. Neither guide names the models it applies to. We had to establish that by searching the datasheets, and the result is in a later section.

The per-line ISAPI documents are the fourth gap, and the reason the two appendices above matter. Hikvision publishes product line ISAPI documents under a licence agreement that has to be signed before download. Those documents cover the endpoints for face comparison, perimeter protection, structuralisation and AcuSearch on the M, H, P and I families, and none of that appears in Appendix E. What the SDK archive gives you is the recorder side of the protocol, not the analytics side outside AI Open Platform.

Where the documents disagree with each other

Four inconsistencies turned up, all in files we read directly.

The name of ISAPI has two official expansions. The NVR manual calls it Internet Server Application Programming Interface. Hikvision integration material distributed in Europe expands it as Intelligent Security API. Both are official, both are current, and they are not the same phrase.

The port table swaps two labels. The Communication Matrix lists port 80 as Web Service Port (TLS) and port 443 as Web Service Port, while the encryption column gives MD5 for 80 and TLS 1.1 and 1.2 for 443. The encryption column is consistent with normal practice and the descriptions are not: 443 is the TLS port and 80 is not. Enabled by default is Yes for 80 and No for 443.

Appendix E numbers its tables in the wrong series. The method tables in the request URI appendix run from Table C-1 to Table C-415, while Appendix C is the log type list. The numbering is internally consistent and belongs to a different appendix, so a cross reference to a table number is ambiguous between the two.

The channel conversion parameter is marked OUT where it is an input, as described above.

None of these changes what you build. All of them cost time if you trust the label instead of the behaviour, which is why they are written down here rather than smoothed over.

Which recorders this covers

The AI Open Platform guide does not state its scope, so we checked the datasheets. AI Open Platform appears in four AF series sheets and in the DS-IE1016 central server. It does not appear in the M, P, I or H series sheets.

Family AI Open Platform in datasheet What the published interface covers
AIOP, AF series Yes, with a full performance table The 42 URIs in this guide
Central, DS-IE1016 Yes, algorithm detection listed Should follow the same interface, not tested
Edge compact, rack, high density No ISAPI is listed, the AIOP endpoint set is not documented for them
AcuSeek, P series No, and AcuSeek is absent from the header Not published
Central, DS-IX2001 and DS-IM2006 No in the sheets we read Not published

Every DeepinMind datasheet we read carries the same line in its specification table: API, ONVIF profile S/G, SDK, ISAPI. So ISAPI exists on the whole line. What differs is whether Hikvision has published the endpoint set that reaches the analytics, and for the M, P, I and H families it has not, in the documents we could obtain.

The datasheet check is a proxy. The authoritative answer for a specific unit is the isSupportAIOpenPlatform node on its own capability document, which is why that check is described before this table rather than after it.

What this guide does not cover

We did not run any of this against a device. There is no recorder in this workshop, so nothing here is a tested result. Every statement above comes from a file we opened: the SDK archive contents, the developer guide text including its appendices, the NVR manual, the Communication Matrix, or a datasheet.

We did not sign the per-line ISAPI licence agreement. The endpoints for face comparison, perimeter protection, structuralisation and AcuSearch are therefore absent from this site, not because they do not exist but because we cannot read them and will not guess at their shape. The 287 general URIs and the 42 AI URIs are a different case: they are in the archive, and their numbers above are counted from the PDFs, not estimated.

We did not verify that a given firmware build implements every one of the 42 URIs. The capability endpoint exists precisely because it varies, and the optional flags suggest the vendor expects variation.

We did not test whether the 287 general URIs behave identically across the M, P, I and H families. They describe a common recorder firmware surface, and the appendix does not claim per model support.

Finally, this guide does not replace the vendor's own developer guide. It is a map of what is in the box, written so that a project can be scoped before the 71 MB download finishes.

What the archive cannot answer is how a detection leaves the device. Login, the stream handle and the three alarm modes are covered in the HCNetSDK connection guide.