title: Adding other video codecs / DVD support to JavaFX 2.2
body: <h2><i>Update:</i></h2>
  
  <p><i>Since the media side of JFX has been open sourced, I've looked into this myself and it is indeed possible, but requires changing and rebuilding the JFX source (both Java and C parts.) The process is described <a href="http://berry120.blogspot.co.uk/2014/03/expanding-javafxs-media-support.html" rel="nofollow noreferrer">here</a> for anyone that wants to have a go - I add MKV support in that example, but it should be very similar for other plugins.</p>
  
  <p>The remainder of the question is thus mainly historical, but I'll leave it here for reference.</i></p>
  
  <h1>Background</h1>
  
  <p>I've been using VLCJ thus far for playing video in my application. It works, but if possible I'd like to see if I can achieve a similar level of support for common codecs by migrating to JavaFX and saving myself a lot of hassle with multiple VMs and suchlike that VLCJ needs to play multiple videos reliably. I won't go into it here but see my answer to <a href="https://stackoverflow.com/questions/4669384/dealing-with-video-dvds-avi-mkv-in-java">this</a> question if you're interested in the details. There's also the issue of cross-platform compatibility, it works on Mac and Linux ok but I haven't worked out how to get it to show on Mac yet (I believe there's some security in place to prevent one process gaining access to another's native components, but again that's beyond the scope of this question.)</p>
  
  <p>It boils down to the fact that while it works, it's a lot of maintenance and hassle working with multiple VMs and bridging them stably if there's another solution that would be easier. VLC does have a pretty legendary level of support for playing pretty much anything which is why I've gone with it thus far, and I'd be interested to see if I can get a similar result in JavaFX - or at least if it can provide the means for doing so in a cross platform manner.</p>
  
  <h1>Research</h1>
  
  <p>JavaFX 2.0 supports video - great! But at the moment the official line is it supports "FLV containing VP6 video and MP3 audio". Is there a way to extend this to add in support for more codecs? There's no hard codec that I'd like to support, it's more a case of as many as I can so I'm looking for an extensible method to go about the above.</p>
  
  <p>I wondered if it would play video for codecs installed natively on the machine and that it just doesn't advertise itself as such (because that functionality obviously is machine dependant and not cross-platform.) But no dice, I've tried a number of common formats and it really does refuse to play anything other than what it states.</p>
  
  <p>From looking at JavaFX 1.3 it <a href="http://download.oracle.com/javafx/1.3/tutorials/media-platforms-formats/" rel="nofollow noreferrer">also supports other platform dependant codecs depending on where it's installed</a>. Is there a way to get this behaviour with JavaFX 2? Or is it planned at all for a subsequent release? I haven't been able to find any information on it on the roadmap or any comment from Oracle about it.</p>
  
  <p>Only thing I could find from searching extensively is <a href="https://forums.oracle.com/forums/thread.jspa?threadID=2232446" rel="nofollow noreferrer">here</a> which implies that it may be possible but no-one seems to know how. I'd also be interested to know if it's based on GStreamer why all the formats supported by GStreamer aren't included by default either?</p>
  
  <p>In terms of playing DVDs with JavaFX I've got absolutely nowhere, so I'm assuming that's just a no-go at the moment. If anyone does have any ideas or information though, I'm all ears.</p>
  
  <h1>Other approaches</h1>
  
  <p>One approach which I was half wondering may be possible is crowbarring the JMC jar out of the old JavaFX as described <a href="http://www.informit.com/articles/article.aspx?p=1326515" rel="nofollow noreferrer">here</a> and trying to get that working alongside JavaFX 2. I don't suppose anyone has had any luck with that approach or something similar?</p>
  
  <p>All things failing, if anyone has any information or links on if / when support for additional codecs will be supported out of the box, then I'd be interested to hear that also. Or if anyone has any contact details for someone at Oracle I could ask that would also be appreciated! I've been longing for decent video support in Java for some time, and I guess what this boils down to is trying to figure out if JavaFX is the answer to this, or just another half hearted attempt that will never play more than what it does at the moment! I'm hoping it's not the latter, but I've yet to see much to show that's the case.</p>