views:

156

answers:

3

Hello.

Does anyone know what I should use to play a video in Java, from an InputStream? I get the video from a SOAP message, and I don't want to save it to the hard disk, I just want to play it once and then release it.

I have tried using JMF, I downloaded it, but it doesn't even install. What other free (open-source) alteratives are there in Java?

Oh, and I need to play any formats of video for which there are codecs installed (if it plays in Windows Media Player, it should play in the library I am using).

Please help

+2  A: 

JMF is the way to go.

Get JMF to install.

Will
+1: It's not like JMF doesn't meet the requirements, discarding it because of teething problems is silly.
Andrzej Doyle
I'm also disregarding it because it's no longer supported. The installer (or part of it) is a 16 bit app. We're almost in 2010, geez...And I also need it to support whatever codecs are installed in Windows. Can it do that without additional configuration?
Ove
+1  A: 

JMF doesn't need/want to be installed. Just find the JAR and put it on the classpath. Works for me.

Carl Smotricz
Where can I get the JAR file?
Ove
http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/download.html . If you get a .ZIP, unpack it. If you get an .EXE, execute it. To get all the video stuff you'll also need the Windows Performance Pack.
Carl Smotricz
I get an EXE. I execute it, and nothing happens...
Ove
OK, then I give up. Chances are, it doesn't fully support all formats supported by MPlayer anyway, so you might be disappointed if you got it running.
Carl Smotricz
Thanks for trying. I found FMJ, a library that uses JMF and it works, but I don't know how to get it to work from InputStream. It only works if I save the file to the hard disk, and then pass the filename as a parameter.http://fmj-sf.net/
Ove
Does it come with source code? Figure out what it's doing! Since JMF is doing most of the work, it's probably little more than a wrapper.
Carl Smotricz
+3  A: 

Or you can use Xuggler. See the MediaViewer object for source code showing how to do it. With Xuggler pretty much all codecs are supported out of the box.

Xuggle
I will test this
Ove