1

i just started working with JavaCV under MacOSX. I compiled OpenCV with CMake from the latest source and put the path where the libraries are into the -Djava.library.path=\path\to\libraries JVM Argument and added the JavaCV Libraries in my Project Settings. I also tried several other Variation of the Classpath. But when i launch an easy Project to just grab one image from my webcam i get following error:

Exception in thread "Thread-3" java.lang.UnsatisfiedLinkError: no jnivideoInputLib in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1045)
    at com.googlecode.javacpp.Loader.load(Loader.java:358)
    at com.googlecode.javacpp.Loader.load(Loader.java:285)
    at com.googlecode.javacv.cpp.videoInputLib.<clinit>(videoInputLib.java:80)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:305)
    at com.googlecode.javacpp.Loader.load(Loader.java:285)
    at com.googlecode.javacv.cpp.videoInputLib$videoInput.<clinit>(videoInputLib.java:192)
    at com.googlecode.javacv.VideoInputFrameGrabber.start(VideoInputFrameGrabber.java:89)
    at webcampong.Grabber.run(Grabber.java:35)
    at java.lang.Thread.run(Thread.java:680)
m0rth1um
  • 11
  • 4
  • Maybe something like this? http://stackoverflow.com/questions/2550571/loading-jni-lib-on-mac-os-x – BillRobertson42 Feb 05 '12 at 06:09
  • no i tried that already. w/ windows and linux it works fine. but as i'm new to macosx i am not sure if i compiled the libraries in the right way. can somebody tell me how the files i get after compiling have to look like? i only get a bunch of dylib files a cv.so file or so in the /lib folder. the jni files in the question you posted arent there.maybe i dont look at the right place or they're not made by gcc at all – m0rth1um Feb 08 '12 at 15:23

3 Answers3

1

It is due to the compatibility issue of your openCV and javaCV libraries. Try to download compatible openCV libraries (containing bin folder).

Anooj Krishnan G
  • 849
  • 7
  • 25
0

VideoInputFrameGrabber works only under Windows.

As stated in JavaCV's README.txt:

  • New videoInputLib wrapper and corresponding VideoInputFrameGrabber to capture using DirectShow, useful under Windows 7 where OpenCV and FFmpeg can fail to capture using Video for Windows (issue #58)
Jose Gómez
  • 3,110
  • 2
  • 32
  • 54
0

I use javacpp and videoinput to manipulate cameras. I got the error 'java.lang.UnsatisfiedLinkError: no jnivideoInputLib in java.library.path' when I call 'videoInput.listDevices()'. I fix the problem by adding codes like:

org.bytedeco.javacpp.Loader.load(org.bytedeco.javacpp.opencv_highgui.class);
System.out.println(videoInput.listDevices());

you must call 'Loader.load' first before you call other methods, I don't know why.

Taoyong
  • 31
  • 2