Hello JMF

Well, I gotta say that working with JMF is about as fun as something that isn't much fun at all. But the results came sooner than I'd feared. Here's my first movie player:

Currently it is a simple Swing application. However, no matter how much I tried, I couldn't get it to work on the NetBeans Platform. I know it must have something to do with Fobs, which "is a set of object oriented APIs to deal with media. It relies in the ffmpeg library, but provides developers with a much simpler programming interface." It works fine when I bundle it together with the other JMF libraries (although, I have no sound and the visual movement is slow). But, when I migrate the same application to the NetBeans Platform, using the same libraries, I get this error message, which is what I got before porting my application to the NetBeans Platform, prior to including the Fobs library:

Unable to handle format: XVID, 624x352, FrameRate=23.9, Length=1317888 0 extra bytes
Unable to handle format: mpeglayer3, 48000.0 Hz, 0-bit, Stereo, Unsigned, 18153.0 frame rate, FrameSize=9216 bits

If anyone knows the solution to this (and also how to get the sound working in my normal Swing application), that would be great.


Could it have something to do with native libraries and the way that they're handled in NetBeans' classloader? Native libraries (i.e. DLLs on MS Windows) need special care as detailed in the "JNI" section of the "Modules API" document.

Posted by Tom Wheeler on January 17, 2007 at 05:58 AM PST #

Are you debugging this program. As far as I know, the media player is a little problem with that feature. The media is played by accessing hardware directly, it may not be run in debug mode.

Posted by guest on January 17, 2007 at 09:25 AM PST #

Yes - I think you are having difficulties with the native wrapper and dll's. The problem is you can define inside the JVM where to look for the JNI wrapper, but not where to find the dll you need for the JNI wrapper to work. If you put it directly in NetBeans main folder (where all the clusters are stored) this problem should vanish. I am currently working at a solution to this problem based on the idea in http://jvmpath.googlecode.com. This will modify the dll searchpath for actual running application to fit your needs. Always fun to do such things - Java is so much better at this ;-)

Posted by Sven Reimers on January 17, 2007 at 02:53 PM PST #

Hi Geertjan, As far as I know, MP3 support for JMF was added recently. You probably need the JMF MP3 Plugin, available from JMF MP3 Plugin

Posted by Antonio on January 18, 2007 at 01:39 AM PST #

Hello Geertjan:

I'm trying to use JMF with Netbeans.
After read your blob, I suppose the problem is with the DLLs
that JMF uses to drive the devices.

I created a module to return the devices:

The line code in question is:

listaDispositivos = CaptureDeviceManager.getDeviceList();

this line returns "list.size()==0".

With the same netbeans, I created a Java Application (Not Applet) and I ran from the netbeans and it returns the devices.

Both Netbeans Module and Java Application has the same jmf.jar.

How I can identify wich DLL is used by JMF and how can I set netbeans to search this DLL?.

Another mention, The PATH enviroment is set to C:\\‌WINDOWS for my computer user.

Thanks in advance.



Posted by Javier Godino on February 26, 2011 at 03:44 AM PST #


I'am learnig jmf by reading the jmf documentation in the oracle website.

But all source codes in jmf documentation are missing because the website is oracle, and not sun.

For example, in this page http://www.oracle.com/technetwork/java/javase/documentation/swingjmf-176877.html ,

the link of MDIApp.java source code is broken ( http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/MDIApp.java ).

So where are all source code of jmf documentation ?

Thank you.

Posted by guest on June 20, 2012 at 05:05 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« April 2014