Log in

View Full Version : WPICameraExtension difficulties


gizmo720
14-01-2014, 23:22
My team is trying to use the WPICameraExtension as a base to do our vision processing. However, we are having difficulty getting it to work. Specifically, we are getting "java.lang.UnsatisfiedLinkError:" exceptions:
Exception in thread "Thread-4" java.lang.UnsatisfiedLinkError: no jniavcodec in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1874)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1087)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.j ava:711)
at com.googlecode.javacpp.Loader.load(Loader.java:586 )
at com.googlecode.javacpp.Loader.load(Loader.java:540 )
at com.googlecode.javacv.cpp.avcodec.<clinit>(avcodec.java:39)
at com.googlecode.javacv.FFmpegFrameGrabber.<clinit>(FFmpegFrameGrabber.java:103)
at edu.wpi.first.wpijavacv.WPIFFmpegVideo$1.run(WPIFF mpegVideo.java:25)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/javacpp131673991977045/libjniavcodec.so: libavutil.so.52: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.jav a:1953)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1878)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1839)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1061)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.j ava:700)
... 5 more


We have tried this on 2 Windows, a Mac, and a Linux computer. On the Linux computer, we have been able to manually compile the correct version of the shared object, and and extend LD_LIBRARY_PATH to point to them. After doing this, the extension works fine.

I assume that this is a simple mismatch between the version that WPICameraExtension was compile against, and the binary version of the dependency that is being distributed. Has anyone versions of these that are already binary compatible. If not, what would it take to set the build environment in Windows to compile the dependencies ourselves?

Joe Ross
15-01-2014, 00:29
Per http://wpilib.screenstepslive.com/s/3120/m/7932/l/93058-smart-dashboard-standalone-vision-installer this is from using 64 bit java. It has instructions for getting it working with 32 bit java.