我如何抓住CCTV DVR的广播为自定义应用程序 [英] How do I grab CCTV DVR's broadcast for custom application

查看:252
本文介绍了我如何抓住CCTV DVR的广播为自定义应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有16个模拟摄像机进入我的Defender DVR。我可以通过访问特定端口并在IE中使用ActiveX控件输入登录详细信息本地访问摄像机源。我也可以通过苹果应用程序的应用程序查看他们通过简单地输入我的外部IP地址,端口号和登录凭据在我的iPad上。



我的问题是,如果我想创建一个类似于应用商店中的应用。我将如何与DVR的视频/图像流进行通信?



我需要轮询IP地址以获取数据,但我不是确定需要什么类型的连接和期望什么。



似乎许多DVR推迟到市场上相同的应用程序,所以我的猜测是,他们都符合输出数据时的一些标准。



谢谢。

解决方案

很多摄像机使用混合替换内容类型通过HTTP流式传输数据。如果您可以在浏览器上访问您的相机,很可能是使用HTTP。



假设这是你的情况,你必须找出什么URL摄像机用于服务流。所以您可以:





获得网址后,您可以确定您是否正在处理混合替换请求, curl,您可以使用类似:

  $ curl --head http:// user:password@192.168.99.230/video .cgi 

我的相机返回以下标题:

  HTTP / 1.0 200 OK 
服务器:alphapd
日期:Thu Jan 9 09:04:59 2014
Pragma:no-cache
Cache-Control:no-cache
Content-Type:multipart / x-mixed-replace; boundary = video boundary-

这意味着我有一个由--video boundary-字符串分隔的混合替换响应(查看Content-Type字段)。



请求正文如下所示:

   - 视频边界 -  
< metadata> ;
< image>
--video boundary-
< metadata>
< image>
...
(实时传送图像的不断变化的请求体)

现在你的方法将取决于你想嵌入流的应用程序。在我的情况下,我只需要把它们放在一个网页上,所以Firefox给了我一个好处,我可以整合它:

 < img src =http:// user:password@192.168.99.230/video.cgi> 

但是您可能必须根据您的应用程序自己解析和捕获每个传入的图像。 p>

I have 16 analog cameras feeding in to my Defender DVR. I'm able to access the camera feeds locally by going to a specific port and entering login details using an ActiveX control in IE. I can also view them through apps from the Apple apps tore on my iPad by simply entering my external IP address, port number, and login credentials.

My question is, if I wanted to create an app similar to those in the app store. How would I go about communicating with the DVR's stream of videos/images?

I'd image I need to poll the IP address to get the data but I'm not sure what type of connection is needed and what to expect there.

It seems that many DVRs defer to the same apps in the marketplace so my guess is that they all conform to some standard when outputting the data.

Thank you.

解决方案

A lot of cameras stream data via HTTP using the Mixed-Replace Content-Type. If you can access your camera on a browser, it is very likely that it uses HTTP.

Assuming this is your case, you'll have to find out what URL your camera uses to serve the stream. So you could:

  • Try to find a list like this on the internet, by Googling your camera model
  • Inspecting the browser yourself (this will require some knowledge on HTML5)

Once you have the URL,you can be sure if you're dealing with a Mixed-Replace request, if you have a terminal with curl, you can use something like:

$ curl --head http://user:password@192.168.99.230/video.cgi

My camera returns the following header:

HTTP/1.0 200 OK
Server: alphapd
Date: Thu Jan  9 09:04:59 2014
Pragma: no-cache
Cache-Control: no-cache
Content-Type: multipart/x-mixed-replace;boundary=video boundary--

This means I have a Mixed-Replace response separated by the "--video boundary--" string (look to the Content-Type field).

The request body looks like this:

--video boundary--
<metadata>
<image>
--video boundary--
<metadata>
<image>
...
(Neverending request body of real time delivered images)

Now your approach will depend on which application you want to embed the stream. On my case, I just needed to put them on a web page, so Firefox did me a favor and I could integrate it with:

<img src="http://user:password@192.168.99.230/video.cgi">

But you might have to be parsing and capturing each incoming image by yourself depending on your application.

这篇关于我如何抓住CCTV DVR的广播为自定义应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆