海康威视摄像头HTTP接口能力调研报告文档格式.docx
《海康威视摄像头HTTP接口能力调研报告文档格式.docx》由会员分享,可在线阅读,更多相关《海康威视摄像头HTTP接口能力调研报告文档格式.docx(21页珍藏版)》请在冰豆网上搜索。
(1)摄像头(IPC/IPD)
地址格式:
rtsp:
//username:
pwd@ip:
port[554]/h264/ch1/码流类型/av_stream
码流类型:
main表示为主码流,sub表示为子码流
举例:
IPC主码流:
//admin:
Nuctech123@192.168.25.6:
10010/h264/ch1/main/av_stream
IPC子码流:
10010/h264/ch1/sub/av_stream
(2)NVR
//username:
pwd@ip:
port/h264/ch<
number>
/码流类型/av_stream
其中:
ch<
number>
,1-32是模拟通道,33以后是IP通道。
IPC@NVR:
abc123@192.168.25.6:
10011/h264/ch33/main/av_stream
IPD@NVR:
10011/h264/ch34/main/av_stream
3.3录像回放
RTSP地址格式:
port/Streaming/tracks/101?
starttime=yyyymmddtHHMMSSz&
endtime=yyyymmddtHHMMSSz
举例:
10011/Streaming/tracks/101?
starttime=20150710t102012z&
endtime=20150710t113016z
4.HTTP接口
海康设备对外提供CGI和ISAPI两种接口,设备信息和配置推荐使用ISAPI接口,云台控制则推荐使用CGI接口。
接口入口地址:
http:
//ip:
port[80]/
接口协议:
HTTP
消息格式:
XML
接口形式:
采用REST风格模式,GET表示读取当前信息、PUT表示更新配置、POST表示创建数据、DELETE表示删除配置。
4.1设备信息
4.1.1基本信息
调用地址:
/ISAPI/System/deviceInfo
返回消息:
<
?
xmlversion="
1.0"
encoding="
utf-8"
>
DeviceInfoxmlns="
//www.std-version="
2.0"
<
deviceName>
IPDOME<
/deviceName>
deviceID>
ef947dd1-f70b-11b4-83a0-c056e38ef866<
/deviceID>
deviceDescription>
IPDome<
/deviceDescription>
deviceLocation>
STD-CGI<
/deviceLocation>
systemContact>
/systemContact>
model>
DS-2DE7184-A<
/model>
serialNumber>
DS-2DE7184-A20140928CCCH482033105<
/serialNumber>
macAddress>
c0:
56:
e3:
8e:
f8:
66<
/macAddress>
firmwareVersion>
V5.2.7<
/firmwareVersion>
firmwareReleasedDate>
build150129<
/firmwareReleasedDate>
encoderVersion>
V5.0<
/encoderVersion>
encoderReleasedDate>
build141009<
/encoderReleasedDate>
bootVersion>
V1.3.4<
/bootVersion>
bootReleasedDate>
100316<
/bootReleasedDate>
hardwareVersion>
0x0<
/hardwareVersion>
deviceType>
/deviceType>
telecontrolID>
88<
/telecontrolID>
supportBeep>
false<
/supportBeep>
supportVideoLoss>
/supportVideoLoss>
/DeviceInfo>
4.1.2设备状态
/ISAPI/System/status
DeviceStatusxmlns="
currentDeviceTime>
2015-07-30T14:
40:
27+08:
00<
/currentDeviceTime>
deviceUpTime>
185225<
/deviceUpTime>
CPUList>
CPU>
cpuDescription>
ARM926EJ-Sid(wb)[41069265]revision5(ARMv5TEJ)<
/cpuDescription>
cpuUtilization>
58<
/cpuUtilization>
/CPU>
/CPUList>
MemoryList>
Memory>
memoryDescription>
DDRMemory<
/memoryDescription>
memoryUsage>
91<
/memoryUsage>
memoryAvailable>
8624<
/memoryAvailable>
/Memory>
/MemoryList>
/DeviceStatus>
4.1.3重启设备
/ISAPI/System/reboot
4.1.4恢复出厂设置
/ISAPI/System/factoryDefault
4.2图像抓拍
/ISAPI/Streaming/channels/ID/picture
截图本身的二进制数据流
4.3告警通知
4.3.1设置告警开关
全部配置:
/ISAPI/Event/triggers
EventNotificationxmlns="
EventTriggerListversion="
EventTriggerversion="
id>
VMD-1<
/id>
eventType>
VMD<
/eventType>
eventDescription>
VMDEventtriggerInformation<
/eventDescription>
videoInputChannelID>
1<
/videoInputChannelID>
dynVideoInputChannelID>
/dynVideoInputChannelID>
EventTriggerNotificationListversion="
EventTriggerNotification>
center<
notificationMethod>
/notificationMethod>
notificationRecurrence>
beginning<
/notificationRecurrence>
/EventTriggerNotification>
/EventTriggerNotificationList>
/EventTrigger>
videoloss-1<
videoloss<
VideolossEventtriggerInformation<
……
/EventTriggerList>
/EventNotification>
某项配置:
/Event/triggers/ID
实际地址:
/Event/triggers/VMD-1
EventTriggerxmlns="
4.3.2配置告警中心
告警中心可以理解为一个HTTP服务,具体地址信息配置到设备中,当有告警发生,并告警通知设置了为通知告警中心,则设备会根据设定间隔向指定的URL地址发送具体告警信息的XML文。
具体配置的写入则通过PUT消息来实现。
调用地址:
/ISAPI/Event/notification/httpHosts
返回消息:
HttpHostNotificationListxmlns="
HttpHostNotificationversion="
<
url>
/ipd-warn/notify<
/url>
protocolType>
HTTP<
/protocolType>
parameterFormatType>
XML<
/parameterFormatType>
addressingFormatType>
ipaddress<
/addressingFormatType>
ipAddress>
192.111.111.224<
/ipAddress>
portNo>
8080<
/portNo>
userName/>
httpAuthenticationMethod>
none<
/httpAuthenticationMethod>
/HttpHostNotification>
/HttpHostNotificationList>
4.3.3告警消息示例
POST/ipd-warn/notifyHTTP/1.1
Content-Type:
application/xml;
charset="
UTF-8"
Host:
192.111.111.235
Connection:
Keep-Alive
Content-Length:
799
EventNotificationAlertversion="
xmlns="
urn:
psialliance-org"
192.111.111.235<
c4:
2f:
90:
33:
36<
channelID>
/channelID>
dateTime>
2015-07-29T17:
05:
46+08:
/dateTime>
activePostCount>
51<
/activePostCount>
eventState>
active<
/eventState>
Motionalarm<
Extensionsversion="
serialNumberxmlns="
selfextension:
psiaext-ver10-xsd"
DS-2CD2T20-I320150605AACH520982018<
eventPushxmlns="
VMD&
&
DS-2CD2T20-I320150605AACH520982018,2015-07-29T17:
00,1,1.0<
/eventPush>
/Extensions>
/EventNotificationAlert>
4.3.4告警消息格式说明
(1)XML节点
ipAddress:
设备的IP地址
protocolType:
协议类型,只支持HTTP
macAddress:
设备的MAC地址
channelID:
通道号
dateTime:
发生报警的时间
activePostCount:
该类型报警发生的次数
eventType:
事件类型:
eventState:
事件状态
eventDescription:
时间描述
Extensions:
私有信息,内部用序列号、事件类型、时间等
(2)事件类型(eventType)的含义
IO:
报警输入报警
VMD:
移动侦测
videoloss:
视频丢失
shelteralarm:
遮挡报警
facedetection:
人脸侦测
defocus:
虚焦侦测
audioexception:
音频异常
scenechangedetection:
场景变更
fielddetection:
区域入侵
linedetection:
越界侦测
regionEntrance:
进入区域
regionExiting:
离开区域
loitering:
徘徊侦测
group:
人员聚集
rapidMove:
快速移动
parking:
停车侦测
unattendedBaggage:
物品遗留
attendedBaggage:
物品拿去
PIR:
人体检测
4.4云台控制
4.4.1云台设置
/PTZCtrl/channels/1/presets
PTZPresetListxmlns="
PTZPreset>
enabled>
true<
/enabled>
33<
presetName>
自动翻转<
/presetName>
/PTZPreset>
34<
回到零点<
35<
巡航扫描1<
39<
白天模式<
40<
黑夜模式<
41<
花样扫描1<
……
45<
一键巡航<
92<
设置手动限位<
93<
确认手动限位<
94<
远程重启<
96<
停止扫描<
97<
随机扫描<
98<
帧扫描<
99<
自动扫描<
100<
垂直扫描<
101<
全景扫描<
102<
巡航扫描5<
PTZPre