简体   繁体   English

ONVIF GetStreamUri返回内部IP地址

[英]ONVIF GetStreamUri returns internal IP Address

I am trying to connect to an IP camera using Onvif. 我正在尝试使用Onvif连接到IP摄像机。 This camera is not in my network and has been made available to me through an external IP address. 该摄像机不在我的网络中,并且已通过外部IP地址提供给我。 When using the 'GetStreamUri' function I get a RTSP link with the internal IP address of the camera, this will not work. 当使用“ GetStreamUri”功能时,我获得了带有摄像机内部IP地址的RTSP链接,这将不起作用。 When I replace the IP manually it works just fine. 当我手动更换IP时,它可以正常工作。

Does anybody have any other suggestions on how to handle this? 有人对如何处理有其他建议吗? Replacing the IP manually works but is not a very nice solution. 手动替换IP是可行的,但不是很好的解决方案。

A camera behind NAT and with RTSP streaming in general cannot be viewed from Internet, because you'll end up with all the classic problems related to NAT and VOIP (voip uses RTSP as well as ONVIF). 通常无法从Internet上查看位于NAT之后且带有RTSP流的摄像机,因为您最终会遇到与NAT和VOIP有关的所有经典问题(voip使用RTSP和ONVIF)。

But you have a possible solution: configure the camera so that it streams over HTTP. 但是您有一个可能的解决方案:配置摄像头,使其通过HTTP流式传输。 At this point you should get a URI that should be accessible from Internet. 此时,您应该获得可以从Internet访问的URI。 In fact, if you invoke GetStreamUri , the camera will still return you an internal IP address, since it does not know that the router is configured for NAT. 实际上,如果您调用GetStreamUri ,则摄像机仍将为您返回一个内部IP地址,因为它不知道该路由器已配置为NAT。 If you are lucky enough, the URI will be on port 80, thus by replacing the internal IP address with the external IP address of the gateway you should be able get the video. 如果您足够幸运,那么URI将位于端口80上,因此通过将内部IP地址替换为网关的外部IP地址,您应该可以获取视频。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM