Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Media player libraries in Java [closed]

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.

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

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.

These are the requirements:

  • 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

Suggestions? Advice?

like image 720
Grodriguez Avatar asked Oct 07 '10 21:10

Grodriguez


1 Answers

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

  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.

  2. 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.

  3. 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.

  4. 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.

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

like image 159
Grodriguez Avatar answered Sep 23 '22 10:09

Grodriguez