有没有简单的方法在java中播放rtmp流?
我想在java中播放通过rtmp协议流式传输的MP4视频。
我找到了一些 rtmp 库(yuv、red5),但 mp4 显示上没有任何内容。
是否有一个(可能简单且可能与平台无关的)解决方案可以在java中完成它?
I want to play an MP4 videon streamed over rtmp protocol in java.
I found a few rtmp libraries (yuv, red5), but nothing on mp4 display.
Is there a (possibly simple and maybe platform-indenpendent) solution to do it in java?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我的经验,大多数 rtmp 流往往不是 MP4。不过,rtmp 流并没有什么特别聪明的地方,如果您确实找不到任何适合您需求的东西,那么可以采取的方法是获取 rtmpdump 的副本,将流翻录到文件并播放它。
顺便说一句,我现在正在使用 IBM MP4 sdk 工具包,可以从 http://www 下载.alphaworks.ibm.com/tech/tk4mpeg4 。看起来很简单,在 5 分钟内下载、解压并让 Swing 演示应用程序在 NetBeans 中播放 MP4。如果您正在谈论的流确实是 MP4,您可能可以从我所看到的 IBM MP4 API 中快速找出如何将其热连到流。
Most rtmp streams in my experience tend not to be MP4. There's nothing particularly clever about rtmp streaming though, and if you really can't find anything to fit your needs the way to go is to get hold of a copy of rtmpdump, rip the stream to file and play it.
BTW I'm playing with the IBM MP4 sdk toolkit at the moment, downloadable from http://www.alphaworks.ibm.com/tech/tk4mpeg4 . Seems straightforward enough, dled, unzipped and had the Swing demo app playing MP4s in NetBeans in under 5 minutes. If the stream you're talking to is genuinely MP4 you could probably figure out how to hotwire it to the stream fairly quickly from what I'm seeing of the IBM MP4 API.