Mediainfo Java wrapper from filebot does not work in my code - java

I want to get information about video so I come to know that, mediainfo is good option. I try to use it java. So I fins the MediaInfo.java a wrapper around the native library mediainfo.s.0 I have ubuntu 16.04 64bit and the library are also 64bit. I get code from the filebot git project and put the native library in resource path. But still I get the error.
Exception in thread "main" com.mediainfo.MediaInfoException: Unable to
load amd64 (64-bit) native library libmediainfo.so: Unable to load
library 'mediainfo': Native library (linux-x86-64/libmediainfo.so) not
found in resource path`
`Caused by: java.lang.UnsatisfiedLinkError: Unable to load library
'mediainfo': Native library (linux-x86-64/libmediainfo.so) not found in
resource path
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
at com.sun.jna.Library$Handler.<init>(Library.java:147)
at com.sun.jna.Native.loadLibrary(Native.java:412)
at com.mediainfo.MediaInfoLibrary.<clinit>(MediaInfoLibrary.java:23)
at com.mediainfo.MediaInfo.<init>(MediaInfo.java:22)
... 1 more
I put both libmediainfo.so.0 and libzen.so.0 in /usr/lib directory in my system and then check.
The error for zen library is solved but the error for mediainfo library is still there. The code to load these library is as below
Library LIB_ZEN = Platform.isLinux() ? (Library) Native.loadLibrary("zen", Library.class) : null;
MediaInfoLibrary INSTANCE = (MediaInfoLibrary) Native.loadLibrary("mediainfo", MediaInfoLibrary.class, singletonMap(OPTION_FUNCTION_MAPPER, new FunctionMapper() {
#Override
public String getFunctionName(NativeLibrary lib, Method method) {
// MediaInfo_New(), MediaInfo_Open() ...
return "MediaInfo_" + method.getName();
}
}));
So I am not able to solve this problem. I try very hard to solve this.

Related

java.lang.UnsatisfiedLinkError: Le module spécifié est introuvable.on Tess4J

I'm developing a web app using Spring MVC with Maven and with some functionality using tess4j for the OCR.
My dev environment:
Eclipse Neon.3
os: win server 2008R2
jvm 64 bit
apache tomecat 9
I downloaded the latest version of Tess4J from http://tess4j.sourceforge.net/ and imported it into eclipse. I am following this URL, I followed all the steps but when I try to execute it I am getting the following error:
java.lang.UnsatisfiedLinkError: Le module spécifié est introuvable.
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.Native.open(Native.java:1759)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:260)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
at com.sun.jna.Library$Handler.<init>(Library.java:147)
at com.sun.jna.Native.loadLibrary(Native.java:412)
at com.sun.jna.Native.loadLibrary(Native.java:391)
at net.sourceforge.tess4j.util.LoadLibs.getTessAPIInstance(LoadLibs.java:75)
at net.sourceforge.tess4j.TessAPI.<clinit>(TessAPI.java:42)
at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:367)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:280)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:212)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:196)
I try to some tutorial and i add:
.MV C++ 2015 Redistributable (x64)
.I add on C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\temp\tess4j\win32-x86-64
I still have the error.
What is essentially happening is System is not able to find a native module called 'spécifié' (I think, I can't read French) to load. Now the mechanics is like this. during load time somewhere (probably in the jar) a call is being made like
System.loadLibrary("spécifié");
Which is failing because the native library is not on PATH. So a simple solution would be to put the module on PATH. If it is an Windows environment, then the module would be a DLL file called spécifié.dll. This file must be placed on the path (e.g. set PATH=C:\xyz\spécifié.dll).
Try it and check.

Eclipse Java Unsatisfied link error on OSX

I am using Opencv 3.1.0 with java on Eclipse and trying to run a basic program, however something is wrong with the build path as I am receiving an error. I already added the opencv user library, but when I run something like-
System.loadLibrary( Core.NATIVE_LIBRARY_NAME );
Mat mat = Mat.eye( 3, 3, CvType.CV_8UC1 );
System.out.println( "mat = " + mat.dump() );
I get this error-
Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java310 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at OpenCvTester.main(OpenCvTester.java:7)
I added the opencv library using the .jar file, and I have the opencv lib folder as the native library location. I don't know what the problem is here, please let me know. Thanks so much.
got the same error. The solution for me was very simple but difficult to find since it's specific to OS X.
Inside your ..opencv_path/build/lib/ folder RENAME libopencv_310.so to libopencv_310.dylib
Hope that helps.
Reference - http://www.senwang.me/2016/01/28/Mac-Opencv-3-1-0/

How to connect JPL with SWI-Prolog in Mac OS X

Hi i have a problem with a jpl interface. I want connect JPL with swi-prolog installed with mac-ports with eclipse. I have a jpl.jar and i have tried to import the jar file in eclipse with build path but i have this error: "no jpl in java.library.path".
So i have copied libjpl.dylib in a /opt/local/lib/swipl-7.1.29/bin/ and when i execute the code i have this error: "Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/local/lib/swipl-7.1.29/bin/libjpl.dylib: dlopen(/opt/local/lib/swipl-7.1.29/bin/libjpl.dylib, 1): Library not loaded: /Users/janw/stable/lib/swipl/lib/x86_64-darwin13.0.0/libswipl.dylib
Referenced from: /opt/local/lib/swipl-7.1.29/bin/libjpl.dylib
Reason: image not found"
After a anoying waste of time i found the solution about that problem.
First of all, its completely necesary to install swi-prolog via macports, if not, as i did, when you point in the
Djava.library.path=/users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0
this exception will apear
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib: dlopen(/Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib, 1): Library not loaded: /Users/janw/stable/lib/swipl/lib/x86_64-darwin13.0.0/libswipl.dylib
Referenced from: /Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at jpl.JPL.loadNativeLibrary(JPL.java:100)
at jpl.fli.Prolog.<clinit>(Prolog.java:85)
at jpl.Query.open(Query.java:286)
at jpl.Util.textToTerm(Util.java:162)
at jpl.Query.<init>(Query.java:198)
at consultasProlog.Consultas.consultaFicheroProlog(Consultas.java:19)
at utilidades.RellenarModelo.ejecutarArchivo(RellenarModelo.java:30)
at javaprolog.JavaProlog.main(JavaProlog.java:30)
Java Result: 1
So follow these steps.
port install swi-prolog on terminal , if you dont have install already macports command not found will apear so go to https://www.macports.org/install.php and install macports.
navigate to the path of swi prolog macports installation which mine is
/opt/local/lib/swipl-6.6.6/lib/x86_64-darwin14.0.0
copy this path and set in java.library.path in the java VM as -Djava.library.path=/opt/local/lib/swipl-6.6.6/lib/x86_64-darwin14.0.0
Now .pl with jpl.jar will be able to execute and the consults will run.
Hope it will help you and every person who find this hell problem.
Cheers frank.

Eclipse Error: no jogl in java.library.path

So I'm quite new to eclipse (first week of actually trying to use it to develop stuff.) and I tried to import an example project from http://unfoldingmaps.org/ and upon trying to compile their test project I'm greeted with the error:
Eclipse Error: Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
Right now my $path sys var looks like this:
C:\csvn\Python25\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\SourceGear\Common\DiffMerge\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MySQL\MySQL Server 6.0\bin; %JAVA_HOME%;%ANT_HOME%\bin
Is there something that I'm missing? Jogl.jar is in the project but it seems like the project is just skipping over stuff.. help?
It seems that your application requires some sort of native library, you need to specify the parameter -Djava.library.path=/path/to/libs on the VM args field on eclipse.

OpenCV Classpath in Netbeans

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)
It is due to the compatibility issue of your openCV and javaCV libraries.
Try to download compatible openCV libraries (containing bin folder).
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)
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.

Categories

Resources