Question

I am looking forward to build a media player with java, and basically what I found was JMF. But, then again, this API is not upto date and doesn't support latest formats such as MKV. On more research, I stumbled upon

Any simple (and up to date) Java frameworks for embedding movies within a Swing Application?

Got all excited, but then digging some more, left me with this

Adding other video codecs / DVD support to JavaFX 2.2

Now, I am disappointed and in a fix that how all the good media players (VLC, KMPlayer etc) been able to support all video and audio formats. They must be build using a programming language, IMHO !

So, my question would be, in-order to build a complete media player which supports all kind of media files:

  1. Is JAVA incompetent ?
  2. Has one ever build a good media player using JAVA ?
  3. Is it just Java or no modern language can do it ?
  4. Do I have rely and choose C, C++ to do this ?

No correct solution

OTHER TIPS

Well, Java is a programming language that was created to support multiple platforms (like Windows, Macintosh and Linux). It works with a virtual machine: a sandbox. So there are a few constrictions, that are based on this sandbox system: Everything, that you want to use in Java must be compatible with ALL platforms, java is created for. And because playing media is very near to the system and of course the hardware (soundcard, graphics board etc), Java may get problems on getting this compatible to all platforms. Another big problem is: Many codecs, you have to read and play (e.g. OGG-Vorbis) are not open sourced, so you will get problems on finding a good API to work with them. Of course there ARE APIs, but I have no experience with them.

Is JAVA incompetent ?

No, but Java was not created, to do system work. Of course, media playing is not a system work, but is near to the system. And Java does not implement codecs for playing music or videos, so you need custom APIs, as I said before.

Is it just Java or no modern language can do it ?

Well the problem is Java: Try a language, that supports more system- and hardware functionality.

Do I have rely and choose C, C++ to do this ?

In my opinion, this is your best opportunity. You may even use VB or VB.Net or whatever, but I think, you will get bigger problems with Java. Of course, this is just my experience, and other people may say you something different, but I think: Yes, C++ is a better language for a media player.

Hope, that answer helped you, greetings Cydhra

P.S. Sorry, if my English is not that good, it is not my mother language...

The main problem with including more formats in Java by default is licensing restrictions - many of the popular formats are absolutely encumbered with patents and licenses, and for a company like Oracle to support lots of them as part of the JRE just isn't cost effective (in all likelihood.)

However, as mentioned before JFX8 is now open source, and you can thus compile in extra GStreamer plugins if you so choose. I did this recently with MKV, the process is described here if you want to do it with another format.

Since MKV is an open format, I also see no reason in theory why it can't be included in the default classes, so I created a ticket along with the patch - hopefully it may be included as standard in the not too distant future (absolute earliest 8u40.)

If you just want good media support in Java now however, and don't mind having VLC as a dependency, I'd use VLCJ - I use it in my application and it works a treat.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top