视频处理(DVD光盘,.AVI的.mkv)在Java中 [英] Dealing with video (DVDs, .avi .mkv) in Java

查看:141
本文介绍了视频处理(DVD光盘,.AVI的.mkv)在Java中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

四处寻找在Java播放视频一个像样的图书馆后,我来脱胶。周围的人都尖叫着不使用JMF,因为它是过时的,老而要求用户安装它,其他的替代品,如VLCJ似乎不错,如果他们的工作,但仍然相对不稳定,依靠巨额款项本地code,并作为处理的DVD,这似乎是金粉在一个自由的图书馆查找!

After looking around for a decent library for playing videos in Java, I've come unstuck. Everyone around is screaming not to use JMF because it's outdated, old and requires the user to install it, other alternatives such as VLCJ seem good if they work but are still relatively unstable and rely on hefty amounts of native code, and as for dealing with DVDs, that seems like gold dust to find in a free library!


  • 现在,JavaFX的2正蓄势待发,它已经是我一直认真地在看(因此我的问题<一href=\"http://stackoverflow.com/questions/8153227/adding-other-video-$c$ccs-dvd-support-to-javafx-2-0\">here)但我没有运气至今在试图找出如何使其发挥什么比沼泽标准的FLV视频等等。

  • VLCJ是什么它(见我的回答电流)运作良好,此刻就是我与走在前面。它采用libvlc做pretty任何东西,因为它可以起到pretty太多的任何文件和播放DVD的开箱了。最大的问题是你必须使用多个虚拟机,每个玩家得到它稳定地执行,这意味着反应相对较慢。我还没有得到这个办法在Mac上工作呢。

  • JMF是可笑过时的,可怕的,只是不是一个真正的选择,因为就我而言。我已经打了它在过去和经历并不是一个好!

  • FMJ说,这是在JMF更换下降。我还没有让它工作,因为有其他大多数人跟我谈过的,这本身就使我疲倦的质量和COM prehension的就算我设法得到它的工作!

  • 为它做什么,它有精彩的教程和它写得很好Xuggler是伟大的。但是,尽管它非常适合低级别的代码转换工作,播放视频和获取帧以正确的顺序和同步等仅仅是一个噩梦得到正常工作,又增加了更多的code,这意味着更多的维护,可能更多的错误等等等等...

  • 我还没有与任何愤怒尝试的GStreamer-Java的呢,虽然似乎支持DVD播放(它是一个开源的应用程序,我正在努力让商业插件既不是一个选项)不和它的codeC的支持似乎并不成为最宽的。

  • ĴcodeC 是一个有趣的工作,我已经看到了从一个纯粹的实现视频支持的唯一Java透视 - 但对于格式的支持缺乏的时刻,这是一个相对较新的项目

  • 编写自己的东西在不同的机库为每个平台我想支持。这是绝对的不得已的选择,由于增加的维修和编码时它会需要。

  • Now JavaFX 2 is gaining momentum it's been something I've been seriously looking at (hence my question here) but I've no luck so far in trying to work out how to make it play anything more than bog standard FLV video.
  • VLCJ is working well for what it does (see my current answer) and at the moment is what I'm going ahead with. It uses libvlc to do pretty much anything, as in it can play pretty much any file and plays DVDs out of the box too. Big problem is that you have to use multiple VMs for each player to get it to perform stably, and that means response is relatively slow. I also haven't got this approach to work on a Mac yet.
  • JMF is ridiculously outdated, horrible and just not really an option as far as I'm concerned. I've played with it in the past, and the experience was not a good one!
  • FMJ says it's a replacement drop in for JMF. I've yet to make it work, as have most other people I've spoken to, and that in itself makes me weary of its quality and comprehension even if I do manage to get it working!
  • Xuggler is great for what it does, it's got brilliant tutorials and it's very well written. But while it's great for the low level transcoding work, playing a video and getting the frames in the right order and in sync and so on is just a nightmare to get working properly, and again adds more code which means more maintenance, potentially more bugs etc. etc...
  • I haven't tried GStreamer-Java yet with any anger, though it doesn't seem to support DVD playback (it's an open source app I'm working on so commercial plugins aren't an option either) and it's codec support doesn't seem to be the widest.
  • JCodec is an interesting effort, the only one I've seen to implement video support from a pure Java perspective - but support for formats is lacking at the moment and it's a relatively new project.
  • Writing something myself in a different native library for each platform I want to support. This is the absolute last resort option due to the added maintenance and coding time it'd require.

根据上述(或其他任何你能想到的),什么办法将人推荐以及是否有任何其他的明智的人我已经错过了?或其他任何人认为可能会在不久的将来可用?

Based on the above (or anything else you can think of), what options would people recommend and are there any other sensible ones I've missed out? Or any others people think might be available in the near future?

推荐答案

做了很多各地的不同选项的研究和尝试几出之后,我已经与VLCJ毕竟,但这里的渔获 - 所有的VLCJ东西在离开过程中虚拟机的完成。这是一个比较复杂在这里设立(见 对我是如何做到的),但事后你可以扔掉所有你喜欢它,它只是罚款(目前使用3出的过程中玩家不稳定性问题。)

After doing a lot of research around different options and trying a few out, I've gone with VLCJ after all, but here's the catch - all the VLCJ stuff is done in out of process VM's. It's a bit more complicated to set up (see here for how I did it) but afterwards you can throw all you like at it and it works just fine (currently using 3 out of process players with no stability issues.)

Xuggler是伟大的,但不幸的是太低级了我 - 巨量重新发明与寻找工作敷衍我有点让刚刚播放所需的轮(而且是一个糟糕的轮);我觉得它会永远采取所有的问题出与它进行排序。对于编码/转码/其他低级别的视频作品,虽然我会全心全意地推荐它 - 最好的毫无疑问

Xuggler was great, but unfortunately too low level for me - the sheer amount of re-inventing the wheel (and a worse wheel at that) required just to get playback with seeking working put me off somewhat; I felt it'd take forever to sort all the problems out with it. For encoding / transcoding / other low level video work though I'd wholeheartedly recommend it - best without a doubt.

我选择的方法注意事项?好吧,如果外部VM没有关机明确,他们将继续效力于应用程序退出后连背景的视频和调试,这种做法变得更难。我也还没有验证它运行在Mac着呢,我最初的建议是可能不是,因为从我所听到的MacOS不会让一个进程控制另外的窗口,不与本地code明确许可。这应该是可能的一些工作虽然。

Caveats with my chosen approach? Well, if the external VMs aren't shut down explicitly they'll carry on playing the video in the background even after the application has quit, and debugging gets harder with this approach. I also haven't verified it runs on Mac yet, and my initial suggestion is probably not because from what I've heard MacOS doesn't let one process control another's window without explicit permission with native code. That should be possible with a bit of work though.

作为分拆给我此刻工作的项目我会看看我是否能在使用VLCJ下面一个简单的Java框架的视频包出这一切的流程功能。如果有人有兴趣在这个(我不能保证什么,但更多的利益,我得到,就越有可能,我在它的工作),然后随意让我知道!

As a spin off to the project I'm working on at the moment I might see if I can wrap up all this out of process functionality in a simple Java video framework that uses VLCJ underneath. If anyone would be interested in this (I can't promise anything but the more interest I get, the more likely I am to work on it) then feel free to let me know!

所以我的研究和发现后,我建议你用VLCJ去(但的绝对的使用进程外的球员),如果你只是想播放/录音/视频流的东西,Xuggler如果你想要做与codeCS自己任何低级别的视频作品。在写这篇文章的时候,那里只是没有很好的,纯Java的解决方案,它可能会留下这样一段时间 - 幸运的是,虽然它有可能获得与本地库像样的成绩跨平台。它只是需要更多的工作!

So after my research and findings, I'd recommend going with VLCJ (but definitely using out of process players) if you just want to play / record / stream video stuff, and Xuggler if you want to do any low level video work with the codecs themselves. At the time of writing, there just is no nice, pure Java solution, and it'll probably stay that way for a while - fortunately though it is possible to get decent results with native libraries cross platform. It just requires a lot more work!

这篇关于视频处理(DVD光盘,.AVI的.mkv)在Java中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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