Android 中的 RTSP 客户端 [英] RTSP Client in Android

查看:29
本文介绍了Android 中的 RTSP 客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能有人问过同样的问题,但我没有找到任何可用的解决方案.

The same question might have been asked but I didn't find any solutions available for me.

我正在尝试在 android 中播放 RTSP 流,服务器是 Darwin 流服务器.目前我尝试过 VideoView 和 MediaPlayer,这两个在我使用 3G 时总是可以正常工作,但在我使用 Wifi 时有时会出现问题,特别是当我在工作场所使用 Wifi 时,以及 LogCat 中的错误:

I'm trying to play RTSP stream in android and the server is Darwin streaming server. For now I’ve tried VideoView and MediaPlayer, both of which always work fine when I use 3G but have problems when I use Wifi sometimes, specifically when I use Wifi at my workplace, and the error in LogCat:

PlayerDriver(31):缓冲(0)

我搜索了一下,猜测可能是 Wifi 热点在防火墙后面并且 UDP 端口被阻止,而 Opencore 媒体框架仅支持 RTP over UDP.如果我错了,请纠正我.

I have googled around and guess the reason maybe the Wifi hotspot is behind the firewall and the UDP port is blocked, and the Opencore media framework only supports RTP over UDP. Correct me if I am wrong.

然后,这是我的问题,如果我无法更改防火墙情况,我该如何解决.如果无法使用内置的 VideoView/MediaPlayer,那么如何编写自己的 rtsp 客户端.

Then, here is my question, how can I solve it if i cannot change the firewall situation. If using the build-in VideoView/MediaPlayer is not possible, then how to write my own rtsp client.

任何建议将不胜感激:)

Any suggestion will be appreciated:)

提前致谢!

博尔顿

推荐答案

我不认为你可以用这个做很多事情......这是我的想法:

I don't think that you can do much with this... Heres my idea:

制作一个将在与 Darvin 相同的 LAN 中启动的应用程序,然后它将通过 UDP(在 LAN 中)获取 Darvin 的 RTP 流,然后通过 TCP 将其传输到 WAN,以便您可以访问它.您可以轻松地用 C# 编写该应用程序......它会完美运行.或者,如果你有一些 Linux 发行版,你可以编写一个复杂的 Bash 脚本,使用 NC 来做同样的事情......

Make an app that will be started in the same LAN as Darvin, then it will get Darvin's RTP stream which goes over UDP (in LAN) and then transmit that over TCP to WAN, so you can access it. You can easily write that app in C#... and it will work perfectly. Or if you have some Linux distro, you can write a complex Bash script that will use NC to do the same...

所以这基本上是这个想法:

So this is basically the idea:

这篇关于Android 中的 RTSP 客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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