开发 Android 流媒体服务器
我正在尝试开发一个流媒体 AV 媒体服务器,用于 Android 手机作为客户端。这立即限制了我开发使用 RTSP 的服务器。我精通 Java 编程,并且发现 Netty (Java NIO) 可以用来填补 Java 媒体框架中该协议的巨大空白。我尝试过它,但没有取得真正的成功。我了解 live555,但我的日程很紧,并且不想开始搞乱 C++,因为我对这个主题知之甚少。我已经被这个问题困扰了好几个星期了,但没有什么真正可以证明的。由于 Android 市场上有许多专有应用程序,因此流式传输到 Android 肯定是可能的。有这方面经验和知识的人请告诉我是否有一种简单的方法来实现 RTSP AV 媒体服务器,只需流式传输 .mp4 或 .3gp 和 .mp3 以便与 android 一起使用,而不使用 live555 库。如果没有,我就必须快速掌握 C++。先感谢您。
I am trying to develop a Streaming AV Media Server for use with an Android handset as the client. This instantly puts a constraint on me to develop a server that uses RTSP. I am versed in Java programming and have found that Netty (Java NIO) can be used to fill in the otherwise massive gap in the Java Media Framework for this protocol. I have played around with it and have had no real success. I know about live555 but I’m on a tight schedule and don't really want to start messing around with C++ as I know very little on the subject. I have been stuck on this problem for many weeks and have nothing really to show for it. Streaming to android must be possible as there are numerous proprietary apps on the Android market. Could someone who has experience and knowledge on this subject please let me know if there is a simple way to implement an RTSP AV media server that just streams .mp4 or .3gp and .mp3 for use with android without using the live555 libraries. If not I will just have to quickly get up to speed on C++. Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好的,使用 HTTP 进行流传输就这么简单。
我在 WinXP 上使用 IIS 创建了一个名为“音乐”的虚拟文件夹,并将其指向包含 mp3 文件的文件夹。这是传输文件所需的完整活动(名称硬编码)。
顺便说一句,它被称为 SimpleNetRadio,因为我最初开始使用 Shoutcast 流。
您还应该能够使用 MediaPlayer 使用更多代码来完成此操作 - 它可以更好地处理错误情况并且不需要更多的工作。
OK, simple as this to stream using HTTP.
I created a virtual folder called 'Music' with IIS on WinXP and pointed it at a folder containing mp3 files. This is the complete Activity needed to stream a file (name hard-coded).
BTW, it's called SimpleNetRadio as I originally started playing around with Shoutcast streams.
You should also be able to do this with MediaPlayer with a bit more code - it would handle error conditions better and wouldn't require much more work.
使用 Netty 开发 RTSP 流媒体服务器是相当简单的任务,并且不需要花费太多时间。我自己写了它,它很有魅力。您可以查看其他一些使用 Netty 框架的服务器的示例实现来开始。
Developing a RTSP streaming server with Netty is fairly straight forward task and doesn't take much of time. I myself have written it and it worked like a charm. You could look at the sample implementations of some other servers using Netty framework to get started.
我不确定您的具体需求是什么,但对于静态文件,您可以尝试结合使用 Amazon S3 和 CloudFront,我相信它支持 RTSP。
I'm not sure what your specific needs are, but for static files you might try combining Amazon S3 and CloudFront, which I believe supports RTSP.