资源描述
视频监控平台调研汇报【海康】
V1.0
目录
目录 2
1. 序言 3
2. 布署情况 3
1) 账号信息 3
2) 设备布署&端口映射 3
3) 设备配置注意事项 3
3. 视频监控 3
3.1 主码流和字码流 4
3.2 RTSP地址格式 4
3.3 录像回放 4
4. HTTP接口 4
4.1 设备信息 4
4.1.1 基础信息 4
4.1.2 设备状态 5
4.1.3 重启设备 5
4.1.4 恢复出厂设置 5
4.2 图像抓拍 6
4.3 告警通知 6
4.3.1 设置告警开关 6
4.3.2 配置告警中心 7
4.3.3 告警消息示例 7
4.3.4 告警消息格式说明 8
4.4 云台控制 8
4.4.1 云台设置 8
4.4.2 巡航指令 10
4.4.3 控制台指令 11
4.4.4 正确定位 11
5. 遗留问题 12
5.1 定位跟踪 12
5.2 合码器 12
6. 附录 12
6.1 VLC Media Player 12
6.2 手机端监控 13
6.3 DEMO程序 13
6.4 RTSP消息示例 13
1. 序言
此次从海康租借了一台硬盘录像机、一个枪机和一个球机。因为对方HTTP告警消息模块有BUG,调测花费时间较长。对方提供升级测试版本后已经处理。从现在进展情况看基础完成了我们预期目标。关键常见功效均已验证经过,包含:视频监控(VLC插件方法)、录像回放、读取设备信息、设备重启、图像抓拍、告警通知、云台控制。此次汇报关键目标是统计相关功效具体实现和验证方法方法及注意事项。
2. 布署情况
租借三台设备均布署在五层试验室,经过无线路由器连接到企业网络。
1) 账号信息
设备类型
设备型号
IP地址
管理账号
密码
枪机
DS-2CD2T20-I3
192.111.111.235
admin
Nuctech123
录相机
DS-8608N-E8
192.111.111.237
admin
Nuctech123
球机
DS-2DE7184-A
192.111.111.238
admin
Nuctech123
2) 设备布署&端口映射
3) 设备配置注意事项
Ø IPC和NVR均需要经过修改管理员密码才能够激活,然后接入网络;
Ø 录相机(NVR)标准配置全部是不带硬盘,所以需要事先准备好SATA硬盘;
Ø 录相机(NVR)在接入枪机时,自动识别设备协议为“海康协议”但实际需要根听说明书修改为ONVIF才能够,不然会一直报“未知错误“;
Ø 枪机(IPC)须另备 DC12V Φ5.5mm圆头电源;
Ø 设备因为是租借来,所以不是全新,提议配置调试之前先做出厂设置;
Ø 设备默认出厂IP均为:192.0.0.64
3. 视频监控
3.1 主码流和字码流
主码流和子码流是海康威视提出概念,是为了处理在网络情况不好时为了满足远程预览流畅性,而不影响当地录像提出双码流技术,主码流分辨率高于子码流,主码流用来录像,子码流用来网传,默认用户端访问采取主码流,用户能够依据网络情况选择子码流访问,以达成改善网络浏览流畅性,而又不改变当地录像录像效果。
3.2 RTSP地址格式
(1) 摄像头(IPC/IPD)
地址格式:rtsp:// username: pwd @ ip: port [554]/h264/ch1/码流类型/av_stream
码流类型:main表示为主码流,sub表示为子码流
举例:
IPC主码流:rtsp://admin:.6:10010/h264/ch1/main/av_stream
IPC子码流:rtsp://admin:.6:10010/h264/ch1/sub/av_stream
(2) NVR
地址格式:rtsp://username:pwd@ip:port/h264/ch<number>/码流类型/av_stream
其中:ch< number >,1-32是模拟通道,33以后是IP通道。
举例:
IPC@NVR:rtsp://admin:.6:10011/h264/ch33/main/av_stream
IPD@NVR:rtsp://admin:.6:10011/h264/ch34/main/av_stream
3.3 录像回放
RTSP地址格式:
rtsp://username:pwd@ip:port/Streaming/tracks/101?starttime=yyyymmddtHHMMSSz&endtime=yyyymmddtHHMMSSz
举例:
rtsp://admin:.6:10011/Streaming/tracks/101?starttime=0710t10z&endtime=0710t113016z
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
返回消息:
<?xml version="1.0" encoding="utf-8"?>
<DeviceInfo xmlns="http://www.std- version="2.0">
<deviceName>IP DOME</deviceName>
<deviceID>ef947dd1-f70b-11b4-83a0-c056e38ef866</deviceID>
<deviceDescription>IPDome</deviceDescription>
<deviceLocation>STD-CGI</deviceLocation>
<systemContact>STD-CGI</systemContact>
<model>DS-2DE7184-A</model>
<serialNumber>DS-2DE7184-A0928CCCH</serialNumber>
<macAddress>c0:56:e3:8e:f8:66</macAddress>
<firmwareVersion>V5.2.7</firmwareVersion>
<firmwareReleasedDate>build 150129</firmwareReleasedDate>
<encoderVersion>V5.0</encoderVersion>
<encoderReleasedDate>build 141009</encoderReleasedDate>
<bootVersion>V1.3.4</bootVersion>
<bootReleasedDate>100316</bootReleasedDate>
<hardwareVersion>0x0</hardwareVersion>
<deviceType>IPDome</deviceType>
<telecontrolID>88</telecontrolID>
<supportBeep>false</supportBeep>
<supportVideoLoss>false</supportVideoLoss>
</DeviceInfo>
4.1.2 设备状态
调用地址:/ISAPI/System/status
<?xml version="1.0" encoding="utf-8"?>
<DeviceStatus xmlns="http://www.std- version="2.0">
<currentDeviceTime>-07-30T14:40:27+08:00</currentDeviceTime>
<deviceUpTime>185225</deviceUpTime>
<CPUList>
<CPU>
<cpuDescription>ARM926EJ-Sid(wb) [41069265] revision 5 (ARMv5TEJ)</cpuDescription>
<cpuUtilization>58</cpuUtilization>
</CPU>
</CPUList>
<MemoryList>
<Memory>
<memoryDescription>DDR Memory</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
<?xml version="1.0" encoding="utf-8"?>
<EventNotification xmlns="http://www.std- version="2.0">
<EventTriggerList version="2.0">
<EventTrigger version="2.0">
<id>VMD-1</id>
<eventType>VMD</eventType>
<eventDescription>VMD Event trigger Information</eventDescription>
<videoInputChannelID>1</videoInputChannelID>
<dynVideoInputChannelID>1</dynVideoInputChannelID>
<EventTriggerNotificationList version="2.0">
<EventTriggerNotification>
<id>center</id>
<notificationMethod>center</notificationMethod>
<notificationRecurrence>beginning</notificationRecurrence>
</EventTriggerNotification>
</EventTriggerNotificationList>
</EventTrigger>
<EventTrigger version="2.0">
<id>videoloss-1</id>
<eventType>videoloss</eventType>
<eventDescription>Videoloss Event trigger Information</eventDescription>
<videoInputChannelID>1</videoInputChannelID>
<dynVideoInputChannelID>1</dynVideoInputChannelID>
<EventTriggerNotificationList version="2.0"> </EventTriggerNotificationList>
</EventTrigger>
……
</EventTriggerList>
</EventNotification>
某项配置:/Event/triggers/ID
实际地址:/Event/triggers/VMD-1
<?xml version="1.0" encoding="utf-8"?>
<EventTrigger xmlns="http://www.std- version="2.0">
<id>VMD-1</id>
<eventType>VMD</eventType>
<eventDescription>VMD Event trigger Information</eventDescription>
<videoInputChannelID>1</videoInputChannelID>
<dynVideoInputChannelID>1</dynVideoInputChannelID>
<EventTriggerNotificationList version="2.0">
<EventTriggerNotification>
<id>center</id>
<notificationMethod>center</notificationMethod>
<notificationRecurrence>beginning</notificationRecurrence>
</EventTriggerNotification>
</EventTriggerNotificationList>
</EventTrigger>
4.3.2 配置告警中心
告警中心能够了解为一个HTTP服务,具体地址信息配置到设备中,当有告警发生,并告警通知设置了为通知告警中心,则设备会依据设定间隔向指定URL地址发送具体告警信息XML文。具体配置写入则经过PUT消息来实现。
调用地址:/ISAPI/Event/notification/httpHosts
返回消息:
<?xml version="1.0" encoding="utf-8"?>
<HttpHostNotificationList xmlns="http://www.std- version="2.0">
<HttpHostNotification version="2.0">
<id>1</id>
<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/notify HTTP/1.1
Content-Type: application/xml; charset="UTF-8"
Host: 192.111.111.235
Connection: Keep-Alive
Content-Length: 799
<?xml version="1.0" encoding="UTF-8"?>
<EventNotificationAlert version="1.0" xmlns="urn:psialliance-org">
<ipAddress>192.111.111.235</ipAddress>
<protocolType>HTTP</protocolType>
<macAddress>c4:2f:90:33:f8:36</macAddress>
<channelID>1</channelID>
<dateTime>-07-29T17:05:46+08:00</dateTime>
<activePostCount>51</activePostCount>
<eventType>VMD</eventType>
<eventState>active</eventState>
<eventDescription>Motion alarm</eventDescription>
<Extensions version="1.0" xmlns="urn:psialliance-org">
<serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2T20-IAACH</serialNumber>
<eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">VMD&&DS-2CD2T20-IAACH,-07-29T17:05:46+08: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
返回消息:
<?xml version="1.0" encoding="utf-8"?>
<PTZPresetList xmlns="http://www.std- version="2.0">
<PTZPreset>
<enabled>true</enabled>
<id>33</id>
<presetName>自动翻转</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>34</id>
<presetName>回到零点</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>35</id>
<presetName>巡航扫描1</presetName>
</PTZPreset>
……
<PTZPreset>
<enabled>true</enabled>
<id>39</id>
<presetName>白天模式</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>40</id>
<presetName>黑夜模式</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>41</id>
<presetName>花样扫描1</presetName>
</PTZPreset>
……
<PTZPreset>
<enabled>true</enabled>
<id>45</id>
<presetName>一键巡航</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>92</id>
<presetName>设置手动限位</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>93</id>
<presetName>确定手动限位</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>94</id>
<presetName>远程重启</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>96</id>
<presetName>停止扫描</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>97</id>
<presetName>随机扫描</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>98</id>
<presetName>帧扫描</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>99</id>
<presetName>自动扫描</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>100</id>
<presetName>垂直扫描</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>101</id>
<presetName>全景扫描</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>102</id>
<presetName>巡航扫描5</presetName>
</PTZPreset>
……
<PTZPreset>
<enabled>true</enabled>
<id>106</id>
<presetName>风扇常开模式</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>107</id>
<presetName>风扇常闭模式</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>108</id>
<presetName>风扇温控模式</presetName>
</PTZPreset>
</PTZPresetList>
4.4.2 巡航指令
调用地址:/PTZCtrl/channels/<ID>/presets/<ID>/goto
举例:
全景扫描::10022/PTZCtrl/channels/1/presets/101/goto
停止扫描::10022/PTZCtrl/channels/1/presets/96/goto
回到零点::10022/PTZCtrl/channels/1/presets/34/goto
4.4.3 控制台指令
调用地址:/PTZ/channels/ID/PTZControl
参数说明:command、mode、speed、presetNo、patrolNo
The value of command is:
LIGHT: Light
WIPER: Wiper
FAN: Fan
HEATER: Heater.
AUX1: auxiliary equipment 1.
AUX2: auxiliary equipment 2
SET_PRESET: Set preset
CLE_PRESET: Clear preset.
ZOOM_IN: Zoom in the specified speed.
ZOOM_OUT: Zoom out in the specified speed.
FOCUS_NEAR: focus near in the specified speed.
FOCUS_FAR: focus far in the specified speed.
IRIS_OPEN: IRIS is open in the specified speed
IRIS_CLOSE: IRIS is cloesd in the specified speed
TILT_UP: PTZ is tilt up in the specified speed
TILT_DOWN: PTZ is tilt down in the specified speed
PAN_LEFT: PTZ is pan left in the specified speed
PAN_RIGHT: PTZ is pan right in the specified speed
UP_LEFT: PTZ is up-left in the specified speed
UP_RIGHT: PTZ is up-right in the specified speed
DOWN_LEFT: PTZ is down-left in the specified speed
DOWN_RIGHT: PTZ is down-right in the specified speed
PAN_AUTO: PTZ scans pan with the specified speed.
MEM_PATTERN: memory pattern.
RUN_PATTERN: Start pattern.
PATROL: patrol.
GOTO_PRESET: Go to preset.
"mode" value is "start" and "stop". It indicates the "start" or "stop" of some actions for PTZ,
or the "turn on" or "turn off" of external equipment power for PTZ. The default is "start".
In addition to the "SET_PRESET", "CLE_PRESET", "RUN_PATTERN" and
"GOTO_PRESET" command, all commands require the "mode" query parameters.
"speed" range is 1-7.
When the command is "ZOOM_IN", "ZOOM_OUT", "FOCUS_NEAR", "FOCUS_FAR",
"IRIS_OPEN", or "IRIS_CLOSE", the default is 1.
When the command is "TILT_UP", "TILT_DOWN", "PAN_LEFT", "PAN_RIGHT",
"UP_LEFT", "UP_RIGHT", "DOWN_LEFT", "DOWN_RIGHT", "PAN_AUTO", the default is 3.
4.4.4 正确定位
调用地址:PTZCtrl/channels/1/continuous
请求消息:
<PTZData version="1.0" xmlns="
<pan>0</pan>
<tilt>-80</tilt>
<zoom>0</zoom>
</PTZData>
5. 遗留问题
5.1 定位跟踪
定位模块提供目标坐标后,怎样经过该位置坐标和摄像头位置坐标计算出摄像头跟踪显示该目标所需要调整角度或对应云台动作指令参数。
5.2 合码器
NVR没有将多路视频合并成一路视频功效,需要单独采购合码器支持合码功效,能够将多路视频合成一路视频输出。假如没有合码器,只能是一个插件同时只能显示一路视频。
6. 附录
6.1 VLC Media Player
Ø 下载地址列表:
Ø 最新版本:
也能够经过VLC插件方法在浏览器中实现视频接入,具体代码以下
<html><body>
<object type='application/x-vlc-plugin' id='vlc' events='True' width="720" height="540" pluginspage="http://www.videolan.org" codebase="http://downloads.videolan.org/pub/videolan/vlc-webplugins/2.0.6/npapi-vlc-2.0.6.tar.xz">
<param name='mrl' value='rtsp://admin:.6:10010/h264/ch1/sub/av_stream' />
<param name='volume' value='50' />
<param name='autoplay' value='true' />
<param name='loop' value='false' />
<param name='fullscreen' value='false' />
</object></body></html>
6.2 手机端监控
安装海康手机监控软件(iVMS-4500)即可。
APP下载地址:
具体配置及效果图
6.3 DEMO程序
设备安装配置好以后,能够经过海康提供ClientDemo程序来测试验证。
6.4 RTSP消息示例
OPTIONS rtsp://192.168.25.6:10010/h264/ch1/main/av_stream RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.2.1 (LIVE555 Streaming Media v.07.25)
RTSP/1.0 200 OK
CSeq: 2
Public: OPTIONS, DESCRIBE, PLAY, PAUSE, SETUP, TEARDOWN, SET_PARAMETER, GET_PARAMETER
Date: Tue, Jul 14 13:10:15 GMT
DESCRIBE rtsp://192.168.25.6:10010/h264/ch1/main/av_stream RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.2.1 (LIVE555 Streaming Media v.07.25)
Accept: application/sdp
RTSP/1.0 401 Unauthorized
CSeq: 3
WWW-Authenticate: Digest realm="c42f9033f836", nonce="05dff23367cb73d755cf0115e0266a94", stale="FALSE"
WWW-Authenticate: Basic realm="c42f9033f836"
Date: Tue, Jul 14 13:10:15 GMT
DESCRIBE rtsp://192.168.25.6:10010/h264/ch1/main/av_stream RTSP/1.0
CSeq
展开阅读全文