Preface

Thank you very much for using our company's products. We will be happy to provide you with the best and highest quality service.

This manual may contain technical inaccuracies or text errors.

The content of this manual will be updated regularly without notice; the updated content will be added to the new version of this manual.

The interface images extracted from this manual are only used as examples. The interface may vary between versions, so please refer to the actual interface for accuracy.

We have a professional support team to answer your questions. Thank you for your support.


Version update description

Version | Date | Describe
r14 | 2022/05/31 | r14 Version Update


Interface Description

Content Overview

The interface of this document uses a RESTful architecture. RESTful interfaces are simple stateless protocols based on HTTP. All requests use the GET method, and HTTP responses are in JSON format. HTTP can be used for debugging, but HTTPS is recommended for production environments. For ease of use, subsequent examples use HTTP. If you switch to HTTPS, simply replace the corresponding http with https.


Common terms

Source: Single-channel video sources such as RTSP, RTMP, and ONVIF, or channels automatically generated after adding devices, are also referred to as sources. The source and monitoring point are equivalent.

Device: cameras, NVRs, or third-party platforms can add devices through various manufacturers' device SDKs or protocols. Adding devices will result in one or more sources, each corresponding to a different channel.


Protocol format

Most requests use HTTP GET, and the return uses JSON format. The specific JSON format returned varies depending on the command. The following table shows the basic format and examples. In order to make it easier for everyone to understand, some commands directly use representative values in the introduction. A few requests and returns using the HTTP POST method also use JSON format.

Format

Request : http://server/api/v1/<resources>?para=xxx

&<…>=<…>

Response:

{

"bStatus": true/false,

"strCode": "xxxxxx"

}

\r\n

<…>=<…>Represents multiple request parameters.

Example

Request : http://localhost:8080/api/v1/AddSrcONVIF? name=name1&token=token4&user=admin&password=12345&ip=192.168.0.234&port=80&onvifaddr=/onvif/device_service&session=c1782caf-b670-42d8-ba90-2244d0b0ee83

Response:

{

"bStatus": true,

"strCode": "Add successfully"

}

\r\n

Simple return format

The simple return format mainly describes the simple API return results.

Field | Data type | Describe
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure


API debugging

Postman debugging

The API provides a Postman debugging project that can be downloaded with the corresponding project and environment. First download the Postman tool. The following reference image is based on Postman 9.21.1. If you are using a newer version, it may differ. You can refer to the method for importing projects and environments for the new version.

Download Postman project

The Postman project for the API can be found in the h5s directory of https://gitee.com/linkingvision/api You can click the download button to download the entire directory, where H5S VIDEO PLATFORM r*.postman_collection.json is the project file, and H5STREAM ENV HTTP.postman_environment.json and H5STREAM ENV HTTPS.postman_environment.json are the environments.

Import Project

Click Import under Collections, and then select H5S VIDEO PLATFORM r*.postman_collection.json to import it into Postman. Refer to the following figure:

Import Environment

Click Import under Environments, and then select H5STREAM ENV HTTP.postman_environment.json to import it into Postman. Refer to the following figure:

Select the same method as H5STREAM ENV HTTPS.postman_environment.json.

Test

After importing, you can select the corresponding API and modify the IP and port of the H5STREAM ENV HTTP, and then you can test it.

You can fill the session obtained by Login into the h5_session field in the environment, so that subsequent tests can use this session.

The postman project has added the ability to automatically set the session. After calling Login once, the session in the environment variable will be updated, so there is no need to manually set it.

Because the session obtained by Login has a validity period, you can use the Runner function to keep it alive periodically by filling the valid session into the h5_session field in the environment.


API authentication mechanism

The video platform uses a session-based management mechanism. If you use the Login API to obtain a session, then all API calls use that session. The session has a timeout period, and you can use Keepalive to keep the session alive so that it does not time out. The default timeout period for the session is 600 seconds. Refer to the following figure for usage instructions:


系统(System)

System

The system API includes login and other system-related APIs.


User login

Description

Login system interface. Other interfaces rely on the session returned by Login. For specific mechanisms, refer to Interface Description-》API Authentication Mechanism.

Usage

Request parameters | GET
URL | /api/v1/Login
data | none

Parameters

Name | Type | Parameter mandatory | Description
user | string | must | user name
password | string | must | MD5 password Published in the package www/tool.html can generate the corresponding MD5

Response

Name | Type | Description
bStatus | boolean | Success or failure, true indicates success, false indicates failure
strSession | string | Session obtained during success
nTimeout | int | session timeout
nFaultTimes | int | Login error times
tLockTimeResidue | int | Lock the remaining time, in seconds
bWeakPassword | boolean | Whether the password is weak. If it is weak, it is recommended to refer to the requirements of the management interface and change it to a strong password

Examples

http://192.168.100.145:8080/api/v1/Login?user=admin&password=ddc2f0ff1aab61a5a34a83514e47ed83

{

  "bStatus": true,

  "strSession": "b1b73ced-18a2-4898-b300-db0ed12d523a",

  "nTimeout": 600,

  "nFaultTimes": 0,

  "tLockTimeResidue": 0,

  "bWeakPassword": true

}


用户登录_2

Description

The session obtained by keeping alive login needs to be called before the session times out. Each time it is called, the session will have an additional nTimeout time. For the specific mechanism, refer to Interface Description-》API Authentication Mechanism.

Usage

Request parameters | GET
URL | /api/v1/Keepalive
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
bStatus | boolean | Success or failure, true indicates success, false indicates failure
strCode | string | Description of the reasons for success or failure

Examples

'http://192.168.100.145:8080/api/v1/Keepalive?session=c1782caf-b670-42d8-ba90-2244d0b0ee83'

{

  "bStatus": true,

  "strCode": "Keepalive successfully"


用户登录_2_2

Description

Log out to obtain the session. For the specific mechanism, refer to Interface Description-》API Authentication Mechanism.

Usage

Request parameters | GET
URL | /api/v1/Logout
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
bStatus | boolean | Success or failure, true indicates success, false indicates failure
strCode | string | Description of the reasons for success or failure

Examples

'http://192.168.100.145:8080/api/v1/Logout?session=99cbeea8-5b4a-4e9b-8684-87ea99518bde'

{

  "bStatus": true,

  "strCode": "Logout successfully"


用户登录_2_2_2

Description

Get system information.

Usage

Request parameters | GET
URL | /api/v1/GetSystemInfo
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
strVersion | boolean | version
strHostId | string | Host number of software operation
strLicenseType | string | Software license type
strLicenseFull | string | Fixed as ********
strChannelLimit | string | Maximum number of channels
strEndtime | string | End time of software license
bDeviceSDK | boolean | Does the software license support the device SDK access
bDeviceSDKPb | boolean | Does the software license support device SDK playback
bGB28181 | boolean | Does the software license support GB28181
bTranscoding | boolean | Does the software license support transcoding
bCluster | boolean | Does the software license support clustering
bPlatform | boolean | Does the software license support platform access
bLingvideo | boolean | Does the software license support the lingvideo browser
bDocker | boolean | Does the software license support Docker

Examples

'http://192.168.100.145:8080/api/v1/GetSystemInfo?session=99cbeea8-5b4a-4e9b-8684-87ea99518bde'

{

  "strVersion": "r15.4.0614.22",

  "strHostId": "NjE4YzA4YzRjOWRhMTg1Yjc0NzM0NjgxNTFiNTQyZWM=",

  "strLicenseType": "Customization",

  "strLicenseFull": "******",

  "strChannelLimit": "10000",

  "strEndtime": "2023/05/18 11:35:04",

  "bDeviceSDK": true,

  "bDeviceSDKPb": true,

  "bGB28181": true,

  "bTranscoding": true,

  "bCluster": true,

  "bPlatform": true,

  "bLingvideo": true,

  "bDocker": true


用户登录_2_2_2_2

Description

Obtain the end time of software license.

Usage

Request parameters | GET
URL | /api/v1/GetLicEndTime
data | none

Parameters

Name | Type | Parameter mandatory | Description
none |  |  |

Response

Name | Type | Description
strEndtime | string | End time of authorization and license

Examples

'http://192.168.100.145:8080/api/v1/GetLicEndTime'

{

  "strEndtime": "2023/05/18 11:35:04"


用户登录_2_2_3

Description

Get codec information.

Usage

Request parameters | GET
URL | /api/v1/GetCodecInfo
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
strCPUModel | string | CPU model of software operation
nCPU | int | Number of physical CPUs
nCPUCore | int | Number of logical CPUs
strHWEncoders | string | List of hardware encoders
strHWDecoders | string | List of hardware decoders
strSWEncoders | string | List of software encoders
strSWDecoders | string | List of software decoders

Examples

'http://192.168.100.145:8080/api/v1/GetCodecInfo?session=99cbeea8-5b4a-4e9b-8684-87ea99518bde'

{

  "strCPUModel": "11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz",

  "nCPU": 1,

  "nCPUCore": 4,

  "strHWEncoders": "H264 H265 VP9",

  "strHWDecoders": "H264 H265",

  "strSWEncoders": "H264 AV1",

  "strSWDecoders": "H264 H265"


用户登录_2_2_3_2

Description

Obtain operation information.

Usage

Request parameters | GET
URL | /api/v1/GetRunInfo
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
strRunTime | string | System running time,in string form
strCPU | string | CPU utilization rate,in string form
strMemory | string | Memory utilization,in string form
strNetworkIn | string | Network incoming traffic of operating system,in string form
strNetworkOut | string | Network traffic of the operating system,in string form
strTotalSpace | string | Total size of the software running directory space,in string form
strFreeSpace | string | The remaining space size of the software running directory,in string form
strRecordTotalSpace | string | Total size of video directory space,in string form
strRecordFreeSpace | string | Size of remaining space in video directory,in string form
nRunTimeSec | int | System running time, in seconds
nCPUUsage | int | CPU utilization, 0 to 100
nMemoryUsage | int | Memory utilization, 0 to 100
nTotalMemoryByte | int | Total memory size, in Byte
nNetworkInK | int | The network traffic of the operating system, in kbps
nNetworkOutK | int | The network traffic of the operating system, in kbps
nTotalSpaceByte | int | The total size of the software running directory space, in bytes
nFreeSpaceByte | int | The remaining space size of the software running directory, in bytes
nRecordTotalSpaceByte | int | The total size of the video directory space, in bytes
nRecordFreeSpaceByte | int | The remaining space size of the video directory, in bytes

Examples

'http://192.168.100.145:8080/api/v1/GetRunInfo?session=99cbeea8-5b4a-4e9b-8684-87ea99518bde'

{

  "strRunTime": "1H 2MIN",

  "strCPU": "20%",

  "strMemory": "95%",

  "strNetworkIn": "153Kbps",

  "strNetworkOut": "190Kbps",

  "strTotalSpace": "952Gbytes",

  "strFreeSpace": "94Gbytes",

  "strRecordTotalSpace": "952Gbytes",

  "strRecordFreeSpace": "94Gbytes",

  "nRunTimeSec": "3735",

  "nCPUUsage": "20",

  "nMemoryUsage": "95",

  "nTotalMemoryByte": "16885276672",

  "nNetworkInK": "153",

  "nNetworkOutK": "190",

  "nTotalSpaceByte": "1022870155264",

  "nFreeSpaceByte": "101328769024",

  "nRecordTotalSpaceByte": "1022870155264",

  "nRecordFreeSpaceByte": "101328769024"


用户登录_2_2_3_2_2

Description

Obtain access device information.

Usage

Request parameters | GET
URL | /api/v1/GetDeviceSummary
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
nCameraTotal | int | Total number of access channels
nCameraOnline | int | Number of online channels
nHikDevTotal | int | Total number of Hikvision SDK devices connected
nHikDevOnline | int | The number of Hikvision SDK devices connected online
nDhDevTotal | int | Total number of Dahua SDK devices connected
nDhDevOnline | int | The number of online connections of Dahua SDK devices
nHikIscDevTotal | int | Total number of Hikvision ISC platform access
nHikIscDevOnline | int | The number of online connections to the Hikvision ISC platform
nTdDevTotal | int | Total number of devices connected to the Tiandi SDK
nTdDevOnline | int | The number of devices connected to the online system using the Tiandi SDK
nGbDevTotal | int | GB28181 total number of equipment access
nGbDevOnline | int | GB28181 number of equipment access online
nUnvDevTotal | int | Total number of access of SDK equipment of Uniview
nUnvDevOnline | int | The number of online devices connected to the Yu Shi SDK
nDssDevTotal | int | Total number of Dahua DSS platform access
nDssDevOnline | int | Online data accessed by Dahua DSS platform
nIvsDevTotal | int | Total number of Huawei IVS equipment access
nIvsDevOnline | int | The number of Huawei IVS devices connected to the online system
nCloudTotal | int | Total number of cloud cascade access
nCloudOnline | int | Number of cloud cascade access online
nRTSPRTMPTotal | int | Total number of RTSP and RTMP connections
nRTSPRTMPOnline | int | Number of RTSP and RTMP connections online
nONVIFTotal | int | Total number of ONVIF access
nONVIFOnline | int | ONVIF online access number
nRTMPPushTotal | int | Total number of RTMP streaming access
nRTMPPushOnline | int | The number of RTMP streaming access online

Examples

'http://192.168.100.145:8080/api/v1/GetDeviceSummary?session=99cbeea8-5b4a-4e9b-8684-87ea99518bde

{

  "nCameraTotal": "3",

  "nCameraOnline": "1",

  "nHikDevTotal": "1",

  "nHikDevOnline": "1",

  "nDhDevTotal": "1",

  "nDhDevOnline": "0",

  "nHikIscDevTotal": "0",

  "nHikIscDevOnline": "0",

  "nTdDevTotal": "0",

  "nTdDevOnline": "0",

  "nGbDevTotal": "0",

  "nGbDevOnline": "0",

  "nUnvDevTotal": "0",

  "nUnvDevOnline": "0",

  "nDssDevTotal": "0",

  "nDssDevOnline": "0",

  "nIvsDevTotal": "0",

  "nIvsDevOnline": "0",

  "nCloudTotal": "0",

  "nCloudOnline": "0",

  "nRTSPRTMPTotal": "1",

  "nRTSPRTMPOnline": "0",

  "nONVIFTotal": "0",

  "nONVIFOnline": "0",

  "nRTMPPushTotal": "0",

  "nRTMPPushOnline": "0"


用户登录_2_2_3_2_2_2

Description

Get the list of system file systems.

Usage

Request parameters | GET
URL | /api/v1/GetVolumes
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
vol | array | File system list
strDevice | string | Device Name
strPath | string | Mount Path
nTotal | int | The total space size, in M Byte
nFree | int | The remaining space size, in M Byte
bReadOnly | boolean | Is it read-only

Examples

'http://192.168.100.145:8080/api/v1/GetVolumes?session=99cbeea8-5b4a-4e9b-8684-87ea99518bde'

{

  "vol": [

       {

          "strDevice": "C:\\",

          "strPath": "C:\\",

          "nTotal": "939291",

          "nFree": "600257",

          "bReadOnly": false

       },

       {

          "strDevice": "D:\\",

          "strPath": "D:\\",

          "nTotal": "488368",

          "nFree": "41349",

          "bReadOnly": false

       }

   ]


用户登录_2_2_3_2_2_2_2

Description

Get the number of WS connections.

Usage

Request parameters | GET
URL | /api/v1/h5swsapi/Status
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
nConnectCount | int | Number of connections

Examples

'http://192.168.100.145:8080/api/v1/h5swsapi/Status?session=99cbeea8-5b4a-4e9b-8684-87ea99518bde'

{

  "nConnectCount": 1


用户登录_2_2_3_2_2_2_2_2

Description

Get the number of RTC connections.

Usage

Request parameters | GET
URL | /api/v1/h5srtcapi/Status
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
nConnectCount | int | Number of connections

Examples

'http://192.168.100.145:8080/api/v1/h5srtcapi/status?session=99cbeea8-5b4a-4e9b-8684-87ea99518bde'

{

  "nConnectCount": 1


用户登录_2_2_3_2_2_2_2_2_2

Description

Get anonymous browsing.

Usage

Request parameters | GET
URL | /api/v1/GetAnonymousView
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
bAnonymousView | boolean | Anonymous browsing on or off

Examples

'http://192.168.100.145:8080/api/v1/GetAnonymousView?session=99cbeea8-5b4a-4e9b-8684-87ea99518bde'

{

  "bAnonymousView": true


用户登录_2_2_3_2_2_2_2_2_2_2

Description

Set anonymous browsing and restart the service to take effect.

Usage

Request parameters | GET
URL | /api/v1/SetAnonymousView
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
enable | boolean | must | Anonymous browsing on or off

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Detailed description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/SetAnonymousView?enable=true&session=99cbeea8-5b4a-4e9b-8684-87ea99518bde'

{

  "bStatus": true,

  "strCode": "SetAnonymousView successfully"


用户登录_2_2_3_2_2_2_2_2_2_3

Description

Get the illegal login lock setting.

Usage

Request parameters | GET
URL | /api/v1/GetLoginLockStatus
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
bAnonymousView | boolean | Illegal login lock on or off

Examples

'http://192.168.100.145:8080/api/v1/GetLoginLockStatus?session=821b5946-504c-47f7-925b-e4f2cf6d6d88'

{

  "bLoginLockStatus": true


用户登录_2_2_3_2_2_2_2_2_2_2_2

Description

Set the illegal login lock and restart the service to take effect.

Usage

Request parameters | GET
URL | /api/v1/SetLoginLockStatus
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
enable | boolean | must | Illegal login lock on or off

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/SetLoginLockStatus?enable=true&session=821b5946-504c-47f7-925b-e4f2cf6d6d88'

{

  "bStatus": true,

  "strCode": "SetLoginLockStatus successfully"


用户登录_2_2_3_2_2_2_2_2_2_3_2

Description

Restart service.

Usage

Request parameters | GET
URL | /api/v1/Restart
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/Restart?session=821b5946-504c-47f7-925b-e4f2cf6d6d88'

{

  "bStatus": true,

  "strCode": "restart successfully"


用户登录_2_2_3_2_2_2_2_2_2_3_2_2

Description

Create configuration snapshot.

Usage

Request parameters | GET
URL | /api/v1/CreateSnapshot
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/CreateSnapshot?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "bStatus": true,

  "strCode": "Create Snapshot successfully"


用户登录_2_2_3_2_2_2_2_2_2_3_2_2_2

Description

Get the list of configuration snapshots.

Usage

Request parameters | GET
URL | /api/v1/GetSnapshotList
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
strName | array | Configure the list of snapshot files

Examples

'http://192.168.100.145:8080/api/v1/GetSnapshotList?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "strName": [

      "snapshot.20220616101351.conf",

      "snapshot.latest.conf"

   ]


用户登录_2_2_3_2_2_2_2_2_2_3_3

Description

Get the log cycle coverage setting.

Usage

Request parameters | GET
URL | /api/v1/GetRotatingLog
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
enable | boolean | Cycle coverage is turned on or off

Examples

'http://192.168.100.145:8080/api/v1/GetRotatingLog?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "enable": false


用户登录_2_2_3_2_2_2_2_2_2_2_2_2

Description

Set the log cycle to overwrite, and restart the service to take effect.

Usage

Request parameters | GET
URL | /api/v1/SetRotatingLog
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
enable | boolean | must | Open or close

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/SetRotatingLog?enable=false&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "bStatus": true,

  "strCode": "Set Rotating Log successfully"


用户登录_2_2_3_2_2_2_2_2_2_3_3_2

Description

Get log level.

Usage

Request parameters | GET
URL | /api/v1/GetLogLevel
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
strLevelLog | boolean | H5_LOG_DEBUG/H5_LOG_INFO /H5_LOG_WARNING/H5_LOG_ERROR

Examples

'http://192.168.100.145:8080/api/v1/GetLogLevel?enable=true&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "strLevelLog": "H5_LOG_WARNING"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2

Description

Set the log level and restart the service to take effect.

Usage

Request parameters | GET
URL | /api/v1/SetLogLevel
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
level | string | must | H5_LOG_DEBUG/H5_LOG_INFO /H5_LOG_WARNING/H5_LOG_ERROR

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/SetLogLevel?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84&level=H5_LOG_WARNING'

{

  "bStatus": true,

  "strCode": "Set Log Level successfully"


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_2

Description

Get HTTP configuration.

Usage

Request parameters | GET
URL | /api/v1/GetHTTPConf
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
nHTTPPort | int | HTTP port, 0 indicates HTTP is closed
nHTTPSPort | int | HTTPS port, 0 indicates HTTPS is closed
strSSLCertificateFile | string | The name of the HTTPS certificate file, which is located in the certificate/ directory of the version package
strDocumentRoot | string | Web service site path
bForceHTTPS | boolean | Whether to enable mandatory HTTPS
bEnableDomain | boolean | Obsolete Fields

Examples

'http://192.168.100.145:8080/api/v1/GetHTTPConf?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "nHTTPPort": 8080,

  "nHTTPSPort": 8443,

  "strSSLCertificateFile": "server.pem",

  "strDocumentRoot": "www/",

  "bForceHTTPS": false,

  "bEnableDomain": false


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_2

Description

Set the HTTP configuration and restart the service to take effect.

Usage

Request parameters | GET
URL | /api/v1/SetRotatingLog
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
http | int | must | HTTP port, 0 indicates that HTTP is closed
https | int | must | HTTPS port, 0 indicates HTTPS is closed
sslcertificatefile | string | must | The file name of the HTTPS certificate, which is located in the certificate/ directory of the version package
documentroot | string | must | web service site path
forcehttps | boolean | must | Whether to enable mandatory HTTPS
enabledomain | boolean | must | Obsolete Fields

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/SetHTTPConf?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84&http=8080&https=8443&sslcertificatefile=server.pem&documentroot=www/&forcehttps=false&enabledomain=false'

{

  "bStatus": true,

  "strCode": "Set http conf successfully."


视频源()

Video source management(Src)

The video source management API includes functions related to video source management.+


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_2

Video source data format

Video sources can also be referred to as monitoring points. The data of a single video source is in the JSON data format, with nType indicating the type of video source. The types can be referred to in the following table:

Type | Description
H5_FILE | File simulation source, which reads files in a circular manner
H5_STREAM | RTSP RTMP Streaming Video Source
H5_ONVIF | ONVIF device video source
H5_CLOUD | Source generated by cloud cascade mode
H5_RTMP_PUSH | RTMP streaming video source
H5_CH_DEV | Video source generated dynamically by the device SDK
H5_CH_GB | Video source generated by GB28181 registration

The meaning of the video source json data format can be referred to in the following table:

Name | Type | Description
nType | string | Video source type
strName | string | Video source name
strToken | string | Video source token, which is the unique identifier of the video source
strUrl | string | Internal Fields
strUser | string | Internal Fields
strPasswd | string | Internal Fields
bPasswdEncrypt | boolean | Internal Fields
bEnableAudio | boolean | Internal Fields
nConnectType | int | Internal Fields
nRTSPType | int | Internal Fields
strSrcIpAddress | string | Internal Fields
strSrcPort | string | Internal Fields
nChannelNumber | int | Internal Fields
bEnableUrlSub | boolean | Internal Fields
strUrlSub | string | Internal Fields
bOnvifProfileAuto | boolean | Internal Fields
strOnvifAddr | string | Internal Fields
strOnvifProfileMain | string | Internal Fields
strOnvifProfileSub | string | Internal Fields
bRTSPPlayback | boolean | Internal Fields
nRTSPPlaybackSpeed | int | Internal Fields
bOnline | boolean | Whether the video source is online
strSnapshotUrl | string | Internal Fields
bRec | boolean | Whether the video recording is enabled
strPushUrl | string | Internal Fields
strServerToken | string | Internal Fields
strOriginalToken | string | Internal Fields
strServerUuid | string | Internal Fields
nOriginalType | int | Internal Fields
strDeviceId | string | Internal Fields
strDeviceName | string | Internal Fields
bDisable | boolean | Whether the video source is disabled, true indicates disabled, false indicates normal
bIdle | boolean | Is the video source an idle channel

Examples

       {

          "nType": "H5_CH_DEV",

          "strName": "——上（）海@市",

          "strToken": "89d7--36",

          "strUrl": "invalid",

          "strUser": "invalid",

          "strPasswd": "invalid",

          "bPasswdEncrypt": false,

          "bEnableAudio": false,

          "nConnectType": "H5_AUTO",

          "nRTSPType": "H5_RTSP_AUTO",

          "strSrcIpAddress": "invalid",

          "strSrcPort": "invalid",

          "nChannelNumber": 0,

          "bEnableUrlSub": false,

          "strUrlSub": "",

          "bOnvifProfileAuto": true,

          "strOnvifAddr": "invalid",

          "strOnvifProfileMain": "invalid",

          "strOnvifProfileSub": "invalid",

          "bRTSPPlayback": false,

          "nRTSPPlaybackSpeed": 1,

          "bOnline": true,

          "strSnapshotUrl": "/api/v1/GetImage?token=89d7--36",

          "bRec": false,

          "strPushUrl": "none",

          "strServerToken": "",

          "strOriginalToken": "",

          "strServerUuid": "",

          "nOriginalType": "H5_ZERO",

          "strDeviceId": "",

          "strDeviceName": "",

          "bDisable": false,

          "bIdle": false

       }

       {

          "nType": "H5_ONVIF",

          "strName": "Cam1",

          "strToken": "a11a",

          "strUrl": "rtsp://192.168.0.1/stream",

          "strUser": "admin",

          "strPasswd": "dmin12345",

          "bPasswdEncrypt": false,

          "bEnableAudio": false,

          "nConnectType": "H5_AUTO",

          "nRTSPType": "H5_RTSP_AUTO",

          "strSrcIpAddress": "192.168.100.103",

          "strSrcPort": "80",

          "nChannelNumber": 1,

          "bEnableUrlSub": false,

          "strUrlSub": "rtsp://192.168.0.1/stream",

          "bOnvifProfileAuto": true,

          "strOnvifAddr": "/onvif/device_service",

          "strOnvifProfileMain": "Profile_1",

          "strOnvifProfileSub": "Profile_2",

          "bRTSPPlayback": false,

          "nRTSPPlaybackSpeed": 1,

          "bOnline": true,

          "strSnapshotUrl": "/api/v1/GetImage?token=a11a",

          "bRec": false,

          "strPushUrl": "none",

          "strServerToken": "",

          "strOriginalToken": "",

          "strServerUuid": "",

          "nOriginalType": "H5_ZERO",

          "strDeviceId": "",

          "strDeviceName": "",

          "bDisable": false,

          "bIdle": false


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3

Description

Get the list of video sources.

Usage

Request parameters | GET
URL | /api/v1/GetSrc
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | optional | Get the video source of the specified token
getonline | boolean | optional | Whether to obtain the online status of the video source, the default is to obtain it. This parameter does not only obtain online video sources
type | string | optional | Get the video source of the specified type, default is all H5_STREAM/H5_FILE/H5_CLOUD/H5_ONVIF/H5_RTMP_PUSH/H5_CH_DEV/H5_CH_GB

Response

Name | Type | Description
src | array | Reference video source management -》Video source data format

Examples

'http://192.168.100.145:8080/api/v1/GetSrc?getonline=true&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "src": [

       {

          "nType": "H5_ONVIF",

          "strName": "Cam1",

          "strToken": "a11a",

          "strUrl": "rtsp://192.168.0.1/stream",

          "strUser": "admin",

          "strPasswd": "dmin12345",

          "bPasswdEncrypt": false,

          "bEnableAudio": false,

          "nConnectType": "H5_AUTO",

          "nRTSPType": "H5_RTSP_AUTO",

          "strSrcIpAddress": "192.168.100.103",

          "strSrcPort": "80",

          "nChannelNumber": 1,

          "bEnableUrlSub": false,

          "strUrlSub": "rtsp://192.168.0.1/stream",

          "bOnvifProfileAuto": true,

          "strOnvifAddr": "/onvif/device_service",

          "strOnvifProfileMain": "Profile_1",

          "strOnvifProfileSub": "Profile_2",

          "bRTSPPlayback": false,

          "nRTSPPlaybackSpeed": 1,

          "bOnline": true,

          "strSnapshotUrl": "/api/v1/GetImage?token=a11a",

          "bRec": false,

          "strPushUrl": "none",

          "strServerToken": "",

          "strOriginalToken": "",

          "strServerUuid": "",

          "nOriginalType": "H5_ZERO",

          "strDeviceId": "",

          "strDeviceName": "",

          "bDisable": false,

          "bIdle": false

       }

   ]


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_3_2

Description

Obtain the video source list generated by the device SDK.

Usage

Request parameters | GET
URL | /api/v1/GetSrcWithoutDevice
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
src | array | Reference video source management -》Video source data format

Examples

'http://192.168.100.145:8080/api/v1/GetSrcWithoutDevice?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "src": [

       {

          "nType": "H5_ONVIF",

          "strName": "Cam1",

          "strToken": "a11a",

          "strUrl": "rtsp://192.168.0.1/stream",

          "strUser": "admin",

          "strPasswd": "dmin12345",

          "bPasswdEncrypt": false,

          "bEnableAudio": false,

          "nConnectType": "H5_AUTO",

          "nRTSPType": "H5_RTSP_AUTO",

          "strSrcIpAddress": "192.168.100.103",

          "strSrcPort": "80",

          "nChannelNumber": 1,

          "bEnableUrlSub": false,

          "strUrlSub": "rtsp://192.168.0.1/stream",

          "bOnvifProfileAuto": true,

          "strOnvifAddr": "/onvif/device_service",

          "strOnvifProfileMain": "Profile_1",

          "strOnvifProfileSub": "Profile_2",

          "bRTSPPlayback": false,

          "nRTSPPlaybackSpeed": 1,

          "bOnline": true,

          "strSnapshotUrl": "/api/v1/GetImage?token=a11a",

          "bRec": false,

          "strPushUrl": "none",

          "strServerToken": "",

          "strOriginalToken": "",

          "strServerUuid": "",

          "nOriginalType": "H5_ZERO",

          "strDeviceId": "",

          "strDeviceName": "",

          "bDisable": false,

          "bIdle": false

       }

   ]


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_3

Description

Get RTSP/RTMP/ONVIF source list.

Usage

Request parameters | GET
URL | /api/v1/GetSrcCamera
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
src | array | Reference video source management -》Video source data format

Examples

'http://192.168.100.145:8080/api/v1/GetSrcCamera?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "src": [

       {

          "nType": "H5_ONVIF",

          "strName": "Cam1",

          "strToken": "a11a",

          "strUrl": "rtsp://192.168.0.1/stream",

          "strUser": "admin",

          "strPasswd": "dmin12345",

          "bPasswdEncrypt": false,

          "bEnableAudio": false,

          "nConnectType": "H5_AUTO",

          "nRTSPType": "H5_RTSP_AUTO",

          "strSrcIpAddress": "192.168.100.103",

          "strSrcPort": "80",

          "nChannelNumber": 1,

          "bEnableUrlSub": false,

          "strUrlSub": "rtsp://192.168.0.1/stream",

          "bOnvifProfileAuto": true,

          "strOnvifAddr": "/onvif/device_service",

          "strOnvifProfileMain": "Profile_1",

          "strOnvifProfileSub": "Profile_2",

          "bRTSPPlayback": false,

          "nRTSPPlaybackSpeed": 1,

          "bOnline": true,

          "strSnapshotUrl": "/api/v1/GetImage?token=a11a",

          "bRec": false,

          "strPushUrl": "none",

          "strServerToken": "",

          "strOriginalToken": "",

          "strServerUuid": "",

          "nOriginalType": "H5_ZERO",

          "strDeviceId": "",

          "strDeviceName": "",

          "bDisable": false,

          "bIdle": false

       }

   ]


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_3_3

Description

Get the video source cache data frame, and return the Content-Type type as image/jpeg.

Usage

Request parameters | GET
URL | /api/v1/GetImage
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token

Response

Name | Type | Description
 | picture |

Examples

'http://192.168.100.145:8080/api/v1/GetImage?token=a11a&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

The returned content is a picture.


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_3_3_2

Description

Get the image loaded before the video is played, and return the Content-Type type as image/jpeg

Usage

Request parameters | GET
URL | /api/v1/GetLoadingImage
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
 | picture |

Examples

'http://192.168.100.145:8080/api/v1/GetLoadingImage?token=950b--331&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

The returned content is a picture.


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_3

Description

File source is a method that can use video files as test video sources. Currently, only MP4 files of H5S videos are supported. The official website of Linkingvision provides test video sources https://linkingvision.com/download/h5stream/video/ h5ssample.mp4 and h5ssamplesub.mp4,which can be downloaded to the local. The two files correspond to the main stream and the auxiliary stream respectively. If you copy the path name from Windows Explorer, you need to use \\ to replace \.

Usage

Request parameters | GET
URL | /api/v1/AddSrcFile
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Add the source's token, which cannot be duplicate. Please refer to the FAQ token rules
name | string | must | The name of the source
url | string | must | The path of the source requires an absolute path and needs to be encoded. For reference www/tool.html
audio | boolean | optional | Whether to enable audio, true or false, default is false

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddSrcFile?name=file&token=token2&url=c%3A%5C%5Ch5ssample.mp4&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84&audio=true'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_3_2

Description

Add an RTSP/RTMP source. This type does not support pan-tilt control.

Usage

Request parameters | GET
URL | /api/v1/AddSrcRTSP
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Add the source's token, which cannot be duplicate. Please refer to the FAQ token rules
name | string | must | The name of the source
user | string | must | user name
password | string | must | password
url | string | must | Fill the main stream RTSP/RTMP address, user name and password in the corresponding fields, remove the user name and password in the URL, and encode the address. For reference www/tool.html
audio | boolean | optional | Whether to enable audio, true or false, default is false
enablesub | boolean | optional | Whether to enable the auxiliary code stream, which is not enabled by default
suburl | string | optional | For the auxiliary code stream RTSP/RTMP address, fill in the corresponding fields with the user name and password. Remove the user name and password from the URL. The address needs to be encoded. For reference www/tool.html

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddSrcRTSP?name=RTSP&token=token2&user=admin&password=admin12345&url=rtsp%3a%2f%2f192.168.0.23%3a554%2fStreaming%2fChannels%2f101%3ftransportmode%3dunicast%26profile%3dProfile_1&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84&audio=true'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_3_2_2

Description

Add ONVIF source. ONVIF source only supports ONVIF camera access, not ONVIF NVR access.

Usage

Request parameters | GET
URL | /api/v1/AddSrcONVIF
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Add the source's token, which cannot be duplicate. Please refer to the FAQ token rules
name | string | must | The name of the source
user | string | must | user name
password | string | must | password
ip | string | must | ONVIF device address
port | int | must | ONVIF device port
onvifaddr | string | optional | ONVIF address, optional, default can be left blank, the system will automatically select
main | string | optional | The main code stream ONVIF profile can be left blank by default, and the system will automatically select it
sub | string | optional | The auxiliary code stream ONVIF profile can be left blank by default, and the system will automatically select it
audio | boolean | optional | Whether to enable audio, true or false, default is false

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddSrcONVIF?name=name1&token=token2&user=admin&password=admin12345&ip=192.168.100.173&port=80&onvifaddr=/onvif/device_service&main=Profile_1&sub=Profile_2&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84&audio=true'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_3_2_2_2

Description

Add an RTMP streaming source. This type does not support PTZ control.

Usage

Request parameters | GET
URL | /api/v1/AddRTMPPush
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Add the source's token, which cannot be duplicate. Please refer to the FAQ token rules
name | string | must | The name of the source
audio | boolean | optional | Whether to enable audio, true or false, default is false

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddRTMPPush?name=Push1&token=token5&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84&audio=true'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_3_2_2_2_2

Description

Delete the manually added video sources. The sources such as H5_CLOUD/H5_CH_DEV/H5_CH_GB are dynamically generated and cannot be manually deleted.

Usage

Request parameters | GET
URL | /api/v1/DelSrc
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Source Token

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/DelSrc?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84&token=token2'

{

  "bStatus": true,

  "strCode": "Del successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_3_2_2_2_2_2

Description

Obtain the video source stream information.

Usage

Request parameters | GET
URL | /api/v1/GetVidStreamStatus
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Source Token
stream | string | optional | main/sub main stream or sub stream, default is main stream

Response

Name | Type | Description
strVideoType | string | Video encoding type
nVideoBitrate | string | Video stream is in bps
nVideoFPS | int | Video frame rate
nVideoWidth | int | Video width
nVideoHeight | int | Video high
strAudioType | string | Audio encoding type
nAudioSampleBit | int | Audio bit width
nAudioChannels | int | Audio channel
nAudioBitrate | int | Audio bit rate is measured in bps
nAudioSampleRate | int | Audio sampling rate

Examples

'http://192.168.100.145:8080/api/v1/GetVidStreamStatus?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84&token=a11a&stream=main'

{

  "strVideoType": "H265",

  "nVideoBitrate": 1027249,

  "nVideoFPS": 25,

  "nVideoWidth": 1920,

  "nVideoHeight": 1080,

  "strAudioType": "PCMA",

  "nAudioSampleRate": 8000,

  "nAudioSampleBit": 16,

  "nAudioChannels": 1,

  "nAudioBitrate": 64000


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_4

Description

Obtain streaming detection settings. Since most systems now use on-demand streaming, there is no way to obtain the online status of the video stream source. However, the online status is obtained through IP address and port detection.

Usage

Request parameters | GET
URL | /api/v1/GetIpPortCheck
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
enable | boolean | Open or close
nDetentionPeriod | int | Detection interval time, but in seconds

Examples

'http://192.168.100.145:8080/api/v1/GetIpPortCheck?session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "enable": true,

  "nDetentionPeriod": 180


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4

Description

Set flow detection.

Usage

Request parameters | GET
URL | /api/v1/SetIpPortCheck
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
enable | string | must | Open or close
period | string | must | Interval time, in seconds

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/SetIpPortCheck?enable=true&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84&period=180'

{

  "bStatus": true,

  "strCode": "Set Ip Port Check successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2

Description

Pan tilt control.

Usage

Request parameters | GET
URL | /api/v1/Ptz
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
action | string | must | Pan tilt command up/upright/upleft/down/downright/downleft/left/right/zoomin/zoomout/focusin/focusout/irisin/irisout/stop/preset/lighton/lightoff/wiperon/wiperoff
speed | double | must | stop The instruction can be used without a speed range of 0-1 decimal
token | string | must | Video source token
preset | string | optional | When action is preset, the token of the preset point supports numbers of the type 1 2 3 4 5

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/Ptz?token=device1--35&action=preset&preset=3&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

or

'http://192.168.100.145:8080/api/v1/Ptz?token=device1--35&action=left&speed=0.5&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "bStatus": true,

  "strCode": "PTZ successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2

Description

Set the preset position.

Usage

Request parameters | GET
URL | /api/v1/SetPreset
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token
presetname | string | must | preset name, such as name1, name2, name3..., only the dome camera connected to the Hikvision SDK supports preset name settings
presettoken | string | must | preset token such as 1 2 3 4 5 …

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/SetPreset?token=device1--35&presetname=零视1&presettoken=5&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "bStatus": true,

  "strCode": "SetPreset successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_2

Description

Delete preset position.

Usage

Request parameters | GET
URL | /api/v1/DelPreset
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token
presetname | string | must | preset token such as 1 2 3 4 5 …

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/DelPreset?token=device1--35&presettoken=2&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "bStatus": true,

  "strCode": "DelPreset successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_2_2

Description

Obtain the preset position list.

Usage

Request parameters | GET
URL | /api/v1/GetPresets
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token

Response

Name | Type | Description
preset | array | List of preset positions
strName | string | Preset position name
strToken | string | Preset token

Examples

'http://192.168.100.145:8080/api/v1/GetPresets?token=device1--35&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "preset": [

       {

          "strName": "ABC",

          "strToken": "1"

       },

       {

          "strName": "linkingvision2",

          "strToken": "2"

       }

...


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_3

Description

Set the position of the dome camera. Only the dome camera that is connected to the Hikvision SDK is supported.

Usage

Request parameters | GET
URL | /api/v1/SetPosition
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token
panpos | int | must | P parameter (horizontal parameter), refer to Hikvision SDK manual NET_DVR_PTZPOS
tiltpos | int | must | T parameter (vertical parameter), refer to Hikvision SDK manual NET_DVR_PTZPOS
zoompos | int | must | Z parameter (zoom parameter), refer to Hikvision SDK manual NET_DVR_PTZPOS

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/SetPreset?token=device1--35&presetname=linkingvision1&presettoken=5&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "bStatus": true,

  "strCode": "SetPosition successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_3_2

Description

Obtain the position of the dome camera. Only supports dome cameras connected to the Hikvision SDK.

Usage

Request parameters | GET
URL | /api/v1/GetPosition
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token

Response

Name | Type | Description
nPanPos | int | P parameter (horizontal parameter), refer to Hikvision SDK manual NET_DVR_PTZPOS
nTiltPos | int | T parameter (vertical parameter), refer to Hikvision SDK manual NET_DVR_PTZPOS
nZoomPos | int | Z parameter (zoom parameter), refer to Hikvision SDK manual NET_DVR_PTZPOS

Examples

'http://192.168.100.145:8080/api/v1/GetPosition?token=81ae--1&session=9288fbfc-95a7-4cca-92fe-c6b60ecf7e84'

{

  "nPanPos": 0,

  "nTiltPos": 0,

  "nZoomPos": 0


设备管理(Device)

Device

The device management API includes device-related functions.


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_2_2

Equipment data format

The device contains one or more video sources (also known as channels). The type of video source generated by the device is H5_CH_DEV. The data for a single device is in the json data format. nType indicates the type of video source. The types can be referred to in the following table:

Type | Description
H5_DEV_HIK | Hikvision device SDK
H5_DEV_DH | Dahua Device SDK
H5_DEV_UNV | SDK for Yu Shi equipment
H5_DEV_HIKINFOV | Hikvision INFO Vision Platform
H5_DEV_HIKISC | Hikvision ISC platform
H5_DEV_TD | Tiandi Weiye Equipment SDK
H5_DEV_DHDSS | Dahua DSS platform
H5_DEV_IVS | Huawei IVS
H5_DEV_GB | GB device, GB device does not need to be added, and the device needs to be automatically registered to complete

The meaning of the video source json data format can be referred to in the following table:

Name | Type | Description
nType | string | Equipment type
strName | string | Device Name
strToken | string | Device token, which is the unique identifier of the device
strUser | string | User name, if GB28181, this field is invalid
strPasswd | string | Password, if GB28181 is used, this field is invalid
bPasswdEncrypt | boolean | Internal Fields
strDevIpAddress | string | Device IP address
strDevPort | string | Device Port
bEnableAudio | boolean | Whether to enable audio
nMaxChannel | int | The maximum number of channels, 0 indicates no limit, and others are the maximum number of channels loaded
bCentralRecord | boolean | Whether it is a central video recording, Hikvision ISC and Hikvision INFO Vision are applicable
bSandbox | boolean | Whether to enable Sandbox mode
bISAPI | boolean | Whether to enable ISAPI mode, applicable to Hikvision device SDK
bVMS | boolean | Whether it is VMS, Yuvi VMS is applicable, and when false, it is Yuvi NVR
bOnline | boolean | Whether the equipment is online

Examples

       {

          "nType": "H5_DEV_HIK",

          "strName": "175",

          "strToken": "81ae",

          "strUser": "admin",

          "strPasswd": "dmin12345",

          "bPasswdEncrypt": false,

          "strDevIpAddress": "192.168.100.175",

          "strDevPort": "8000",

          "bEnableAudio": false,

          "nMaxChannel": 0,

          "bCentralRecord": false,

          "bSandbox": false,

          "bISAPI": false,

          "bVMS": false,

          "bOnline": true


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_5

Description

Get device configuration.

Usage

Request parameters | GET
URL | /api/v1/GetDeviceConf
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
bEnableLoadAllChannel | boolean | Whether to load all channels of the device
nSandboxMode | string | H5_SANDBOX_ALL All devices are enabled H5_SANDBOX_DISABLE All devices are disabled H5_SANDBOX_AUTO: Enable or disable based on the device configuration

Examples

'http://192.168.100.145:8080/api/v1/GetDeviceConf?session=918131a9-c3ba-4bbd-a557-c1336090fabd'

{

  "bEnableLoadAllChannel": true,

  "nSandboxMode": "H5_SANDBOX_AUTO"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_5

Description

Set the device configuration and restart the service to take effect.

Usage

Request parameters | GET
URL | /api/v1/SetDeviceConf
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
loadallchannel | boolean | must | Whether to load all channels of the device. If false, only the online channels of the device will be loaded
sandboxmode | string | must | H5_SANDBOX_ALL All devices are turned on H5_SANDBOX_DISABLE All devices are turned off H5_SANDBOX_AUTO Turn on or off according to the device configuration

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/SetDeviceConf?session=918131a9-c3ba-4bbd-a557-c1336090fabd&loadallchannel=true&sandboxmode=H5_SANDBOX_AUTO'

{

  "bStatus": true,

  "strCode": "Set device conf true."


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_4

Description

Get device list.

Usage

Request parameters | GET
URL | /api/v1/GetDevice
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | optional | Get the device with the specified token
getonline | boolean | optional | Whether to obtain the online status of the device, the default is to obtain it. This parameter does not only obtain online devices

Response

Name | Type | Description
dev | array | Refer to Device-》Equipment Data Format

Examples

'http://192.168.100.145:8080/api/v1/GetDevice?getonline=true&session=918131a9-c3ba-4bbd-a557-c1336090fabd'

{

  "dev": [

       {

          "nType": "H5_DEV_HIK",

          "strName": "175",

          "strToken": "81ae",

          "strUser": "admin",

          "strPasswd": "dmin12345",

          "bPasswdEncrypt": false,

          "strDevIpAddress": "192.168.100.175",

          "strDevPort": "8000",

          "bEnableAudio": false,

          "nMaxChannel": 0,

          "bCentralRecord": false,

          "bSandbox": false,

          "bISAPI": false,

          "bVMS": false,

          "bOnline": true

       }

   ]


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_4_2

Description

Obtain the list of video sources (channels) for the device.

Usage

Request parameters | GET
URL | /api/v1/GetDeviceSrc
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Get the list of video sources (channels) for the specified token device
getonline | boolean | optional | Whether to obtain the online status of the video source, the default is to obtain it. This parameter is not only for obtaining online devices

Response

Name | Type | Description
src | array | Refer to Device-》Equipment Data Format

Examples

'http://192.168.100.145:8080/api/v1/GetDeviceSrc?token=81ae&getonline=false&session=918131a9-c3ba-4bbd-a557-c1336090fabd'

{

  "src": [

       {

          "nType": "H5_CH_DEV",

          "strName": "Camera 01",

          "strToken": "81ae--1",

          "strUrl": "invalid",

          "strUser": "invalid",

          "strPasswd": "invalid",

          "bPasswdEncrypt": false,

          "bEnableAudio": false,

          "nConnectType": "H5_AUTO",

          "nRTSPType": "H5_RTSP_AUTO",

          "strSrcIpAddress": "invalid",

          "strSrcPort": "invalid",

          "nChannelNumber": 0,

          "bEnableUrlSub": false,

          "strUrlSub": "",

          "bOnvifProfileAuto": true,

          "strOnvifAddr": "invalid",

          "strOnvifProfileMain": "invalid",

          "strOnvifProfileSub": "invalid",

          "bRTSPPlayback": false,

          "nRTSPPlaybackSpeed": 1,

          "bOnline": false,

          "strSnapshotUrl": "/api/v1/GetImage?token=81ae--1",

          "bRec": false,

          "strPushUrl": "",

          "strServerToken": "",

          "strOriginalToken": "",

          "strServerUuid": "",

          "nOriginalType": "H5_ZERO",

          "strDeviceId": "",

          "strDeviceName": "",

          "bDisable": false,

          "bIdle": false

       }

   ]


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_5_2

Description

Add Hikvision SDK device.

Usage

Request parameters | GET
URL | /api/v1/AddDeviceHik
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
name | string | must | Device Name
token | string | must | Device token, the token cannot be repeated. Please refer to the FAQ token rules
user | string | must | user name
password | string | must | password
ip | string | must | Device IP address
port | string | must | Device Port
audio | boolean | must | Whether to enable audio
maxchannel | int | optional | The maximum number of channels, 0 indicates unlimited, others are the maximum number of channels loaded, and the default is 0
sandbox | boolean | optional | Whether to enable sandbox, which takes effect when the device configuration nSandboxMode is set to H5_SANDBOX_AUTO, and is disabled by default
isapi | boolean | optional | Whether to enable ISAPI mode, which is disabled by default

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddDeviceHik?name=device3&token=device4&user=admin&password=admin12345&ip=192.168.100.101&port=8000&audio=true&session=918131a9-c3ba-4bbd-a557-c1336090fabd&maxchannel=0&isapi=false&sandbox=true'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_5_2_2

Description

Add Dahua SDK device.

Usage

Request parameters | GET
URL | /api/v1/AddDeviceDh
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
name | string | must | Device Name
token | string | must | Device token, the token cannot be repeated. Please refer to the FAQ token rules
user | string | must | user name
password | string | must | password
ip | string | must | Device IP address
port | string | must | Device Port
audio | boolean | must | Whether to enable audio
maxchannel | int | optional | The maximum number of channels, 0 indicates unlimited, others are the maximum number of channels loaded, and the default is 0
sandbox | boolean | optional | Whether to enable sandbox, which takes effect when the device configuration nSandboxMode is set to H5_SANDBOX_AUTO, and is disabled by default

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddDeviceDh?name=device2&token=device2&user=admin&password=admin12345&ip=192.168.100.106&port=37777&audio=true&session=918131a9-c3ba-4bbd-a557-c1336090fabd&sandbox=false&maxchannel=0

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_5_2_2_2

Description

Add the Tiandi SDK device.

Usage

Request parameters | GET
URL | /api/v1/AddDeviceTd
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
name | string | must | Device Name
token | string | must | Device token, the token cannot be repeated. Please refer to the FAQ token rules
user | string | must | user name
password | string | must | password
ip | string | must | Device IP address
port | string | must | Device Port
audio | boolean | must | Whether to enable audio
maxchannel | int | optional | The maximum number of channels, 0 indicates unlimited, others are the maximum number of channels loaded, and the default is 0
sandbox | boolean | optional | Whether to enable sandbox, which takes effect when the device configuration nSandboxMode is set to H5_SANDBOX_AUTO, and is disabled by default

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddDeviceTd?name=device3&token=device1&user=admin&password=admin12345&ip=192.168.100.125&port=3000&audio=false&session=918131a9-c3ba-4bbd-a557-c1336090fabd&sandbox=false&maxchannel=0'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_5_2_2_2_3

Description

Add Huawei IVS equipment, support IVS1800, IVS3800.

Usage

Request parameters | GET
URL | /api/v1/AddDeviceIvs
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
name | string | must | Device Name
token | string | must | Device token, the token cannot be repeated. Please refer to the FAQ token rules
user | string | must | user name
password | string | must | password
ip | string | must | Device IP address
port | string | must | Device Port
audio | boolean | must | Whether to enable audio
maxchannel | int | optional | The maximum number of channels, 0 indicates unlimited, others are the maximum number of channels loaded, and the default is 0
sandbox | boolean | optional | Whether to enable sandbox, which takes effect when the device configuration nSandboxMode is set to H5_SANDBOX_AUTO, and is disabled by default

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddDeviceIvs?name=deviceivs1800&token=deviceivs&user=chao_1&password=admin12345&ip=192.168.100.230&port=18531&audio=true&session=918131a9-c3ba-4bbd-a557-c1336090fabd&sandbox=false&maxchannel=0'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_5_2_2_2_3_2

Description

Add UVC SDK device.

Usage

Request parameters | GET
URL | /api/v1/AddDeviceUnv
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
name | string | must | Device Name
token | string | must | Device token, the token cannot be repeated. Please refer to the FAQ token rules
user | string | must | user name
password | string | must | password
ip | string | must | Device IP address
port | string | must | Device Port
audio | boolean | must | Whether to enable audio
maxchannel | int | optional | The maximum number of channels, 0 indicates unlimited, others are the maximum number of channels loaded, and the default is 0
sandbox | boolean | optional | Whether to enable sandbox, which takes effect when the device configuration nSandboxMode is set to H5_SANDBOX_AUTO, and is disabled by default
vms | boolean | optional | VMS mode is enabled. If it is false, it indicates NVR. It is optional and the default is false

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddDeviceUnv?name=device2&token=device2&user=admin&password=admin12345&ip=192.168.100.133&port=80&audio=true&session=918131a9-c3ba-4bbd-a557-c1336090fabd&sandbox=false&maxchannel=0&vms=false'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_5_2_2_2_2

Description

Add Hikvision ISC platform.

Usage

Request parameters | GET
URL | /api/v1/AddDeviceHikISC
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
name | string | must | Device Name
token | string | must | Device token, the token cannot be repeated. Please refer to the FAQ token rules
user | string | must | user name
password | string | must | password
ip | string | must | Device IP address
port | string | must | Device Port
audio | boolean | must | Whether to enable audio
maxchannel | int | optional | The maximum number of channels, 0 indicates unlimited, others are the maximum number of channels loaded, and the default is 0
sandbox | boolean | optional | Whether to enable sandbox, which takes effect when the device configuration nSandboxMode is set to H5_SANDBOX_AUTO, and is disabled by default

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddDeviceHikISC?name=device3&token=device10&user=22936233&password=px50TzrNNUiU1uxloJLG&ip=192.168.100.132&port=443&audio=true&session=918131a9-c3ba-4bbd-a557-c1336090fabd&sandbox=false&maxchannel=0'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_5_2_2_2_2_2

Description

Add Hikvision INFO Vision platform

Usage

Request parameters | GET
URL | /api/v1/AddDeviceHikInfov
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
name | string | must | Device Name
token | string | must | Device token, the token cannot be repeated. Please refer to the FAQ token rules
user | string | must | user name
password | string | must | password
ip | string | must | Device IP address
port | string | must | Device Port
audio | boolean | must | Whether to enable audio
maxchannel | int | optional | The maximum number of channels, 0 indicates unlimited, others are the maximum number of channels loaded, and the default is 0
sandbox | boolean | optional | Whether to enable sandbox, which takes effect when the device configuration nSandboxMode is set to H5_SANDBOX_AUTO, and is disabled by default

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddDeviceHikInfov?name=device3&token=device10&user=20568911&password=fbb0qvMlVRzF4y1C6agZ&ip=192.168.100.232&port=443&audio=true&session=918131a9-c3ba-4bbd-a557-c1336090fabd&sandbox=false&maxchannel=0'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_5_2_2_2_2_2_2

Description

Add Dahua DSS platform.

Usage

Request parameters | GET
URL | /api/v1/AddDeviceDss
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
name | string | must | Device Name
token | string | must | Device token, the token cannot be repeated. Please refer to the FAQ token rules
user | string | must | user name
password | string | must | password
ip | string | must | Device IP address
port | string | must | Device Port
audio | boolean | must | Whether to enable audio
maxchannel | int | optional | The maximum number of channels, 0 indicates unlimited, others are the maximum number of channels loaded, and the default is 0
sandbox | boolean | optional | Whether to enable sandbox, which takes effect when the device configuration nSandboxMode is set to H5_SANDBOX_AUTO, and is disabled by default

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/AddDeviceDss?name=devicedss&token=devicedss&user=admin&password=admin12345&ip=192.168.100.133&port=9000&audio=true&session=918131a9-c3ba-4bbd-a557-c1336090fabd&sandbox=false&maxchannel=0'

{

  "bStatus": true,

  "strCode": "Add successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_3_2_2_2_2_3

Description

Delete device.

Usage

Request parameters | GET
URL | /api/v1/DelDevice
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Device token

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/DelDevice?token=devicevik&session=f0e8a036-e785-482b-a501-aa3cbf227163'

{

  "bStatus": true,

  "strCode": "Del successfully"


国标管理(GB)

Device

The GB28181 device management API includes functions related to national standard devices.


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_5_2

Description

Obtain the GB28181 configuration.

Usage

Request parameters | GET
URL | /api/v1/GetGbConf
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
bEnable | boolean | Whether to enable GB28181 service
strGbID | string | GB28181 ID, need to comply with GB28181 ID standard
strRealm | string | SIP domain
strPassword | string | GB28181 service password
strGbServerProto | string | Signaling protocol, supporting UDP and TCP, the protocol type needs to correspond to the configuration on the device
strGbStreamProto | string | Code stream protocol, supporting UDP and TCP
strGbServerIpAddr | string | The service IP address needs to be modified according to the actual situation. If it is a cloud service, it needs to be modified to the mapped IP address
nGbServerPort | int | Service Port
nGbTimeout | int | GB28181 timeout. If the device does not keep alive or register a message after this time, it will be automatically deleted
nPortRangeMin | int | Starting from the code stream port, it is necessary to open the corresponding range in the firewall
nPortRangeMax | int | End of code stream port
bEnableAudio | boolean | Whether to enable audio
bEnableSSRCCheck | boolean | Whether to enable the stream SSRC check
bSubAlarm | boolean | Whether to subscribe to the alarm
bSubMobilePosition | boolean | Whether to subscribe to the alarm

Examples

'http://192.168.100.145:8080/api/v1/GetGbConf?session=918131a9-c3ba-4bbd-a557-c1336090fabd'

{

  "bEnable": true,

  "strGbID": "34020000002000000001",

  "strRealm": "3402000000",

  "strPassword": "3402000000",

  "strGbServerProto": "UDP",

  "strGbStreamProto": "UDP",

  "strGbServerIpAddr": "192.168.100.103",

  "nGbServerPort": 5060,

  "nGbTimeout": 7200,

  "nPortRangeMin": 55000,

  "nPortRangeMax": 59999,

  "bEnableAudio": false,

  "bEnableSSRCCheck": false,

  "bSubAlarm": true,

  "bSubMobilePosition": true


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_5_3

Description

Set the GB28181 configuration and restart the service to take effect.

Usage

Request parameters | GET
URL | /api/v1/SetGbConf
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
enable | boolean | must | Whether to enable GB28181 service
Gbid | string | must | GB28181 ID, need to comply with GB28181 ID standard
realm | string | must | SIP domain
password | string | must | GB28181 service password
Gbserverproto | string | must | Signaling protocol, supporting UDP and TCP, the protocol type needs to correspond to the configuration on the device
Gbstreamproto | string | must | Code stream protocol, supporting UDP and TCP
GbserverIpaddr | string | must | The service IP address needs to be modified according to the actual situation. If it is a cloud service, it needs to be modified to the mapped IP address
Gbserverport | int | must | Service Port
Gbtimeout | int | must | GB28181 timeout. If the device does not keep alive or register a message after this time, it will be automatically deleted
portrangemin | int | must | Starting from the code stream port, it is necessary to open the corresponding range in the firewall
portrangemax | int | must | End of code stream port
enableaudio | boolean | must | Whether to enable audio, true or false
enableSSRCcheck | boolean | must | Whether to enable the stream SSRC check, true or false
subalarm | boolean | must | Whether to subscribe to the alarm, true or false
submobileposition | boolean | must | Whether to subscribe to the location, true or false

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/SetGbConf?session=918131a9-c3ba-4bbd-a557-c1336090fabd&enable=true&Gbid=34020000002000000001&realm=3402000000&password=3402000000&Gbserverproto=UDP&Gbstreamproto=UDP&GbserverIpaddr=192.168.100.103&Gbserverport=5060&Gbtimeout=7200&portrangemin=55000&portrangemax=59999&enableaudio=false&enableSSRCcheck=false&subalarm=true&submobileposition=true'

{

  "bStatus": true,

  "strCode": "SetGb28181Conf successfully"


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_4_3

Description

Obtain the list of GB28181 devices.

Usage

Request parameters | GET
URL | /api/v1/GetGbDevice
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | optional | Get the GB device with the specified token, where the token is the GB28181ID of the device. By default, all devices are obtained

Response

Name | Type | Description
dev | array | Refer to Device-》Equipment Data Format

Examples

'http://192.168.100.145:8080/api/v1/GetGbDevice?token=34020000001180010103&session=918131a9-c3ba-4bbd-a557-c1336090fabd'

{

  "dev": [

       {

          "nType": "H5_DEV_GB",

          "strName": "34020000001180010103",

          "strToken": "34020000001180010103",

          "strUser": "invalid",

          "strPasswd": "invalid",

          "bPasswdEncrypt": false,

          "strDevIpAddress": "invalid",

          "strDevPort": "invalid",

          "bEnableAudio": false,

          "bCentralRecord": false,

          "bOnline": true

       },

       {

          "nType": "H5_DEV_GB",

          "strName": "34020000001320000004",

          "strToken": "34020000001320000004",

          "strUser": "invalid",

          "strPasswd": "invalid",

          "bPasswdEncrypt": false,

          "strDevIpAddress": "invalid",

          "strDevPort": "invalid",

          "bEnableAudio": false,

          "bCentralRecord": false,

          "bOnline": true

       }

   ]


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_4_3_2

Description

Restart the GB28181 device.

Usage

Request parameters | GET
URL | /api/v1/RebootGbDevice
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | token is the GB28181 ID of the device

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/RebootGbDevice?token=34020000001180010103&session=918131a9-c3ba-4bbd-a557-c1336090fabd'

{

  "bStatus": true,

  "strCode": "Reboot successfully"


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_4_3_2_2

Description

Refresh the GB28181 device, and this API will cause the service to retrieve the channel directory list from the device again.

Usage

Request parameters | GET
URL | /api/v1/RefreshGbDevice
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | token is the GB28181 ID of the device

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/RefreshGbDevice?token=34020000001180010103&session=918131a9-c3ba-4bbd-a557-c1336090fabd'

{

  "bStatus": true,

  "strCode": "Refresh successfully"


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_3_4_2_2

Description

Obtain the list of video sources (channels) for GB28181 devices.

Usage

Request parameters | GET
URL | /api/v1/GetGbDeviceSrc
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | token is the GB28181 ID of the device

Response

Name | Type | Description
src | array | Refer to Device-》Equipment Data Format

Examples

'http://192.168.100.145:8080/api/v1/GetGbDeviceSrc?token=34020000001180010103&session=918131a9-c3ba-4bbd-a557-c1336090fabd'

{

  "src": [

       {

          "nType": "H5_CH_GB",

          "strName": "cs",

          "strToken": "34020000001320000174",

          "strUrl": "invalid",

          "strUser": "invalid",

          "strPasswd": "invalid",

          "bPasswdEncrypt": false,

          "bEnableAudio": false,

          "nConnectType": "H5_AUTO",

          "nRTSPType": "H5_RTSP_AUTO",

          "strSrcIpAddress": "invalid",

          "strSrcPort": "invalid",

          "nChannelNumber": 0,

          "bOnvifProfileAuto": true,

          "strOnvifAddr": "invalid",

          "strOnvifProfileMain": "invalid",

          "strOnvifProfileSub": "invalid",

          "bRTSPPlayback": false,

          "nRTSPPlaybackSpeed": 1,

          "bOnline": true,

          "strSnapshotUrl": "/api/v1/GetImage?token=34020000001320000174",

          "bRec": false,

          "strPushUrl": "",

          "strServerToken": "",

          "strOriginalToken": "",

          "strServerUuid": "",

          "nOriginalType": "H5_ZERO",

          "strDeviceId": "",

          "strDeviceName": "",

          "bDisable": false

       }

   ]


录像管理(Record)

Record

The video management API includes video-related functions.


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_4

Description

Capture a screenshot from the video stream of the video source and save it to the server. Asynchronous API, you can obtain the success or failure status of the screenshot capture through the event API. You can use the Search API to search for screenshots.

Usage

Request parameters | GET
URL | /api/v1/Snapshot
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token
num | int | optional | The number of screenshots, default 1, minimum 1, maximum 2147483647
internal | int | optional | If the number of captured images is greater than 1, this parameter indicates the interval time, in seconds

Response

Name

Type

Description

bStatus

boolean

The API is successful or failed. True indicates success and false indicates failure. Because the API is asynchronous, a successful API return indicates a successful API call. You can obtain the screenshot result status through the event API or by delaying access to determine whether the file exists to obtain the screenshot status. The delay needs to be greater than 2 seconds.

strCode

string

Specific description of API success or failure

strFileName

string

file name

strUrl

string

File path. If the screenshot is successful, you can add the service port and session to access the file, such as:

http://192.168.100.145:8080/mediastore/snapshot/81ae--1/2022-06-17TZ08/16-01-01/81ae--1-1c18dc86-ed7d-4262-9986-d562aca71d7b.jpg?session=f0e8a036-e785-482b-a501-aa3cbf227163

or

https://192.168.100.145:8443/mediastore/snapshot/81ae--1/2022-06-17TZ08/16-01-01/81ae--1-1c18dc86-ed7d-4262-9986-d562aca71d7b.jpg?session=f0e8a036-e785-482b-a501-aa3cbf227163

Examples

'http://192.168.100.145:8080/api/v1/Snapshot?token=81ae--1&session=f0e8a036-e785-482b-a501-aa3cbf227163&num=1&internal=1'

{

  "bStatus": true,

  "strCode": "Snapshot start successfully",

  "strFileName": "81ae--1-1c18dc86-ed7d-4262-9986-d562aca71d7b.jpg",

  "strUrl": "/mediastore/snapshot/81ae--1/2022-06-17TZ08/16-01-01/81ae--1-1c18dc86-ed7d-4262-9986-d562aca71d7b.jpg"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_4_2

Description

Playback capture, capture a picture from the video stream being played back and save it to the server. Asynchronous API, you can obtain the success or failure status of the capture through the event API. You can use the Search API to search for captures.

Usage

Request parameters | GET
URL | /api/v1/PbSnapshot
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token
pbsess | string | must | For playback session, refer to JS video playback SDK-》Playback video interface parameter H5S_EVENT_PB_SESSION_ID

Response

Name

Type

Description

bStatus

boolean

API success or failure, true indicates success, false indicates failure. Because the API is asynchronous, API return success indicates API call success. You can obtain the screenshot result status through the event API, or delay access to determine whether the file exists to obtain the screenshot status. The delay needs to be greater than 2 seconds.

strCode

string

Specific description of API success or failure

strFileName

string

file name

strUrl

string

File path. If the screenshot is successful, you can add the service port and session to access the file, such as：

http://192.168.100.145:8080/mediastore/snapshot/81ae--1/2022-06-17TZ08/16-01-01/81ae--1-1c18dc86-ed7d-4262-9986-d562aca71d7b.jpg?session=f0e8a036-e785-482b-a501-aa3cbf227163

or

https://192.168.100.145:8443/mediastore/snapshot/81ae--1/2022-06-17TZ08/16-01-01/81ae--1-1c18dc86-ed7d-4262-9986-d562aca71d7b.jpg?session=f0e8a036-e785-482b-a501-aa3cbf227163

Examples

'http://192.168.100.145:8080/api/v1/PbSnapshot?token=device1--33&pbsession=7b767566-f969-4f0d-9584-53aaafc539b0&session=f0e8a036-e785-482b-a501-aa3cbf227163'

{

  "bStatus": true,

  "strCode": "PbSnapshot start successfully",

  "strFileName": "81ae--1-1c18dc86-ed7d-4262-9986-d562aca71d7b.jpg",

  "strUrl": "/mediastore/snapshot/81ae--1/2022-06-17TZ08/16-01-01/81ae--1-1c18dc86-ed7d-4262-9986-d562aca71d7b.jpg"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_4_2_2

Description

Enable manual video recording. If the alwayscreate parameter is false, the service will continue to record video indefinitely. After the service restarts, it will continue to record video. You can use the Search API to search for videos.

Usage

Request parameters | GET
URL | /api/v1/ManualRecordStart
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token
alwayscreate | boolean | optional | True or false, indicating whether to always create a new video session regardless of whether it is currently recording. The default is false
limittime | int | optional | If alwayscreate is true, this parameter needs to be specified to automatically stop recording after the time is up, in seconds

Response

Name

Type

Description

bStatus

boolean

API success or failure, true indicates success, false indicates failure

strCode

string

Specific description of API success or failure

strFileName

string

file name

strUrl

string

File path. If the screenshot is successful, you can add the service port and session to access the file, such as:

http://192.168.100.145:8080/mediastore/record/token1/2020-01-14TZ08/08-35-02/token1-6455eb98-e344-4912-a7ef-eb2ffd8a30ee.mp4?session=f0e8a036-e785-482b-a501-aa3cbf227163

or

https://192.168.100.145:8443/mediastore/record/token1/2020-01-14TZ08/08-35-02/token1-6455eb98-e344-4912-a7ef-eb2ffd8a30ee.mp4?session=f0e8a036-e785-482b-a501-aa3cbf227163

Examples

'http://192.168.100.145:8080/api/v1/ManualRecordStart?token=token1&session=f0e8a036-e785-482b-a501-aa3cbf227163'

{

  "bStatus": true,

  "strCode": "ManualRecordStart successfully",

  "strFileName": "token1-6455eb98-e344-4912-a7ef-eb2ffd8a30ee.mp4",

  "strUrl": "/mediastore/record/token1/2020-01-14TZ08/08-35-02/token1-6455eb98-e344-4912-a7ef-eb2ffd8a30ee.mp4"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_4_2_2_2

Description

Stop manual recording with the alwayscreate parameter set to false. If the alwayscreate parameter is set to false, the recording will automatically stop after the limit time has elapsed.

Usage

Request parameters | GET
URL | /api/v1/ManualRecordStart
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token

Response

Name | Type | Description
bStatus | boolean | API success or failure, true indicates success, false indicates failure
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/ManualRecordStop?token=token1&session=f0e8a036-e785-482b-a501-aa3cbf227163'

{

  "bStatus": true,

  "strCode": "ManualRecordStop successfully"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_4_3

Description

Archiving involves capturing a segment of video from a remote device or NVR and storing it on the service. It uses asynchronous APIs, and the success or failure status of the archiving can be obtained through event APIs. The Search API can be used to search for archived videos.

Usage

Request parameters | GET
URL | /api/v1/Archive
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token
start1 | int | must | Starting time: March 29, 2018
start2 | int | must | Start time 2 20-3-29 hours-minutes-seconds
duration | int | must | The duration of archiving, measured in seconds
speed | int | optional | Archiving speed, 1, 2, 4, default is 1
forceh264 | boolean | optional | true/false Whether to force transcoding from H.265 to H.264, the default is false without transcoding
tz | int | optional | 8 or -8, if there is no such parameter, the default is to use the time zone of the server

Response

Name

Type

Description

bStatus

boolean

API success or failure, true indicates success, false indicates failure. Because the API is asynchronous, API return success indicates API call success. You can obtain the screenshot result status through the event API, or use GetArchiveStatus to capture the screenshot progress.

strCode

string

Specific description of API success or failure

strFileName

string

file name

strUrl

string

File path. If the file is successfully archived, you can add the service port and session to access the file, such as:

http://192.168.100.145:8080/mediastore/archive/device1--33/2020-01-14TZ08/09-54-24/device1--33-9d3742a0-84d2-4d5d-bb11-1da1b450cfbc.mp4?session=f0e8a036-e785-482b-a501-aa3cbf227163

or

https://192.168.100.145:8443/mediastore/archive/device1--33/2020-01-14TZ08/09-54-24/device1--33-9d3742a0-84d2-4d5d-bb11-1da1b450cfbc.mp4?session=f0e8a036-e785-482b-a501-aa3cbf227163

Examples

'http://192.168.100.145:8080/api/v1/Archive?token=cfab--35&start1=2021-12-8&start2=8-30-6&duration=20&speed=1&session=f0e8a036-e785-482b-a501-aa3cbf227163&forceh264=true'

{

  "bStatus": true,

  "strCode": "Archive successfully",

  "strFileName": "device1--33-9d3742a0-84d2-4d5d-bb11-1da1b450cfbc.mp4",

  "strUrl": "/mediastore/archive/device1--33/2020-01-14TZ08/09-54-24/device1--33-9d3742a0-84d2-4d5d-bb11-1da1b450cfbc.mp4"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_4_3_4

Description

Archiving captures images from remote devices or NVRs and stores them on the service. The asynchronous API can be used to obtain the success or failure status of archiving captures through the event API. The Search API can be used to search for archived captures.

Usage

Request parameters | GET
URL | /api/v1/ArchiveSnapshot
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token
start1 | int | must | Starting time: March 29, 2018
start2 | int | must | Start time 2 20-3-29 hours-minutes-seconds
num | int | optional | The number of screenshots, default 1, minimum 1, maximum 2147483647
internal | int | optional | If the number of captured images is greater than 1, this parameter indicates the interval time, in seconds

Response

Name

Type

Description

bStatus

boolean

The API is successful or failed. true indicates success and false indicates failure. Because the API is asynchronous, a successful API return indicates a successful API call. You can obtain the screenshot result status through the event API or by delaying access to determine whether the file exists to obtain the screenshot status. The delay needs to be greater than 2 seconds.

strCode

string

Specific description of API success or failure

strFileName

string

file name

strUrl

string

File path. If the screenshot is successful, you can add the service port and session to access the file, such as:

http://192.168.100.145:8080/mediastore/snapshot/81ae--1/2022-06-17TZ08/16-01-01/81ae--1-1c18dc86-ed7d-4262-9986-d562aca71d7b.jpg?session=f0e8a036-e785-482b-a501-aa3cbf227163

or

https://192.168.100.145:8443/mediastore/snapshot/81ae--1/2022-06-17TZ08/16-01-01/81ae--1-1c18dc86-ed7d-4262-9986-d562aca71d7b.jpg?session=f0e8a036-e785-482b-a501-aa3cbf227163

Examples

'http://192.168.100.145:8080/api/v1/ArchiveSnapshot?token=cfab--35&start1=2021-12-8&start2=8-30-6&session=f0e8a036-e785-482b-a501-aa3cbf227163'

{

  "bStatus": true,

  "strCode": "Archive Snap shot start successfully",

  "strFileName": "cfab--36-0efe7498-9bc9-411a-84e8-7a1c1c81e773.jpg",

  "strUrl": "/mediastore/snapshot/cfab--36/2021-12-09TZ08/18-32-17/cfab--36-0efe7498-9bc9-411a-84e8-7a1c1c81e773.jpg"


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_4_3_2

Description

Get the archive status.

Usage

Request parameters | GET
URL | /api/v1/GetArchiveStatus
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token
filename | int | must | The file name returned by the archiving API, strFileName field

Response

Name | Type | Description
nPercentage | int | -1 indicates failure, 1 to 99 indicate in progress, 100 indicates success, and 0 indicates non-existence or cleanup.
strCode | string | Specific description of API success or failure

Examples

'http://192.168.100.145:8080/api/v1/GetArchiveStatus?token=device1--33&filename=device1--33-9d3742a0-84d2-4d5d-bb11-1da1b450cfbc.mp4&session=f0e8a036-e785-482b-a501-aa3cbf227163'

{

  "strCode": "Archive status successfully",

  "nPercentage": 21


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_4_3_3

Description

The search service video API can search for screenshots/videos/archives on the server.

Usage

Request parameters | GET
URL | /api/v1/Search
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token
type | string | must | record or snapshot or archive
start | string | must | ISO8601 format time, such as 2018-03-07T120101+08, needs URL encoding, refer to www/tool.html
end | string | must | ISO8601 format time, such as 2018-03-07T130101+08, needs URL encoding, refer to www/tool.html

Response

Name

Type

Description

strToken

string

Video source token

strStartTime

string

Start time of video recording, ISO8601 format

strEndTime

string

Video end time, ISO8601 format

strPath

string

File path, you can add the service port and session to access the file, such as:

http://192.168.100.145:8080/mediastore/archive/device1--33/2020-01-14TZ08/09-54-24/device1--33-9d3742a0-84d2-4d5d-bb11-1da1b450cfbc.mp4?session=f0e8a036-e785-482b-a501-aa3cbf227163

or

https://192.168.100.145:8443/mediastore/archive/device1--33/2020-01-14TZ08/09-54-24/device1--33-9d3742a0-84d2-4d5d-bb11-1da1b450cfbc.mp4?session=f0e8a036-e785-482b-a501-aa3cbf227163

strDuration

int

Video duration, if it is a screenshot, this field is 0

Examples

'http://192.168.100.145:8080/api/v1/Search?type=archive&start=2020-01-13T120101%2b08&end=2020-01-14T130101%2b08&token=device1--33&session=f0e8a036-e785-482b-a501-aa3cbf227163'

{

  "record": [

       {

          "strToken": "device1--33",

          "strStartTime": "2020-01-14T09:54:24+08:00",

          "strEndTime": "2020-01-14T09:56:44+08:00",

          "strDuration": "140",

          "strPath": "/mediastore/archive/device1--33/2020-01-14TZ08/09-54-24/device1--33-9d3742a0-84d2-4d5d-bb11-1da1b450cfbc.mp4"

       },

       {

          "strToken": "device1--33",

          "strStartTime": "2020-01-14T10:16:39+08:00",

          "strEndTime": "2020-01-14T10:16:39+08:00",

          "strDuration": "0",

          "strPath": "/mediastore/archive/device1--33/2020-01-14TZ08/10-16-39/device1--33-f77ee541-066f-489a-afdf-9295b3d4c651.mp4"

       }

   ]


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_4_3_3_2

Description

Searching for remote video API can search for video from access devices (NVR) or platforms.

Usage

Request parameters | GET
URL | /api/v1/SearchDeviceRecordByTime
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login
token | string | must | Video source token generated by device or GB28181
type | string | must | record or snapshot or archive
start | string | must | ISO8601 format time, such as 2018-03-07T120101+08, needs URL encoding, refer to www/tool.html
end | string | must | ISO8601 format time, such as 2018-03-07T130101+08, needs URL encoding, refer to www/tool.html

Response

Name | Type | Description
bFinished | boolean | Whether the search is complete in the input time period. If false, the end time of the last video returned can be used as the start parameter to re-search, which can fully search all video segments
strStartTime | string | Video start time, ISO8601 format
strEndTime | string | End time of video recording, ISO8601 format
nType | string | H5_REC_MANUAL/H5_REC_SCHEDULE/H5_REC_ALARM Manual video recording/scheduled video recording/alarm video recording

Examples

'http://192.168.100.145:8080/api/v1/SearchDeviceRecordByTime?token=edf8--35&start=2020-1-13T00:00:00%2b08&end=2020-1-13T23:59:59%2b08&session=f0e8a036-e785-482b-a501-aa3cbf227163'

{

  "bFinished": true,

  "record": [

       {

          "strStartTime": "2020-01-12T22:25:52+08:00",

          "strEndTime": "2020-01-12T22:40:52+08:00",

          "nType": "H5_REC_MANUAL"

       },

       {

          "strStartTime": "2020-01-12T22:40:52+08:00",

          "strEndTime": "2020-01-12T22:55:52+08:00",

          "nType": "H5_REC_MANUAL"

       },

   ]


区域管理(Region)

Region

Regional management related functions.


用户登录_2_2_3_2_2_2_2_2_2_2_2_2_2_4_2_2_4_4

Description

Get the list of regions.

Usage

Request parameters | GET
URL | /api/v1/GetRegion
data | none

Parameters

Name | Type | Parameter mandatory | Description
session | string | must | Session obtained by Login

Response

Name | Type | Description
root | root node | Root is a circular recursive data structure
strName | string | Region Name
strToken | string | Regional token
cam | array | The video source token list under the region. For detailed information about the video source, refer to the src field
node | struct | Lower level areas
src | struct | Reference video source management-》Video source data format

Examples

'http://192.168.100.126:8080/api/v1/GetRegion?session=2519d427-7819-445b-8cda-0a1f961a1ee9'

{

  "root": {

      "strName": "root",

      "strToken": "root",

      "cam": [

           {

              "strToken": "0315--1"

           }

       ],

      "node": [

           {

              "strName": "ground floor",

              "strToken": "7382ef8a-344d-40df-9694-224ae48a0d4d",

              "cam": [

                   {

                      "strToken": "e8f9--1"

                   }

               ],

              "node": []

           }

       ]

   },

  "src": [

       {

          "nType": "H5_CH_DEV",

          "strName": "Camera 186",

          "strToken": "0315--1",

          "strUrl": "invalid",

          "strUser": "invalid",

          "strPasswd": "******",

          "bPasswdEncrypt": false,

          "bEnableAudio": false,

          "nConnectType": "H5_AUTO",

          "nRTSPType": "H5_RTSP_AUTO",

          "strSrcIpAddress": "invalid",

          "strSrcPort": "invalid",

          "nChannelNumber": 0,

          "bEnableUrlSub": false,

          "strUrlSub": "",

          "bOnvifProfileAuto": true,

          "strOnvifAddr": "invalid",

          "strOnvifProfileMain": "invalid",

          "strOnvifProfileSub": "invalid",

          "bRTSPPlayback": false,

          "nRTSPPlaybackSpeed": 1,

          "bOnline": true,

          "strSnapshotUrl": "/api/v1/GetImage?token=0315--1",

          "bRec": false,

          "strPushUrl": "none",

          "strServerToken": "",

          "strOriginalToken": "",

          "strServerUuid": "",

          "nOriginalType": "H5_ZERO",

          "strDeviceId": "",

          "strDeviceName": "",

          "bDisable": false,

          "bIdle": false

       },

       {

          "nType": "H5_CH_DEV",

          "strName": "Camera 01",

          "strToken": "e8f9--1",

          "strUrl": "invalid",

          "strUser": "invalid",

          "strPasswd": "******",

          "bPasswdEncrypt": false,

          "bEnableAudio": false,

          "nConnectType": "H5_AUTO",

          "nRTSPType": "H5_RTSP_AUTO",

          "strSrcIpAddress": "invalid",

          "strSrcPort": "invalid",

          "nChannelNumber": 0,

          "bEnableUrlSub": false,

          "strUrlSub": "",

          "bOnvifProfileAuto": true,

          "strOnvifAddr": "invalid",

          "strOnvifProfileMain": "invalid",

          "strOnvifProfileSub": "invalid",

          "bRTSPPlayback": false,

          "nRTSPPlaybackSpeed": 1,

          "bOnline": true,

          "strSnapshotUrl": "/api/v1/GetImage?token=e8f9--1",

          "bRec": false,

          "strPushUrl": "none",

          "strServerToken": "",

          "strOriginalToken": "",

          "strServerUuid": "",

          "nOriginalType": "H5_ZERO",

          "strDeviceId": "",

          "strDeviceName": "",

          "bDisable": false,

          "bIdle": false

       }

   ]


录像管理(Record)_2

JS video playback SDK

The JS video playback SDK provides interfaces for real-time video and playback in the HTML5 environment. The JS video playback SDK requires the www/js/h5splayer.js package to be referenced. Refer to the www/rtc.html example. This section introduces the relevant interfaces. The following are relevant examples. You can open ws.html and rtc.html to reference the relevant code.

http://localhost:8080/ws.html?token=token2

http://localhost:8080/rtc.html?token=token2

http://localhost:8080/ws.html?token=token2&stream=main

http://localhost:8080/rtc.html?token=token2&stream=sub

If you need to automatically play, starting from r11.3, ws.html and rtc.html support automatic playback, and you can add autoplay=true.

http://192.168.100.122:8080/rtc.html?token=token1&autoplay=true

http://192.168.100.122:8080/ws.html?token=token1&autoplay=true

http://localhost:8080/rtmp.html?token=token2

http://localhost:8080/rtmp2.html?token=token2

The token needs to be replaced with the configured token or generated token. If it is an NVR or platform device, you can view the corresponding token in the management interface Setting-》Device-》All. Alternatively, you can use GetDeviceSrc/GetGbDeviceSrc/GetCloudDeviceSrc to obtain it separately. For specific usage methods, please refer to the API documentation.

If authentication is enabled for the service, you need to obtain a session from the Login API and keep it alive using the Keepalive API (the default timeout is 600 seconds). To add a session to the original address, use the following command format.

http://192.168.100.145:8080/ws.html?token=1d4f&session=4ec47fb4-a74a-4e02-96a1-369151cfcb09


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_5_2_2

Interface Description

The javascript interface parameters are as follows：

var conf = {

videoid:'h5sVideo1', //{string} - id of the video element tag

videodom: h5svideodom1, //{object} - video dom. if there has videoid, just use the videoid

protocol: window.location.protocol, // {string} - 'http:' or 'https:'

host: window.location.host, //{string} - 'localhost:8080'

rootpath:window.location.pathname, // {string} - path of the app running

token:'token1', // {string} - token of stream

streamprofile: 'main', // {string} - stream profile, main/sub or other predefine transcoding profile

pbconf: pbconf1, //This is optional, if no pbconf, this will be live.

hlsver:'v1', //{string} - v1 is for ts, v2 is for fmp4

session:'c1782caf-b670-42d8-ba90-2244d0b0ee83', //{string} - session got from login

consolelog: 'true' // 'true' or 'false' enable/disable console.log

};

Parameters

Name | Type | Parameter mandatory | Description
videoid | string | optional | HTML5 video element id，videoid和videodom either-or
videodom | string | optional | HTML5 video DOM，videoid和videodom either-or
protocol | string | must | agreement 'http:' or 'https:'
host | string | must | Service Host 'localhost:8080' or '192.168.1.1:8080'
rootpath | string | must | API root path, the default is '/'. If the service is proxied, fill in the proxied path
token | string | must | Video source token
streamprofile | string | optional | main/sub or predefined transcoding profile token, effective for real-time video
pbconf | string | optional | The playback configuration item is empty in real time. For the specific format, refer to the playback video interface parameters
hlsver | string | optional | Outdated parameter, keep 'v1'
session | string | must | Session obtained by Login
consolelog | string | optional | Whether to enable the playback of SDK logs, enabled by default

Examples

See the example at www/rtc.html.


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_5_2_2_2

Description

The javascript interface parameters are as follows. Remote playback refers to playback from the NVR or third-party platform, and service playback refers to playback from H5S video data.

function PlaybackCB(event, userdata)

{

var msgevent = JSON.parse(event);

if (msgevent.type === 'H5S_EVENT_PB_TIME')

{

}

if (msgevent.type === 'H5S_EVENT_PB_SESSION_ID')

{

}

}

var pbconf1 = {

begintime: '2019-03-23T120101+08',//{string} begintime 0 for fileplayback

endtime: '2019-03-23T150101+08',//{string} endtime 0 for fileplayback

autoplay: 'true', // 'true' or 'false' for playback autoplay

showposter: 'true', //'true' or 'false' show poster

serverpb: 'true', //'true' or 'false' playback from h5stream record, default false

filename: 'token1.mp4', // file name need to playback (begintime == 0 & endtime == 0 and serverpb is true)

callback: PlaybackCB, //{function}(event(string), userdata(object))

userdata: user data // user data

};

var conf = {

videoid:'h5sVideo1', //{string} - id of the video element tag

videodom: h5svideodom1, //{object} - video dom. if there has videoid, just use the videoid

protocol: window.location.protocol, // {string} - 'http:' or 'https:'

host: window.location.host, //{string} - 'localhost:8080'

rootpath:window.location.pathname, // {string} - path of the app running

token:'token1', // {string} - token of stream

streamprofile: 'main', // {string} - stream profile, main/sub or other predefine transcoding profile

pbconf: pbconf1, //This is optional, if no pbconf, this will be live.

hlsver:'v1', //{string} - v1 is for ts, v2 is for fmp4

session:'c1782caf-b670-42d8-ba90-2244d0b0ee83', //{string} - session got from login

consolelog: 'true' // 'true' or 'false' enable/disable console.log

};

Parameters

The conf interface parameters refer to the real-time video interface parameters. The following is an introduction to the playback parameters.

Name | Type | Parameter mandatory | Description
begintime | string | must | Playback start time, ISO 8601 format
endtime | string | must | Playback end time, ISO 8601 format
autoplay | string | must | Whether to play automatically
showposter | string | must | Whether to display the latest data frame of the video source cache
serverpb | string | must | Is it service playback or remote playback
filename | string | optional | When both begintime and endtime are '0', it means playback by file name. When playing back by file name, filename is the file name returned by the video command, such as"strFileName": "107-e88c9fae-2c56-4329-b9e2-ec99dd36ab9d.mp4"
callback | function | must | Replay event callback
userdata | object | must | Replay event callback parameters

The callback function will provide the current playback information. The specific event description is as follows:

Type | Description
H5S_EVENT_PB_SESSION_ID | Replay the session ID, which is called before the playback data starts. You can use PbSnapshot to capture the data that was replayed at that time
H5S_EVENT_PB_TIME | Playback progress, call every second

Examples

For remote playback, please refer to www/playback2.html

For file-based playback during service playback, refer to www/serverfilepb.html

For time-based playback during service playback, please refer to www/serverpb.html


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_5_2_2_2_2

Description

The javascript interface parameters are as follows.

function H5sPlayerWS(conf)

H5sPlayerWS.prototype.connect

H5sPlayerWS.prototype.disconnect

Playback Control

H5sPlayerWS.prototype. start

H5sPlayerWS.prototype. pasue

H5sPlayerWS.prototype. resume

Parameters

The conf parameter refers to the real-time video interface parameters and playback video interface parameters. When WS is used for playback, control and speedup are not supported.

Examples

Please refer to the example at www/ws.html.


用户登录_2_2_3_2_2_2_2_2_2_3_3_2_5_2_2_2_2_2

Description

The javascript interface parameters are as follows.

function H5sPlayerRTC(conf)

H5sPlayerRTC.prototype.connect

H5sPlayerRTC.prototype.disconnect

Playback Control

H5sPlayerRTC.prototype. start

H5sPlayerRTC.prototype. pasue

H5sPlayerRTC.prototype. resume

H5sPlayerRTC.prototype. speed(x) //x 0.5 1 2 4 8 16

H5sPlayerRTC.prototype. seek(x) //x The offset from the start playback time is in seconds

Parameters

The conf parameter refers to the real-time video interface parameters and playback video interface parameters.

Examples

Please refer to the example at www/rtc.html.


Appendix A FAQ

1.Is there any naming rule for tokens in h5s?

The token of h5s is composed of letters and numbers, supports a single hyphen and underscore, and does not support special characters (such as @#$ etc.). Correct examples include token1_1 token1-1. Double hyphens are not supported, and examples of unsupported tokens include token1--1.