X

Geertjan's Blog

  • January 17, 2007

Hello JMF

Geertjan Wielenga
Product Manager
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.

Join the discussion

Comments ( 6 )
  • Tom Wheeler Wednesday, January 17, 2007
    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.
  • guest Wednesday, January 17, 2007
    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.
  • Sven Reimers Wednesday, January 17, 2007
    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 ;-)
  • Antonio Thursday, January 18, 2007
    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
  • Javier Godino Saturday, February 26, 2011

    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.

    Regards

    Javier


  • guest Wednesday, June 20, 2012

    Hello,

    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.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.