CLI + libmediainfo.so on armv7l

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
Duc
Posts: 2
Joined: 03 Mar 2015, 02:25

CLI + libmediainfo.so on armv7l

Post by Duc »

Hi board, hi rednoah,

I use filebot 4.5.6 only in CLI on a Raspberry Pi 2. Since I use OpenElec (linux based), I cannot write on the /opt so I cannot use ipkg to install. I downloaded the .jar and a Java JRE. I can run filebot by hand with java -jar filebot.jar.

I would like to use the mediainfo lib with filebot to retrieve resolution and sound encoding from my files and rename them accordingly. I downloaded the libmediainfo.so that you provided for ARM7l. Filebot cannot find the library even if I specify the jna library path :

Code: Select all

myMachine:/ # /storage/downloads/dev/jdk1.8.0_33/bin/java -Djna.library.path=/storage/downloads/dev -jar /storage/downloads/dev/FileBot.jar -script fn:sysinfo
FileBot 4.5.6 (r2818)
JNA Native: 4.0.0
MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': Native library (linux-arm/libmediainfo.so) not found in resource path ([file:/storage/downloads/dev/FileBot.jar])
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
chromaprint-tools: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: DISABLED
Groovy Engine: 2.3.9
JRE: Java(TM) SE Runtime Environment 1.8.0_33 (headless)
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 4 Core / 179 MB Max Memory / 9 MB Used Memory
OS: Linux (arm)
uname: Linux heracles 3.18.8 #1 SMP Sat Feb 28 08:49:22 CET 2015 armv7l GNU/Linux
Done ?(?????)?
I tried to create a linux/arm folder in the dev folder and copy inside libmediainfo.so and also tried with libmediainfo.so directly in the same folder as filebot.jar. I'm not able to compile libmediainfo.so on this machine. Do you have any idea how I can fix this issue ?

Thanks in advance for your answer.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: CLI + libmediainfo.so on armv7l

Post by rednoah »

I don't recommend using the jar directly. Download the portable and look at filebot.sh how it's meant to be called. In filebot.sh you can also edit all the paths & config so it fits on your system. The portable filebot.sh should be configured in such a way so that you only have to copy the libraries into the filebot-portable folder.

That being said. You seem to have set it up correctly. Except it doesn't work. That means the library isn't compatible. The lower-level error messages are misleading and "not found" generally means "no compatible library has been found".
:idea: Please read the FAQ and How to Request Help.
Duc
Posts: 2
Joined: 03 Mar 2015, 02:25

Re: CLI + libmediainfo.so on armv7l

Post by Duc »

Thanks rednoah for your quick answer.

I restarted from scratch using the portable version of FileBot. I had a better output by setting my JAVA-HOME and PATH like this :

Code: Select all

export JAVA_HOME=/storage/downloads/dev/jdk1.8.0_33
export PATH=$JAVA_HOME/bin:$PATH
Now I'm able to launch .filebot.sh straight after the zip extraction, which is cleaner. The output from ./filebot.sh -script fn:sysinfo is now like this :

Code: Select all

# ./filebot.sh -script fn:sysinfo
FileBot 4.5.6 (r2818)
JNA Native: 4.0.0
MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': Native library (linux-arm/libmediainfo.so) not found in resource path ([file:/storage/downloads/dev/fp/FileBot.jar])
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
chromaprint-tools: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Groovy Engine: 2.3.9
JRE: Java(TM) SE Runtime Environment 1.8.0_33 (headless)
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 4 Core / 179 MB Max Memory / 9 MB Used Memory
OS: Linux (arm)
uname: Linux heracles 3.18.8 #1 SMP Sat Feb 28 08:49:22 CET 2015 armv7l GNU/Linux
Done ヾ(@⌒ー⌒@)ノ
I tried to copy libmediainfo in the portable folder or in a subfolder of the portable folder called linux-arm. No success...

The funny thing is that I have mediainfo running on this machine. I installed through the openelec addons (https://github.com/OpenELEC/unofficial- ... /mediainfo). This instance of mediainfo is based on the lib which is installed when you install mediainfo (https://github.com/OpenELEC/unofficial- ... bmediainfo).

I cannot find the libmediainfo.so on my system. I wonder if this is the way to follow : find the libmediainfo provided by Openelec instead of using the you provided. I think that the library provided on your repo in not compatible with my Rpi2. My problem now is to find this library on my system and I cannot understand how mediainfo work without libmediainfo.so in the file system (I tried find / | grep libmediainfo.so and found nothing).

Do you agree with my approach ? Do you have any input ?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: CLI + libmediainfo.so on armv7l

Post by rednoah »

The mediainfo binary does not require to load any libraries since it's all compiled into the binary. You could look into other programs that may ship with a compatible libmediainfo.so or compile it yourself.

The binary that I've cross-compiled with the spksrc toolchain for Synology NAS is probably only compatible with armv7hf.
:idea: Please read the FAQ and How to Request Help.
Post Reply