Hello Guest

[BUG] Incompatibility between LWJGL and JMF ?

  • 3 Replies
  • 9108 Views
[BUG] Incompatibility between LWJGL and JMF ?
« on: July 15, 2011, 13:15:56 »
Hello guys,

First, please apologize for my language, english is not my native ...

Well, I post here because it may help people who will face the same issue as me : I am working on an Augmented Reality application. I found NyARToolkit (http://nyatla.jp/nyartoolkit/wiki/index.php?FrontPage.en) a very useful library which enables beginners like me to make augmented reality in java. It uses JMF for the camera capture.

Then I wanted to place animated 3D models on my markers, thus I searched for some 3D loaders able to import 3D models with textures and animations (there's a lot of 3D models for geometry and texture, but quite a few for animations). I found NewDawn Quake Loaders for java3D (http://www.newdawnsoftware.com/), great and simple loaders. It has been working fine.

And I finally found that these loaders were also packed with Xith3D, a nice scenegraph-engine for java3D. Moreover in Xith3D they added a 3DS loader (NewDawn loaders import only MD2, MD3 and BSP). So I tried, Xith3D works fine.

The issue came when I tried to merge NyARToolkit and Xith3D : I discovered than when I import, in Eclipse, the lwjgl.jar (there's four of them for xith3D : lwjgl.jar, lwjgl_util.jar, jinput.jar and lwjgl-debug.jar), JMF is no more able to find devices on my computer. I mean : I printed out the device list before and after adding lwjgl.jar and it changed from 1 (a USb webcam) to 0. JMF can't find my USB camera when I import LWJGL jars.

Well, it is ok with me : I'll just use MD2 and MD3 loaders but in the future people may need to use both LWJGL and JMF at the same time. I have not the faintest idea how LWJGL can affect JMF but it does. A solution could be to use an other media framework library (I guess there must be other solutions, like using QT*).

I hope it'll help.

--------------------------

Remarks :
# I'm using WinXP and Eclipse Helios. Dunno if it matters.
# If some wonder why I used Java instead of C/C++ to code it, the answer is : I want to put the application as an applet on the web. I can't do it with C/C++.


*Beware of QT : if you try to use your camera with QT on Windows, you'll probably have to find a VDIG because QT uses Quicktime and there is no bridge between Microsoft's DirectShow and Apple's Quicktime. WinVDIG is a good one.

*

Offline moci

  • *
  • 27
    • mathiasverboven.net
Re: [BUG] Incompatibility between LWJGL and JMF ?
« Reply #1 on: January 31, 2012, 12:43:22 »
Has anyone looked at this? I'm currently in the same situation.

*

Offline Matzon

  • *****
  • 2242
Re: [BUG] Incompatibility between LWJGL and JMF ?
« Reply #2 on: January 31, 2012, 20:09:03 »
there's not a lot of meat in this bug...
If you can pinpoint that this is in fact a LWJGL bug - and not JMF, NyARToolkit or Xith3d that is the cause - then we can start to look into it.

Re: [BUG] Incompatibility between LWJGL and JMF ?
« Reply #3 on: February 01, 2012, 23:22:23 »
1. you must first install/file copy, the registry (jmf.properties) in the classpath, a writeable folder and if you want to add native support (hardware devices) ensure that the correct shell environment variables were set on launch :
for windows systems it is : PATH that must include the library path where jmf dll's are found
for linux systems it is : LD_LIBRARY_PATH that must include the library path where jmf so's are found
for mac systems there's no native support with JMF

NOTICE : PATH Environment variables are setup with the proprietary JMF install software. So if you did not install JMF with the orginal installer, then this might be the problem.

2. In addition to installing the PATH environment, you must load in your code the class that loads native devices from Java. V*Auto :
Code: [Select]
            if (JXAenvUtils.env.OS_LINUX.isEnv()) {
                try {
                    Class cl = Class.forName("V4LAuto");
                    cl.newInstance();
                } catch (Throwable ex) {
                    ex.printStackTrace();
                }
            }
            if (JXAenvUtils.env.OS_WINDOWS.isEnv()) {
                try {
                    Class cl = Class.forName("VFWAuto");
                    cl.newInstance();
                } catch (Throwable ex) {
                    ex.printStackTrace();
                }
            }
« Last Edit: February 01, 2012, 23:27:09 by broumbroum »