Java中的媒体播放器库 [英] Media player libraries in Java

查看:237
本文介绍了Java中的媒体播放器库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在评估用于在Java中播放音频/视频的库. 它不一定是100%Java ;与本地库的Java绑定完全可以.可以从Java控制的外部应用程序也可以,只要它可以在Java组件上呈现视频即可.

I am evaluating libraries for playing audio/video in Java. It does not need to be 100% Java; Java bindings to native libraries are perfectly OK. An external application that can be controlled from Java is also fine, as long as it can render video on a Java component.

目标平台是Linux. Windows支持是一个加号,但不是必需的.

The target platform is Linux. Windows support is a plus, but not required.

我已经使用 VLCj 绑定来玩VLC,并且在一般情况下效果很好,但在承受压力的情况下偶尔会崩溃.我还在从属模式中使用了mplayer,看起来不错.但是我也想评估其他选项.

I have played with VLC using the VLCj bindings, and it works pretty well in general, but keeps crashing occasionally when put under stress. I have also used mplayer in slave mode, which looks good. But I'd like to evaluate other options as well.

这些是要求:

  • 使用RTSP通过RTP实时播放H.264,MPEG4.通过HTTP为MJPEG加分.
  • 能够在Java(Swing或AWT)组件上呈现视频
  • 开源,并积极维护
  • 稳定,坚如磐石
  • Live playback of H.264, MPEG4 through RTP using RTSP. Extra points for MJPEG over HTTP.
  • Able to render video on a Java (Swing or AWT) Component
  • Open source, and actively maintained
  • Stable, rock-solid

建议?咨询吗?

推荐答案

好,我上个月花了几个选项,结果是:

Ok, I've spent the last month playing with several options and these are the results:

  1. VLC .这是我的第一个想法,因为每个人都在说它发挥一切".我既使用了 VLCj Java绑定,也使用了内置的

  1. VLC. This was my first thought, as everybody keeps saying that it "plays everything". I have used both the VLCj Java bindings, and the built-in remote interface (-I rc). I found this to work pretty well in general, but had some issues. I kept seeing ocassional crashes under heavy load (not VLCj's fault as it also happens when using the binary directly). Also I've found memory consumption to be relatively high when compared to other options.

MPlayer .以我的经验,这实际上比VLC更好,没有崩溃,并且内存消耗更低.没有Java绑定,尽管从属模式效果很好.

MPlayer. This actually performs better than VLC in my experience, no crashes, and memory consumption is lower. No Java bindings, although the slave mode works very well.

GStreamer .非常强大,非常灵活,同时仍然易于上手.尝试了 Java绑定和运行

GStreamer. Very powerful, very flexible, while still easy to get started with. Tried both the Java bindings and running the gst-launch binary from Java. Both approaches work remarkably well.

Xuggler 看起来不错,但是RTP似乎有问题(如 ).由于GStreamer和MPlayer都运行良好,因此我没有超出最初的研究范围.

Xuggler looked good, however it seems to have issues with RTP (as stated in the FAQ). Since both GStreamer and MPlayer worked so well, I did not get past the initial research.

根据要求,我发现GStreamer是最好的解决方案,第二个选择是MPlayer.

I found GStreamer to be the best solution given the requirements, with MPlayer being the second option.

这篇关于Java中的媒体播放器库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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