('视频监控平台调研报告【海康】V1.0目录目录.............................................................................................................................................................21.前言......................................................................................................................................................32.部署情况..............................................................................................................................................31)账号信息................................................................................................................................32)设备部署&端口映射..............................................................................................................33)设备配置注意事项.................................................................................................................33.视频监控..............................................................................................................................................33.1主码流与字码流........................................................................................................................43.2RTSP地址格式...........................................................................................................................43.3录像回放....................................................................................................................................44.HTTP接口.............................................................................................................................................44.1设备信息....................................................................................................................................44.1.1基本信息.........................................................................................................................44.1.2设备状态.........................................................................................................................54.1.3重启设备.........................................................................................................................54.1.4恢复出厂设置..................................................................................................................54.2图像抓拍....................................................................................................................................64.3告警通知....................................................................................................................................64.3.1设置告警开关..................................................................................................................64.3.2配置告警中心..................................................................................................................74.3.3告警消息示例..................................................................................................................74.3.4告警消息格式说明..........................................................................................................84.4云台控制....................................................................................................................................84.4.1云台设置.........................................................................................................................84.4.2巡航指令.......................................................................................................................104.4.3控制台指令...................................................................................................................114.4.4精确定位.......................................................................................................................115.遗留问题............................................................................................................................................125.1定位跟踪..................................................................................................................................125.2合码器......................................................................................................................................126.附录....................................................................................................................................................126.1VLCMediaPlayer......................................................................................................................126.2手机端监控..............................................................................................................................136.3DEMO程序..............................................................................................................................136.4RTSP消息示例.........................................................................................................................131.前言本次从海康租借了一台硬盘录像机、一个枪机和一个球机。由于对方HTTP告警消息模块有BUG,调测花费时间较长。对方提供升级测试版本后已经解决。从目前的进展情况看基本完成了我们的预期目标。主要常用功能均已验证通过,包括:视频监控(VLC插件方式)、录像回放、读取设备信息、设备重启、图像抓拍、告警通知、云台控制。本次报告主要目的是记录相关功能具体实现和验证的方式方法及注意事项。2.部署情况租借的三台设备均部署在五层实验室,通过无线路由器连接到公司网络。1)账号信息设备类型设备型号IP地址管理账号密码枪机DS-2CD2T20-I3192.111.111.235adminNuctech123录相机DS-8608N-E8192.111.111.237adminNuctech123球机DS-2DE7184-A192.111.111.238adminNuctech1232)设备部署&端口映射3)设备配置注意事项\uf0d8IPC和NVR均需要通过修改管理员密码才可以激活,然后接入网络;\uf0d8录相机(NVR)标准配置都是不带硬盘,所以需要事先准备好SATA硬盘;\uf0d8录相机(NVR)在接入枪机时,自动识别的设备协议为“海康协议”但实际需要根据说明书修改为ONVIF才可以,否则会一直报“未知错误“;\uf0d8枪机(IPC)须另备DC12VΦ5.5mm圆头电源;\uf0d8设备因为是租借来的,所以不是全新,建议配置调试之前先做出厂设置;\uf0d8设备默认出厂IP均为:192.0.0.643.视频监控3.1主码流与字码流主码流与子码流是海康威视提出的概念,是为了解决在网络情况不好时为了满足远程预览的流畅性,而不影响本地录像提出的双码流技术,主码流分辨率高于子码流,主码流用来录像,子码流用来网传,默认客户端访问采用主码流,客户可以根据网络情况选择子码流访问,以达到改善网络浏览的流畅性,而又不改变本地录像的录像效果。3.2RTSP地址格式(1)摄像头(IPC/IPD)地址格式:rtsp://username:pwd@ip:port[554]/h264/ch1/码流类型/av_stream码流类型:main表示为主码流,sub表示为子码流举例:IPC主码流:rtsp://admin:Nuctech123@192.168.25.6:10010/h264/ch1/main/av_streamIPC子码流:rtsp://admin:Nuctech123@192.168.25.6:10010/h264/ch1/sub/av_stream(2)NVR地址格式:rtsp://username:pwd@ip:port/h264/ch/码流类型/av_stream其中:ch,1-32是模拟通道,33以后是IP通道。举例:IPC@NVR:rtsp://admin:abc123@192.168.25.6:10011/h264/ch33/main/av_streamIPD@NVR:rtsp://admin:abc123@192.168.25.6:10011/h264/ch34/main/av_stream3.3录像回放RTSP地址格式:rtsp://username:pwd@ip:port/Streaming/tracks/101?starttime=yyyymmddtHHMMSSz&endtime=yyyymmddtHHMMSSz举例:rtsp://admin:abc123@192.168.25.6:10011/Streaming/tracks/101?starttime=20150710t102012z&endtime=20150710t113016z4.HTTP接口海康设备对外提供CGI和ISAPI两种接口,设备信息和配置推荐使用ISAPI接口,云台控制则推荐使用CGI接口。接口入口地址:http://ip:port[80]/接口协议:HTTP消息格式:XML接口形式:采用REST风格模式,GET表示读取当前信息、PUT表示更新配置、POST表示创建数据、DELETE表示删除配置。4.1设备信息4.1.1基本信息调用地址:/ISAPI/System/deviceInfo返回消息:IPDOME ef947dd1-f70b-11b4-83a0-c056e38ef866 IPDome STD-CGI STD-CGI DS-2DE7184-A DS-2DE7184-A20140928CCCH482033105 c0:56:e3:8e:f8:66 V5.2.7 build150129 V5.0 build141009 V1.3.4 100316 0x0 IPDome 88 false false 4.1.2设备状态调用地址:/ISAPI/System/status2015-07-30T14:40:27+08:00 185225 ARM926EJ-Sid(wb)[41069265]revision5(ARMv5TEJ) 58 DDRMemory 91 8624 4.1.3重启设备调用地址:/ISAPI/System/reboot4.1.4恢复出厂设置调用地址:/ISAPI/System/factoryDefault4.2图像抓拍调用地址:/ISAPI/Streaming/channels/ID/picture返回消息:截图本身的二进制数据流4.3告警通知4.3.1设置告警开关调用地址:全部配置:/ISAPI/Event/triggersVMD-1 VMD VMDEventtriggerInformation 1 1 center center beginning videoloss-1 videoloss VideolossEventtriggerInformation 1 1 ……某项配置:/Event/triggers/ID实际地址:/Event/triggers/VMD-1VMD-1 VMD VMDEventtriggerInformation 1 1 center center beginning 4.3.2配置告警中心告警中心可以理解为一个HTTP服务,具体地址信息配置到设备中,当有告警发生,并告警通知设置了为通知告警中心,则设备会根据设定间隔向指定的URL地址发送具体告警信息的XML文。具体配置的写入则通过PUT消息来实现。调用地址:/ISAPI/Event/notification/httpHosts返回消息:1 /ipd-warn/notify HTTP XML ipaddress 192.111.111.224 8080 none 4.3.3告警消息示例POST/ipd-warn/notifyHTTP/1.1Content-Type:application/xml;charset="UTF-8"Host:192.111.111.235Connection:Keep-AliveContent-Length:799192.111.111.235 HTTP c4:2f:90:33:f8:36 1 2015-07-29T17:05:46+08:00 51 VMD active Motionalarm DS-2CD2T20-I320150605AACH520982018VMD&&DS-2CD2T20-I320150605AACH520982018,2015-07-29T17:05:46+08:00,1,1.04.3.4告警消息格式说明(1)XML节点\uf0d8ipAddress:设备的IP地址\uf0d8protocolType:协议类型,只支持HTTP\uf0d8macAddress:设备的MAC地址\uf0d8channelID:通道号\uf0d8dateTime:发生报警的时间\uf0d8activePostCount:该类型报警发生的次数\uf0d8eventType:事件类型:\uf0d8eventState:事件状态\uf0d8eventDescription:时间描述\uf0d8Extensions:私有信息,内部用序列号、事件类型、时间等(2)事件类型(eventType)的含义\uf0d8IO:报警输入报警\uf0d8VMD:移动侦测\uf0d8videoloss:视频丢失\uf0d8shelteralarm:遮挡报警\uf0d8facedetection:人脸侦测\uf0d8defocus:虚焦侦测\uf0d8audioexception:音频异常\uf0d8scenechangedetection:场景变更\uf0d8fielddetection:区域入侵\uf0d8linedetection:越界侦测\uf0d8regionEntrance:进入区域\uf0d8regionExiting:离开区域\uf0d8loitering:徘徊侦测\uf0d8group:人员聚集\uf0d8rapidMove:快速移动\uf0d8parking:停车侦测\uf0d8unattendedBaggage:物品遗留\uf0d8attendedBaggage:物品拿去\uf0d8PIR:人体检测4.4云台控制4.4.1云台设置调用地址:/PTZCtrl/channels/1/presets返回消息:true 33 自动翻转 true 34 回到零点 true 35 巡航扫描1 ……true 39 白天模式 true 40 黑夜模式 true 41 花样扫描1 ……true 45 一键巡航 true 92 设置手动限位 true 93 确认手动限位 true 94 远程重启 true 96 停止扫描 true 97 随机扫描 true 98 帧扫描 true 99 自动扫描 true 100 垂直扫描 true 101 全景扫描 true 102 巡航扫描5 ……true 106 风扇常开模式 true 107 风扇常闭模式 true 108 风扇温控模式 4.4.2巡航指令调用地址:/PTZCtrl/channels//presets//goto举例:全景扫描:http://192.168.25.6:10022/PTZCtrl/channels/1/presets/101/goto停止扫描:http://192.168.25.6:10022/PTZCtrl/channels/1/presets/96/goto回到零点:http://192.168.25.6:10022/PTZCtrl/channels/1/presets/34/goto4.4.3控制台指令调用地址:/PTZ/channels/ID/PTZControl参数说明:command、mode、speed、presetNo、patrolNoThevalueofcommandis:LIGHT:LightWIPER:WiperFAN:FanHEATER:Heater.AUX1:auxiliaryequipment1.AUX2:auxiliaryequipment2SET_PRESET:SetpresetCLE_PRESET:Clearpreset.ZOOM_IN:Zoominthespecifiedspeed.ZOOM_OUT:Zoomoutinthespecifiedspeed.FOCUS_NEAR:focusnearinthespecifiedspeed.FOCUS_FAR:focusfarinthespecifiedspeed.IRIS_OPEN:IRISisopeninthespecifiedspeedIRIS_CLOSE:IRISiscloesdinthespecifiedspeedTILT_UP:PTZistiltupinthespecifiedspeedTILT_DOWN:PTZistiltdowninthespecifiedspeedPAN_LEFT:PTZispanleftinthespecifiedspeedPAN_RIGHT:PTZispanrightinthespecifiedspeedUP_LEFT:PTZisup-leftinthespecifiedspeedUP_RIGHT:PTZisup-rightinthespecifiedspeedDOWN_LEFT:PTZisdown-leftinthespecifiedspeedDOWN_RIGHT:PTZisdown-rightinthespecifiedspeedPAN_AUTO:PTZscanspanwiththespecifiedspeed.MEM_PATTERN:memorypattern.RUN_PATTERN:Startpattern.PATROL:patrol.GOTO_PRESET:Gotopreset."mode"valueis"start"and"stop".Itindicatesthe"start"or"stop"ofsomeactionsforPTZ,orthe"turnon"or"turnoff"ofexternalequipmentpowerforPTZ.Thedefaultis"start".Inadditiontothe"SET_PRESET","CLE_PRESET","RUN_PATTERN"and"GOTO_PRESET"command,allcommandsrequirethe"mode"queryparameters."speed"rangeis1-7.Whenthecommandis"ZOOM_IN","ZOOM_OUT","FOCUS_NEAR","FOCUS_FAR","IRIS_OPEN",or"IRIS_CLOSE",thedefaultis1.Whenthecommandis"TILT_UP","TILT_DOWN","PAN_LEFT","PAN_RIGHT","UP_LEFT","UP_RIGHT","DOWN_LEFT","DOWN_RIGHT","PAN_AUTO",thedefaultis3.4.4.4精确定位调用地址:PTZCtrl/channels/1/continuous请求消息:0 -80 0 5.遗留问题5.1定位跟踪定位模块提供目标的坐标后,如何通过该位置坐标与摄像头的位置坐标计算出摄像头跟踪显示该目标所需要调整的角度或相应云台动作的指令参数。5.2合码器NVR没有将多路视频合并成一路视频的功能,需要单独采购合码器支持合码功能,可以将多路视频合成一路视频输出。如果没有合码器,只能是一个插件同时只能显示一路视频。6.附录6.1VLCMediaPlayer\uf0d8下载地址列表:http://downloads.videolan.org/pub/videolan/vlc/\uf0d8最新版本:http://downloads.videolan.org/pub/videolan/vlc/2.2.1/win64/也可以通过VLC的插件方式在浏览器中实现视频接入,具体代码如下
6.2手机端监控安装海康的手机监控软件(iVMS-4500)即可。APP下载地址:http://www.hikvision.com/cn/download_more_391.html#prettyPhoto具体配置及效果图6.3DEMO程序设备安装配置好之后,可以通过海康提供的ClientDemo程序来测试验证。6.4RTSP消息示例OPTIONSrtsp://192.168.25.6:10010/h264/ch1/main/av_streamRTSP/1.0CSeq:2User-Agent:LibVLC/2.2.1(LIVE555StreamingMediav2014.07.25)RTSP/1.0200OKCSeq:2Public:OPTIONS,DESCRIBE,PLAY,PAUSE,SETUP,TEARDOWN,SET_PARAMETER,GET_PARAMETERDate:Tue,Jul14201513:10:15GMTDESCRIBErtsp://192.168.25.6:10010/h264/ch1/main/av_streamRTSP/1.0CSeq:3User-Agent:LibVLC/2.2.1(LIVE555StreamingMediav2014.07.25)Accept:application/sdpRTSP/1.0401UnauthorizedCSeq:3WWW-Authenticate:Digestrealm="c42f9033f836",nonce="05dff23367cb73d755cf0115e0266a94",stale="FALSE"WWW-Authenticate:Basicrealm="c42f9033f836"Date:Tue,Jul14201513:10:15GMTDESCRIBErtsp://192.168.25.6:10010/h264/ch1/main/av_streamRTSP/1.0CSeq:4Authorization:Digestusername="admin",realm="c42f9033f836",nonce="05dff23367cb73d755cf0115e0266a94",uri="rtsp://192.168.25.6:10010/h264/ch1/main/av_stream",response="08e21e4e77440148865cd4864184001f"User-Agent:LibVLC/2.2.1(LIVE555StreamingMediav2014.07.25)Accept:application/sdpRTSP/1.0200OKCSeq:4Content-Type:application/sdpContent-Base:rtsp://192.168.25.6:10010/h264/ch1/main/av_stream/Content-Length:604v=0o=-14368794151488411436879415148841INIP4192.111.111.235s=MediaPresentatione=NONEb=AS:5050t=00a=control:rtsp://192.168.25.6:10010/h264/ch1/main/av_stream/m=video0RTP/AVP96c=INIP40.0.0.0b=AS:5000a=recvonlya=x-dimensions:1920,1080a=control:rtsp://192.168.25.6:10010/h264/ch1/main/av_stream/trackID=1a=rtpmap:96H264/90000a=fmtp:96profile-level-id=420029;packetization-mode=1;sprop-parameter-sets=Z00AKpWoHgCJ+WEAAAcIAAFfkAQ=,aO48gA==a=Media_header:MEDIAINFO=494D4B48010100000400010000000000000000000000000000000000000000000000000000000000;a=appversion:1.0SETUPrtsp://192.168.25.6:10010/h264/ch1/main/av_stream/trackID=1RTSP/1.0CSeq:5Authorization:Digestusername="admin",realm="c42f9033f836",nonce="05dff23367cb73d755cf0115e0266a94",uri="rtsp://192.168.25.6:10010/h264/ch1/main/av_stream/",response="dff80e7fc5585ac08e4c50162e27e872"User-Agent:LibVLC/2.2.1(LIVE555StreamingMediav2014.07.25)Transport:RTP/AVP;unicast;client_port=61748-61749RTSP/1.0200OKCSeq:5Session:901031416;timeout=60Transport:RTP/AVP;unicast;client_port=61748-61749;server_port=8368-8369;ssrc=6dd2629c;mode="play"Date:Tue,Jul14201513:10:15GMTPLAYrtsp://192.168.25.6:10010/h264/ch1/main/av_stream/RTSP/1.0CSeq:6Authorization:Digestusername="admin",realm="c42f9033f836",nonce="05dff23367cb73d755cf0115e0266a94",uri="rtsp://192.168.25.6:10010/h264/ch1/main/av_stream/",response="df820265db78985f3f231cc5af9bc58d"User-Agent:LibVLC/2.2.1(LIVE555StreamingMediav2014.07.25)Session:901031416Range:npt=0.000-RTSP/1.0200OKCSeq:6Session:901031416RTP-Info:url=rtsp://192.168.25.6:10010/h264/ch1/main/av_stream/trackID=1;seq=28417;rtptime=1324571670Date:Tue,Jul14201513:10:15GMTGET_PARAMETERrtsp://192.168.25.6:10010/h264/ch1/main/av_stream/RTSP/1.0CSeq:7Authorization:Digestusername="admin",realm="c42f9033f836",nonce="05dff23367cb73d755cf0115e0266a94",uri="rtsp://192.168.25.6:10010/h264/ch1/main/av_stream/",response="bf6e13938d7ee447e52c4b342cb91078"User-Agent:LibVLC/2.2.1(LIVE555StreamingMediav2014.07.25)Session:901031416RTSP/1.0200OKCSeq:7Date:Tue,Jul14201513:10:15GMTTEARDOWNrtsp://192.168.25.6:10010/h264/ch1/main/av_stream/RTSP/1.0CSeq:8Authorization:Digestusername="admin",realm="c42f9033f836",nonce="05dff23367cb73d755cf0115e0266a94",uri="rtsp://192.168.25.6:10010/h264/ch1/main/av_stream/",response="a981d92164ceefabb40ea0449f67d084"User-Agent:LibVLC/2.2.1(LIVE555StreamingMediav2014.07.25)Session:901031416RTSP/1.0200OKCSeq:8Session:901031416Date:Tue,Jul14201513:10:26GMT7.参考文献资料1.海康设备接口资料官方地址http://www.hikvision.com/cn/download_more_969.html2.VLC播放器官网http://www.videolan.org/vlc/3.VLC插件集成https://wiki.videolan.org/HowTo_Integrate_VLC_plugin_in_your_webpage/',)