Your FOBS4JMF library is absolutely fantastic! Might be THE way for JMF to survive in spite of apparently being more or less abandoned by Sun...
And it seems to be exactly what I need for the adventure game editor I am currently developing (see xaya.sourceforge.net). So I removed Sun's JMF and installed FOBS4JMF instead.
I am using the eclipse IDE, and after registering both fobs4jmf.jar and the jmf.jar included in the Fobs4JMF directory as external jars, the whole project compiled fine.
I also added those files to the system-wide CLASSPATH. However, when my application tries to realise a player for, say, an mp3 file (gosh, I am *so* looking forward to be able to switch to ogg... ;-), an exception like the following one gets thrown (stack trace exceprt):
java.lang.UnsatisfiedLinkError: no fobs4jmf in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at com.omnividea.media.parser.video.Parser.<clinit>(Parser.java:337)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.sun.media.BasicPlugIn.getClassForName(BasicPlugIn.java:271)
at com.sun.media.BasicSourceModule.createDemultiplexer(BasicSourceModule.java:132)
at com.sun.media.BasicSourceModule.createModule(BasicSourceModule.java:96)
at com.sun.media.PlaybackEngine.setSource(PlaybackEngine.java:124)
at com.sun.media.MediaPlayer.setSource(MediaPlayer.java:30)
at javax.media.Manager.createPlayerForSource(Manager.java:1453)
at javax.media.Manager.createPlayerForContent(Manager.java:1326)
at javax.media.Manager.createPlayer(Manager.java:417)
at javax.media.Manager.createPlayer(Manager.java:332)
...
Additionally, the message "Fobs4JMF - Native shared library NOT found" is sent to STDOUT.
The file, however, gets played perfectly using the JMFStudio application delivered together with FOBS4JMF.
Any idea why FOBS4JMF complains about not finding the native shared library (fobs4jmf.dll, I presume?)?
Thanx for any help --
Torsten
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems clear that your problem is related to the location of the .dll file with the native implementation of fobs4jmf. I guess you're using windows (most fobs users do). In this case, the easiest solution is to copy the fobs4jmf.dll file into your windows/system32 directory. However, it's better if you place the file in the folder from where your app runs (somewhere in your eclipse projet folder).
Hope this helps!!
Cheers!
Jose San Pedro
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks for your quick reply! (It's amazing with which minute latency you reply to all these posts in this forum... :-)
Everything works fine indeed when copying fobs4jmf.dll into the directory containing the application jar file. Alternatively, providing the libraries location explicitly using the java VM -Djava.library.path=... command line switch also seems ok.
However, wouldn't it make sense to provide -- on the long run -- some mechanism to circumvent the use one of the above mentioned workarounds for each application? Maybe there is a way to tell the ClassLoader where to look for the file by some initialisation code inside one of the classes contained in fobs4jmf.jar...?
Cheers --
Torsten
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To all who might have experienced the same problem:
Adding the Fobs4JMF directory to the PATH environement variable also seems to help. Apparently Win doesn't use PATH for looking for applications only, but also for finding libraries. Hence I now start my applicacation using a little batch file like:
@echo off
set PATH=%PATH%;path\to\Fobs4JMF
javaw -cp .;some\classpath;path\to\Fobs4JMF\fobs4jmf.jar;path\to\Fobs4JMF\jmf.jar my.application.MainClass
For Linux, something similar using the LD_LIBRARY_PATH variable should work (not tried yet).
Regards --
Torsten
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks for the usefull info about dll configuration in windows. As you said, adding the Fobs4JMF path to the appropriate environment var helps application to locate the dll:
- MacOSX: DYLD_LIBRARY_PATH
- Linux: LD_LIBRARY_PATH
- Win32: PATH
Cheers
Jose San Pedro
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes, it definitely works for MacOS X -- just tried it out on a friend's iBook! :-) I just can't wait for downloading and testing the Linux version... ;-)
Torsten
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jos and others!
Your FOBS4JMF library is absolutely fantastic! Might be THE way for JMF to survive in spite of apparently being more or less abandoned by Sun...
And it seems to be exactly what I need for the adventure game editor I am currently developing (see xaya.sourceforge.net). So I removed Sun's JMF and installed FOBS4JMF instead.
I am using the eclipse IDE, and after registering both fobs4jmf.jar and the jmf.jar included in the Fobs4JMF directory as external jars, the whole project compiled fine.
I also added those files to the system-wide CLASSPATH. However, when my application tries to realise a player for, say, an mp3 file (gosh, I am *so* looking forward to be able to switch to ogg... ;-), an exception like the following one gets thrown (stack trace exceprt):
java.lang.UnsatisfiedLinkError: no fobs4jmf in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at com.omnividea.media.parser.video.Parser.<clinit>(Parser.java:337)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.sun.media.BasicPlugIn.getClassForName(BasicPlugIn.java:271)
at com.sun.media.BasicSourceModule.createDemultiplexer(BasicSourceModule.java:132)
at com.sun.media.BasicSourceModule.createModule(BasicSourceModule.java:96)
at com.sun.media.PlaybackEngine.setSource(PlaybackEngine.java:124)
at com.sun.media.MediaPlayer.setSource(MediaPlayer.java:30)
at javax.media.Manager.createPlayerForSource(Manager.java:1453)
at javax.media.Manager.createPlayerForContent(Manager.java:1326)
at javax.media.Manager.createPlayer(Manager.java:417)
at javax.media.Manager.createPlayer(Manager.java:332)
...
Additionally, the message "Fobs4JMF - Native shared library NOT found" is sent to STDOUT.
The file, however, gets played perfectly using the JMFStudio application delivered together with FOBS4JMF.
Any idea why FOBS4JMF complains about not finding the native shared library (fobs4jmf.dll, I presume?)?
Thanx for any help --
Torsten
Hi Torsten,
thanks a lot for using Fobs!
It seems clear that your problem is related to the location of the .dll file with the native implementation of fobs4jmf. I guess you're using windows (most fobs users do). In this case, the easiest solution is to copy the fobs4jmf.dll file into your windows/system32 directory. However, it's better if you place the file in the folder from where your app runs (somewhere in your eclipse projet folder).
Hope this helps!!
Cheers!
Jose San Pedro
Hi Jos,
thanks for your quick reply! (It's amazing with which minute latency you reply to all these posts in this forum... :-)
Everything works fine indeed when copying fobs4jmf.dll into the directory containing the application jar file. Alternatively, providing the libraries location explicitly using the java VM -Djava.library.path=... command line switch also seems ok.
However, wouldn't it make sense to provide -- on the long run -- some mechanism to circumvent the use one of the above mentioned workarounds for each application? Maybe there is a way to tell the ClassLoader where to look for the file by some initialisation code inside one of the classes contained in fobs4jmf.jar...?
Cheers --
Torsten
To all who might have experienced the same problem:
Adding the Fobs4JMF directory to the PATH environement variable also seems to help. Apparently Win doesn't use PATH for looking for applications only, but also for finding libraries. Hence I now start my applicacation using a little batch file like:
@echo off
set PATH=%PATH%;path\to\Fobs4JMF
javaw -cp .;some\classpath;path\to\Fobs4JMF\fobs4jmf.jar;path\to\Fobs4JMF\jmf.jar my.application.MainClass
For Linux, something similar using the LD_LIBRARY_PATH variable should work (not tried yet).
Regards --
Torsten
Hi,
thanks for the usefull info about dll configuration in windows. As you said, adding the Fobs4JMF path to the appropriate environment var helps application to locate the dll:
- MacOSX: DYLD_LIBRARY_PATH
- Linux: LD_LIBRARY_PATH
- Win32: PATH
Cheers
Jose San Pedro
Hi Jos,
yes, it definitely works for MacOS X -- just tried it out on a friend's iBook! :-) I just can't wait for downloading and testing the Linux version... ;-)
Torsten