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)
2
  • Maybe something like this? stackoverflow.com/questions/2550571/loading-jni-lib-on-mac-os-x Commented Feb 5, 2012 at 6: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 Commented Feb 8, 2012 at 15:23

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

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)

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.