海康威视摄像头HTTP接口能力调研报告Word格式.docx
《海康威视摄像头HTTP接口能力调研报告Word格式.docx》由会员分享,可在线阅读,更多相关《海康威视摄像头HTTP接口能力调研报告Word格式.docx(19页珍藏版)》请在冰豆网上搜索。
设备类型
设备型号
IP地址
管理账号
密码
枪机
DS-2CD2T20-I3
admin
Nuctech123
录相机
DS-8608N-E8
球机
DS-2DE7184-A
端口映射
3)设备配置注意事项
IPC和NVR均需要通过修改管理员密码才可以激活,然后接入网络;
录相机(NVR)标准配置都是不带硬盘,所以需要事先准备好SATA硬盘;
录相机(NVR)在接入枪机时,自动识别的设备协议为“海康协议”但实际需要根据说明书修改为ONVIF才可以,否则会一直报“未知错误“;
枪机(IPC)须另备DC12VΦ5.5mm圆头电源;
设备因为是租借来的,所以不是全新,建议配置调试之前先做出厂设置;
3.视频监控
3.1主码流与字码流
主码流与子码流是海康威视提出的概念,是为了解决在网络情况不好时为了满足远程预览的流畅性,而不影响本地录像提出的双码流技术,主码流分辨率高于子码流,主码流用来录像,子码流用来网传,默认客户端访问采用主码流,客户可以根据网络情况选择子码流访问,以达到改善网络浏览的流畅性,而又不改变本地录像的录像效果。
3.2RTSP地址格式
(1)摄像头(IPC/IPD)
地址格式:
username:
pwd@ip:
port[554]/h264/ch1/码流类型/av_stream
码流类型:
main表示为主码流,sub表示为子码流
举例:
IPC主码流:
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:
3/main/av_stream
IPD@NVR:
3.3录像回放
RTSP地址格式:
port/Streaming/tracks/101?
starttime=yyyymmddtHHMMSSz&
endtime=yyyymmddtHHMMSSz
举例:
4.HTTP接口
海康设备对外提供CGI和ISAPI两种接口,设备信息和配置推荐使用ISAPI接口,云台控制则推荐使用CGI接口。
接口入口地址:
ip:
port[80]/
接口协议:
HTTP
消息格式:
XML
接口形式:
采用REST风格模式,GET表示读取当前信息、PUT表示更新配置、POST表示创建数据、DELETE表示删除配置。
4.1设备信息
4.1.1基本信息
调用地址:
/ISAPI/System/deviceInfo
返回消息:
<
?
xmlversion="
1.0"
encoding="
utf-8"
>
<
deviceName>
IPDOME<
/deviceName>
deviceID>
ef947dd1-f70b-11b4-83a0-c056e38ef866<
/deviceID>
deviceDescription>
IPDome<
/deviceDescription>
deviceLocation>
STD-CGI<
/deviceLocation>
systemContact>
/systemContact>
model>
DS-2DE7184-A<
/model>
macAddress>
c0:
56:
e3:
8e:
f8:
66<
/macAddress>
firmwareReleasedDate>
build150129<
/firmwareReleasedDate>
encoderVersion>
V5.0<
/encoderVersion>
encoderReleasedDate>
build141009<
/encoderReleasedDate>
bootReleasedDate>
100316<
/bootReleasedDate>
hardwareVersion>
0x0<
/hardwareVersion>
deviceType>
/deviceType>
telecontrolID>
88<
/telecontrolID>
supportBeep>
false<
/supportBeep>
supportVideoLoss>
/supportVideoLoss>
/DeviceInfo>
4.1.2设备状态
/ISAPI/System/status
currentDeviceTime>
2015-07-30T14:
40:
27+08:
00<
/currentDeviceTime>
deviceUpTime>
185225<
/deviceUpTime>
CPUList>
CPU>
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
.std-version="
2.0"
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="
htt
4.3.2配置告警中心
告警中心可以理解为一个HTTP服务,具体地址信息配置到设备中,当有告警发生,并告警通知设置了为通知告警中心,则设备会根据设定间隔向指定的URL地址发送具体告警信息的XML文。
具体配置的写入则通过PUT消息来实现。
调用地址:
/ISAPI/Event/notification/httpHosts
返回消息:
HttpHostNotificationversion="
<
url>
/ipd-warn/notify<
/url>
protocolType>
HTTP<
/protocolType>
parameterFormatType>
XML<
/parameterFormatType>
addressingFormatType>
ipaddress<
/addressingFormatType>
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"
Connection:
Keep-Alive
Content-Length:
799
EventNotificationAlertversion="
xmlns="
urn:
psialliance-org"
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-2
/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
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<
106<
风扇常开模式<
107<
风扇常闭模式<
108<
风扇温控模式<
/PTZPresetList>
4.4.2巡航指令
/PTZCtrl/channels/<
ID>
/presets/<
/goto
全景扫描:
停止扫描:
96/goto
回到零点:
34/goto
4.4.3控制台指令
/PTZ/channels/ID/PTZControl
参数说明:
command、mode、speed、presetNo、patrolNo
Thevalueofcommandis:
LIGHT:
Light
WIPER:
Wiper
FAN:
Fan
HEATER:
Heater.
AUX1:
auxiliaryequipment1.
AUX2:
auxiliaryequipment2
SET_PRESET:
Setpreset
CLE_PRESET:
Clearpreset.
ZOOM_IN:
Zoominthespecifiedspeed.
ZOOM_OUT:
Zoomoutinthespecifiedspeed.
FOCUS_NEAR:
focusnearinthespecifiedspeed.
FOCUS_FAR:
focusfar