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!
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?
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 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.
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.
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!
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!
I used jffmeg on some of my projects(ffmeg java bindings), so far I havent faced any problem. http://jffmpeg.sourceforge.net/documentation.html. I also used qt-jambi, but never tried its video library(phonon), this can also solve your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With