使用OpenCV访问IP摄像机 [英] Accessing IP cameras with OpenCV

查看:94
本文介绍了使用OpenCV访问IP摄像机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,您必须对我的背景有所了解.我以前从未使用过IP摄像机,但是我将很快必须使用OpenCV同时访问多个IP摄像机.除此之外,我的网络知识不是那么好.

First of all you have to understand a bit about my background. I have never worked with IP cameras before, but I will have to access multiple IP cameras simultaneously with OpenCV very soon. Apart from that, my network knowledge is not that much good.

现在是问题.我知道OpenCV可以在VideoCapture的帮助下使用其URL访问IP摄像机. StackOverflow中也有许多问题.但是,IP地址是可以随时更改的,它是动态的.因此,即使在IP摄像机中,IP也会不时更改.因此,如果是这种情况,这是否意味着每次尝试使用OpenCV访问摄像机时,都必须手动找到摄像机的IP地址并在OpenCV中更改URL?我不需要通过互联网访问摄像机,可以通过Wifi或网络电缆在本地访问.如何设置fixed IP地址/URL,以使OpenCV代码每次都没有变化?

Now the question. I know OpenCV can access IP cameras using its URL with the help of VideoCapture. There are number of questions in StackOverflow as well. But, the IP address is something that can be changed by time to time, it is dynamic. So even in a IP cam, the IP will change by time to time. So if this is the case, does this mean every time you try to access the cameras with OpenCV, you have to find the IP address of the camera manually and change the URL in OpenCV as well? I do not need to access the cameras via the internet, accessing locally is fine, via Wifi or network cables. How can I set a fixed IP address/ URL so the OpenCV code has nothing to change every time?

PS:我浏览了很多网站(来自Google搜索的5个以上结果页面的网站),但给出的答案太旧或没有那么令人信服.因此,我决定走进StackOverflow寻求答案.

PS: I navigated through lot of websites (sites from more than 5 result pages of Google search) but the answers given are either too old or not that much convincing. So I decided to walk into StackOverflow for the answer.

推荐答案

如果您的路由器具有DHCP保留功能,只需告诉路由器始终为IP摄像机提供特定的IP. 因此,当摄像机在连接到网络时轮询DHCP服务器时,它将自动接收其保留的IP.其他没有保留的客户端将像往常一样简单地获得一个随机IP.您甚至可能考虑对所有计算机和设备执行此操作.快速简便.

If your router has a DHCP reservation feature, simply tell the router to always give an IP camera a certain IP. Thus when the camera polls the DHCP server when it connects to the network, it will automatically receive its reserved IP. Other clients without a reservation will simply receive a random IP like normal. You might even think about doing this for all your computers and devices; it's quick and easy.

这篇关于使用OpenCV访问IP摄像机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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