将 RTSP 流转发到远程套接字(RTSP 代理?) [英] Forward RTSP stream to remote socket (RTSP Proxy?)

查看:80
本文介绍了将 RTSP 流转发到远程套接字(RTSP 代理?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于问题的普遍性,我深表歉意.我尝试了很多东西,但似乎没有任何效果.我有服务器?(我们称之为服务器 A),它驻留在局域网中,那里还有一个 IP 网络摄像头.该网络摄像头不断提供有关地址的 RTSP 提要...比方说...rtsp://192.168.1.50:554/cam.sdp.相机无法访问外界(它必须留在局域网中,因此只能访问服务器 A,不能访问服务器 B),但是服务器 A 可以.遗憾的是,Server A 没有公共 IP,因此我无法从世界任何地方访问 Server A.Server A想出去就可以出去,但是没有人可以进入Server A...(真是个被宠坏的小子...小时候玩具太多了)

My Apologies for the generality of the question. I have tried many things but nothing seems to work. I have a server? (let's call it Server A) that resides in a local area network where there is also an IP-Webcam. That webcam is constantly providing an RTSP feed on the address... let's say... rtsp://192.168.1.50:554/cam.sdp. The camera doesn't have access to the outside world (it must stay in the LAN, and therefore, only has access to server A, no to server B), but server A does. Sadly, Server A doesn't have a public IP, so I can not reach into Server A from anywhere in the world. Server A can go out if it wants but no one can get into Server A... (it's an spoiled brat... too many toys when it was a kid)

现在,在前面提到的外部世界中还有另一个服务器(服务器 B,是原始的),它是具有公共 IP 和所有内容的常规 Web 服务器.那个服务器允许人们进入它(没有被宠坏,非常好......摆桌子,做菜......那种东西).Server AServer B 都是我的电脑,运行的是 Ubuntu 12.04 和我设计的一些 Python 应用程序(Server B 实际上运行的是 Django,但是我认为这不太相关).我的意思是我可以控制两台服务器中发生的事情.我可以安装/卸载软件包,我可以打开端口,关闭端口......任何需要的东西(如果我愿意,我什至可以格式化它们,虽然我认为这不会有太大帮助......或者是......谁知道?)

Now, there's another server (server B, to be original) in the aforementioned outside world which is a regular web server with its public IP and all. That server allows people to reach into it (not spoiled, very nice... sets the table, does the dishes... that kind of stuff). Both Server A and Server B are my computers and are running Ubuntu 12.04 and some Python applications I designed (Server B is actually running Django, but I don't think that's too relevant). What I mean by this is that I have control over what's going on in both servers. I can install/uninstall packages, I can open ports, close ports... whatever is needed (I can even format them if I want, although I don't think that would help much... or yes... who knows?)

                               _____________                                    _____________
    -----------                |           |                                    |           |   
 __ |         |                |           |                                    |           |     
|  \| WebCam  |================| Server A  |===========|  INTERNET  |===========| Server B  |
|__/|         | ->/cam.sdp  <--|           |----------------- > --------------> *           | 
    |         |                |___________|                                    |___________|
    -----------

问题是:我怎样才能用服务器 A 抓取 RTSP 流,将它转储到 服务器 B 的指定套接字上并打开它(使用能够理解的程序)RTSP 提要,例如 VLC)?

The question is: How can I grab the RTSP stream with server A dump it onto a designated socket of server B and open it (with a program able to understand RTSP feeds, such as VLC)?

我猜我需要像 RTSP 代理这样的东西,也许吧?但我真的不知道从哪里开始.

I'm guessing I need something like an RTSP proxy, maybe? But I don't really know where to start.

任何提示、链接...将不胜感激.

Any hint, link... would be appreciated.

提前致谢

推荐答案

我不知道 RTSP,但它似乎是一个标准的 TCP-only 协议.尝试在服务器 A 上运行:

I don't know RTSP, but it seems to be a standard TCP-only protocol. Try to run on server A:

ssh -g -R 554:192.168.1.50:554 server_B_hostname

这将打开服务器 B 上的公共端口 554,并从 A 的角度将其转发到 192.168.1.50:554.

This will open the public port 554 on Server B, and forward it to 192.168.1.50:554 from A's point of view.

有些服务器将 sshd 配置为拒绝 ssh -g -R 转发(无缘无故).如果可以,您应该检查服务器 B 上的/etc/ssh/sshd_config 并添加 AllowTcpForwarding yes.

Some servers have sshd configured to refuse the ssh -g -R forwarding (for no good reason). If you can, you should check /etc/ssh/sshd_config on Server B and add AllowTcpForwarding yes.

这篇关于将 RTSP 流转发到远程套接字(RTSP 代理?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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