通过WEB调用大华网络摄像头

1.要调用的大华摄像头为Dahua 大华DH-IPC-HFW2100P-0600B 网络摄像机 (白色),摄像头外形如下图所示

2.调用效果如下图所示

3.下载大华网络摄像头OCX包,下载地址http://download.csdn.net/detail/whzhaochao/5965005

4.解压OCX包单击文件中的reg.bat注册dll

5.新建index.html关输入以下代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>视频控件</title>
<style>
body {font-family:"", arial;margin:0 auto; padding:0; }
div,form,img,ul,p {margin: 0 auto; padding: 0; border: 0; overflow:hidden; list-style-type:none; }
h1,h2,h3,h4,h5,h6 { margin:0; padding:0;}
.bigbg{width:1280px;height:820px;position:relative;top:50px;background:#fff;}
.kuang{background:url(img/video_03.gif) no-repeat;width:1280px;height:820px;margin-top:12px;}
.close a{background:url(img/1_04.gif) no-repeat;width:41px;height:36px;position:absolute;left:618px;top:5px;
}
.close a:hover{background:url(img/2_04.gif) no-repeat;with:41px;height:36px;position:absolute;left:618px;top:5px;
}   .videoscreen{
width:1280px;height:720px;
background-color:#999;position:absolute;right:17px;top:45px;}.sfream {background:url(img/video_05.jpg) no-repeat;width:627px;height:42px;margin-top:400px;}.play a{background:url(img/video_25.gif) no-repeat;width:19px;height:19px;position:absolute;left:26px;bottom:17px;}.pause a{ background:url(img/video_26.gif) no-repeat;width:21px;height:19px;position:absolute;left:46px;bottom:17px;
}
.progressbar a{ background:url(img/video_28.gif) no-repeat;width:291px;height:20px;position:absolute;left:76px;bottom:17px;
}
.snapshot-picture a{    background:url(img/video_16.gif) no-repeat;width:25px;height:25px;position:absolute;left:377px;bottom:17px;}.stepback a {   background:url(img/video_18.gif) no-repeat;width:24px;height:25px;position:absolute;left:409px;bottom:17px;}.camera a{background:url(img/video_20.gif) no-repeat;width:26px;height:27px;position:absolute;left:439px;bottom:14px;}.stopcamera a{background:url(img/video_22.gif) no-repeat;width:27px;height:27px;position:absolute;left:472px;bottom:14px;}.singlescreen a{background:url(img/video_09.gif) no-repeat;width:31px;height:29px;position:absolute;left:506px;bottom:12px;}.doublescreen a{background:url(img/video_11.gif) no-repeat;width:31px;height:29px;position:absolute;left:546px;bottom:12px;}.ninescreen a{background:url(img/video_13.gif) no-repeat;width:32px;height:29px;position:absolute;left:586px;bottom:12px;}.ninescreen a:hover{background:url(img/design_05.gif) no-repeat;width:40px;height:29px;position:absolute;left:586px;bottom:82px;}</style><script language="javascript">function StartPreview()
{   alert("开始");var SSOcx = document.getElementById("playOcx");SSOcx.SetDeviceInfo("192.168.1.108",37777,0,"admin","admin");SSOcx.StartPlay();
}function StoptPreview()
{var SSOcx = document.getElementById("playOcx");SSOcx.StopPlay();}function Capture()
{var SSOcx = document.getElementById("playOcx");var dd= SSOcx.GetCapturePicture("d:\\1.bmp");}function StartRecord()
{   var SSOcx = document.getElementById("playOcx");SSOcx.SaveRealData("d:\\1.avi");
}function StopRecord()
{   var SSOcx = document.getElementById("playOcx");SSOcx.StopSaveRealDate();
}</script>
</head><body>
<div class="bigbg">
<div class="kuang"><div class="videoscreen"> <td width="50%"   align="right" style="padding-right:50px"><object classid="clsid:30209FBC-57EB-4F87-BF3E-740E3D8019D2" codebase=""standby="Waiting..." id="playOcx" width="1280" height="720" name="playOcx" align="center" ><embed width="618" height="360" align="center"></embed></object></td></div><div class="sfream">
<div class="play"><a href="javascript:StartPreview()">播放</a><br/></div>
<div class="pause"><a href="javascript:StoptPreview()">暂停</a><br /></div>
<div class="progressbar"><a href=""></a></div>
<div class="snapshot-picture"><a href="javascript:Capture()">拍照</a><br/></div>
<div class="stepback"><a href=""></a></div>
<div class="camera"><a href="javascript:StartRecord()">录制</a><br/></div>
<div class="stopcamera"><a href="javascript:StopRecord()">停止录制</a></div>
<div class="singlescreen"><a href=""></a></div>
<div class="doublescreen"><a href=""></a></div>
<div class="ninescreen"><a href=""></a></div>
</div>
</div>
<div class="close"><a href=""></a></div></div></body>
</html>

6.保存并用IE打开,请允许加载Active控件,如果不出问题则调用成功

注意事项:

1.SSOcx.SetDeviceInfo("192.168.1.108",37777,0,"admin","admin");注意修改成你的摄像机的IP地址、端口、通道、用户名、密码

2.大华的dll要注册成功,检查有没有注册的方法:打开注册表,搜索classid号,如果有表明OCX控件注册成功,classid号为:30209FBC-57EB-4F87-BF3E-740E3D8019D2

3.改方法试用于IE,其它浏览器不行

4.第一次用IE打开一定要加载控件,如果IE阻止控件会导致调用失败。如果IE阻止加载控件,请在Internet项目->安全->自定义级别 中将ActiveX控件和插件下的所有项都启用

通过WEB调用大华网络摄像头相关推荐

  1. 大华网络摄像头,查看视频闪烁严重

    项目场景: 1.JAVA JDK版本:1.7 2.连接设备:大华网络摄像头(M/K枪形) 3.连接方式:SDK 问题描述: 使用自带DEMO程序一切正常,但在接入JAVA程序后,摄像头虽然连接成功后, ...

  2. 使用QT对接大华网络摄像头SDK的示例程序(建议收藏)

    初始化 大华网络摄像头的默认 IP 地址都是 192.168.1.108,首先将你的电脑和摄像头连接到同一个路由器下,假如你的路由器不是1网段,则对路由器进行设置. 然后在 IE 浏览器下输入192. ...

  3. C#访问大华网络摄像头

    第一次接触到大华摄像头,我想直接把dll往项目里面添加,失败了.我把设备网络SDK32位,64位的,播放库32位,64位的都尝试了一遍,均失败了.然后我直接摆烂了,去网上搜了老半天才搜出来一个能用的D ...

  4. 漏刻有时API接口实战开发系列(10):海康威视、大华网络摄像头二次开发云直播和监控时技术参数的说明

    项目需求 基于海康威视.大华网络摄像头等硬件设备,实现网络直播监控,同时在web端.H5手机端等实现视频的实时预览.回放等功能. 项目分析 实现云直播和云监控,必须将设备联入公网.常用的解决方案: 参 ...

  5. 利用OpenCV读取大华网络摄像头

    项目需要将网络摄像头接入到服务器上,用c++或者python处理每帧的图像.查了很多资料总算解决了,回过头发现是很小的问题,但是大华官网的SDK真的很难看懂.OpenCV2.4. 直接上代码吧. #i ...

  6. 读取多个(海康\大华)网络摄像头的视频流 (使用opencv-python),解决实时读取延迟问题

    实时读取视频流(封面使用五个摄像头是因为我手头最多只有五个),解决实时读取延迟卡顿问题 做计算机视觉的算法开发,可能会碰到实时获取图像并处理的问题,我写了一个简单的实例,可以实时读取多个网络摄像头.运 ...

  7. 大华网络摄像头通过gstreamer 获取不到RTSP流

    运行: gst-launch-1.0 rtspsrc latency=0 location= "rtsp://admin:L21CF489@192.168.117.9:554/cam/rea ...

  8. 海康大华网络摄像头高起播低延时RTSP网页无插件流媒体专用播放器EasyPlayer-RTSP之GDI和D3D两种视频渲染方式的区别介绍

    GDI和D3D两种视频渲染方式的区别 EasyPlayer-RTSP windows播放器支持D3D和GDI两种渲染方式. D3D支持格式如下: DISPLAY_FORMAT_YV12 DISPLAY ...

  9. 【Java+前端】前端调用大华摄像头,rtsp转rtmp

    效果图 搭建说明: 大华网络摄像头采用rtsp格式,rtsp格式无法直接显示到web页面上,所以中间要进行实时视频转码. 步骤: 搭建nginx流式服务器 资源见文件分享,解压缩后直接就可进行使用(都 ...

最新文章

  1. 如何将github上的 lib fork之后通过podfile 改变更新源到自己fork的地址
  2. qpsk调制解调matlab_本科毕业设计课题—QPSK相干解调的MATLAB仿真(3)
  3. malloc开辟的空间在哪一个区间_C++进阶系列之STL(2)SGI版本空间配置器
  4. C++ 常用函数总结
  5. 服务器监控系统的介绍,客户服务系统服务器监控系统
  6. AutoCAD VBA对齐对象
  7. Java连接HBASE数据库,创建一个表,删除一张表,修改表,输出插入,修改,数据删除,数据获取,显示表信息,过滤查询,分页查询,地理hash
  8. 配置纯净版Debian
  9. jsp springmvc 视图解析器_springMVC配置jsp/html视图解析器
  10. 老司机普及的c++入门心得!
  11. chmod递归授权文件夹(用法)
  12. java的技术定义_java基础知识——Java的定义,特点和技术平台
  13. ##CSP 201512-3 画图(C语言)
  14. 用户画像的构建与使用2应用
  15. 自旋锁,偏向锁,轻量级锁 和 重量级锁
  16. android 电话状态的监听(来电和去电)
  17. chrome官网下载网址
  18. 微信小程序地图和百度地图定位位置不一样
  19. 考研英语近义词与反义词·四
  20. Excel查看工作表有多少列

热门文章

  1. 科研 | 认知电子战研究现状
  2. 使用EMQX搭建的MQTT服务器 如何转发数据并保存到云端数据库?
  3. 解决MybatisPlus插件分页查询不起作用,总是查询全部数据问题
  4. Python数据容器:list + set + tuple + dict + str 简记 黑马课程
  5. 推荐系统特征工程的万字理论
  6. 【SPOJ】7258. Lexicographical Substring Search(后缀自动机)
  7. Java中常用的 JSON工具
  8. 冰心玉壺─絕句賞析【玉階怨   李白】玉階生白露……
  9. CASS横断面成果转纬地格式(txt)
  10. 联想微型计算机启动项的键,联想电脑如何设置u盘启动项