2

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.

P3trur0
  • 3,155
  • 1
  • 13
  • 27
Dhaval Bhoot
  • 241
  • 1
  • 5
  • 18
  • Your Java code is looking for libmediainfo.so, do you have the alias libmediainfo.so linking to libmediainfo.so.0? As the code is not the one from the [MediaInfoLib official Java example](https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfoDLL/MediaInfoDLL.JNA.java), you may consider to test the official example. – Jérôme Martinez Dec 13 '17 at 13:27
  • I done linking using $ sudo ln -s /home/veni/Documents/veniProjectMySQL/AddDummyData/src/main/resources/libmediainfo.so.0 /home/veni/Documents/veniProjectMySQL/AddDummyData/src/main/resources/libmediainfo.so command but still it do not work. I have considered code from filebot project – Dhaval Bhoot Dec 14 '17 at 05:49
  • I even considered MediaInfoLib official java example. In that there is the same error. for libzen it has no any problem and has no error in loading, then what is the problem in mediainfo library loading. – Dhaval Bhoot Dec 14 '17 at 06:09
  • @JérômeMartinez I try best to solve this, but it do not work – Dhaval Bhoot Dec 14 '17 at 06:50

0 Answers0