Using Filebot on DSM

Any questions? Need some help?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

I don't have a Synology NAS so I can't look into this myself.

Not sure what ipkg is doing. Looks like it's trying to lookup the "filebot" package from the repository instead of just installing what is in the package. Maybe there is something different with the usage of ipkg on your system?

eterimos run it like this on his Synology DS411slim and it should work like this:

Code: Select all

BStation> ipkg install http://sourceforge.net/projects/filebot/files/filebot/HEAD/filebot_2.62_arm.ipk
Downloading http://sourceforge.net/projects/filebot/files/filebot/HEAD/filebot_2.62_arm.ipk
Installing filebot (2.62) to root...
Configuring filebot
Successfully terminated.
BStation> ls /usr/share/filebot
FileBot.jar  bin  icon48.png  libmediainfo.so  libzen.so
BStation> ls /usr/share/filebot/bin/
filebot.sh
BStation> /usr/share/filebot/bin/filebot.sh
FileBot 2.62 (r0) / Java(TM) SE Runtime Environment for Embedded 1.7.0_04-ea (headless)
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Looks like this is a problem that can occure if the package and system arch doesn't match or something.

What is your system architecture? I've set the package to 'arm'. Maybe this command and clear things up:

Code: Select all

ipkg print_architecture
:idea: Please read the FAQ and How to Request Help.
Tfugl
Posts: 5
Joined: 13 May 2012, 09:59

Re: Using Filebot on DSM

Post by Tfugl »

rednoah wrote:Looks like this is a problem that can occure if the package and system arch doesn't match or something.

What is your system architecture? I've set the package to 'arm'. Maybe this command and clear things up:

Code: Select all

ipkg print_architecture
Thanks for your quick reply.

This could be the problem, trying to install ARM package on x86 architecture (Atom), here's the output for print_architecture:

Code: Select all

ipkg print_architecture
arch all 1
arch noarch 1
arch i686 10
Successfully terminated.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Atom should be the same as x86 right? Built you a package that bundles the linux-i386 native libs for mediainfo and 7zip.

Code: Select all

ipkg install "http://sourceforge.net/projects/filebot/files/filebot/HEAD/filebot_2.62_i686.ipk"
:idea: Please read the FAQ and How to Request Help.
Tfugl
Posts: 5
Joined: 13 May 2012, 09:59

Re: Using Filebot on DSM

Post by Tfugl »

rednoah wrote:Atom should be the same as x86 right? Built you a package that bundles the linux-i386 native libs for mediainfo and 7zip.

Code: Select all

ipkg install "http://sourceforge.net/projects/filebot/files/filebot/HEAD/filebot_2.62_i686.ipk"
Thank you very much, rednoah, succesful installation and execution on this Intel Atom D425 CPU.

The tricky part now is getting Java to work using 3rd-party packages. I had to specify the direct path to java in the generated filebot.sh file, but I'm guessing that has something to do with the local alias.

For reference, I used this guide http://pcloadletter.co.uk/2011/08/23/ja ... -synology/ to install Java 6 (7 doesn't work on Intel Atom apparently). It's a native package that looks for the embedded install file for Java in /volume1/public/ thus keeping Java available even after DSM upgrades.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

FileBot expects java to be in the PATH so the "java" command just works, otherwise you have to specify the whole path to the executable. Can you check if the native libs work as well? Not sure if it'll work on atom. Try this please?

Code: Select all

filebot -script "script:println net.sourceforge.filebot.mediainfo.MediaInfo.version()" -trust-script
:idea: Please read the FAQ and How to Request Help.
Tfugl
Posts: 5
Joined: 13 May 2012, 09:59

Re: Using Filebot on DSM

Post by Tfugl »

rednoah wrote:FileBot expects java to be in the PATH so the "java" command just works, otherwise you have to specify the whole path to the executable. Can you check if the native libs work as well? Not sure if it'll work on atom. Try this please?

Code: Select all

filebot -script "script:println net.sourceforge.filebot.mediainfo.MediaInfo.version()" -trust-script
Result of command:

Code: Select all

filebot -script "script:println net.sourceforge.filebot.mediainfo.MediaInfo.version()" -trust-script
May 14, 2012 9:53:25 AM net.sourceforge.filebot.mediainfo.MediaInfo <clinit>
WARNING: Failed to preload libzen
UnsatisfiedLinkError: Unable to load library 'mediainfo': libzen.so.0: cannot open shared object file: No such file or directory
java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': libzen.so.0: cannot open shared object file: No such file or directory
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:169)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:242)
        at com.sun.jna.Library$Handler.<init>(Library.java:140)
        at com.sun.jna.Native.loadLibrary(Native.java:368)
        at net.sourceforge.filebot.mediainfo.MediaInfoLibrary.<clinit>(Unknown Source)
        at net.sourceforge.filebot.mediainfo.MediaInfo.staticOption(Unknown Source)
        at net.sourceforge.filebot.mediainfo.MediaInfo.staticOption(Unknown Source)
        at net.sourceforge.filebot.mediainfo.MediaInfo.version(Unknown Source)
        at net.sourceforge.filebot.mediainfo.MediaInfo$version.call(Unknown Source)
        at Script3.run(Script3.groovy:1)
        at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
        at net.sourceforge.filebot.cli.ScriptShell.runScript(Unknown Source)
        at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)
        at net.sourceforge.filebot.Main.main(Unknown Source)
Failure (°_°)
By the way, I found that I had to add a couple of double-quotes ("") to the arguments inside the bash script, otherwise I would get this message:

Code: Select all

filebot -version
" is not a valid option
This is how filebot.sh looks now:

Code: Select all

#!/bin/bash
/volume1/@appstore/java6/jre/bin/java -Dunixfs=false -Dapplication.deployment=ipkg -Djna.library.path=/usr/share/filebot -Djava.library.path=/usr/share/filebot -jar /usr/share/filebot/FileBot.jar "$@" ""
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

That's wierd, that bash startup script work very well on various Linux distros. Not sure but maybe it's not called with bash but another shell that doesn't support "$@"?

MediaInfo and 7-Zip can't be loaded. Maybe the i386 .so can't be loaded on i686? Should work as far as I know. Maybe the library lookup path doesn't work. You could try putting the .so files where they will definitely be found. Maybe /usr/lib?

What's the output if you run this one?

Code: Select all

filebot -script "fn:sysinfo" -trust-script
:idea: Please read the FAQ and How to Request Help.
Tfugl
Posts: 5
Joined: 13 May 2012, 09:59

Re: Using Filebot on DSM

Post by Tfugl »

rednoah wrote:That's wierd, that bash startup script work very well on various Linux distros. Not sure but maybe it's not called with bash but another shell that doesn't support "$@"?

MediaInfo and 7-Zip can't be loaded. Maybe the i386 .so can't be loaded on i686? Should work as far as I know. Maybe the library lookup path doesn't work. You could try putting the .so files where they will definitely be found. Maybe /usr/lib?

What's the output if you run this one?

Code: Select all

filebot -script "fn:sysinfo" -trust-script
Output:

Code: Select all

filebot -script "fn:sysinfo" -trust-script
FileBot 2.62 (r0)
May 14, 2012 12:08:31 PM net.sourceforge.filebot.mediainfo.MediaInfo <clinit>
WARNING: Failed to preload libzen
MediaInfo: MediaInfoException: Unable to load 32-bit native library 'mediainfo'
7-Zip-JBinding: SevenZipNativeInitializationException: Failed to load 7z-JBinding: /usr/share/filebot/lib7-Zip-JBinding.so: /lib/libc.so.6: version `GLIBC_2.4' not found (required by /usr/share/filebot/lib7-Zip-JBinding.so)
Java(TM) SE Runtime Environment 1.6.0_32 (headless)
32-bit Java HotSpot(TM) Embedded Client VM
Linux (i386)
Done ã¾(ï¼ âã¼âï¼ )ã
Tried putting the .so files in /usr/lib - same result as before: libzen.so.0 no such file
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Alright, so it's definitely compatible with i386 but requires GLIBC_2.4. I guess libMediaInfo and lib7-Zip-JBinding both depend on GLIBC_2.4. Can't do anything about that. I read that Java 7 also requires GLIBC_2.4 and this is why it doesn't work yet. I'm sure a future update for the OS will fix this.

So you won't be able to use the features that depend on mediainfo or 7zip native code. Everything else should work fine though.
:idea: Please read the FAQ and How to Request Help.
Omertron
Power User
Posts: 9
Joined: 14 May 2012, 14:07

Re: Using Filebot on DSM

Post by Omertron »

If you have a Synology NAS, you really should take a look at http://missilehugger.com

He has created packages for Java, MediaInfo and even YAMJ that you can install/update from the DSM package manager.
MissileHugger
Posts: 2
Joined: 16 May 2012, 08:51
Contact:

Re: Using Filebot on DSM

Post by MissileHugger »

@rednoah: As a reply to you post on my blog:
It is possible to create a FileBot package, but how do you see this happening? FileBot is a command line program on Linux and everyone has its own way of using it.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Thought that might be the easiest way to install and keep filebot up to date. Even though people would use it through cmdline. Maybe doesn't make much sense.
:idea: Please read the FAQ and How to Request Help.
Omertron
Power User
Posts: 9
Joined: 14 May 2012, 14:07

Re: Using Filebot on DSM

Post by Omertron »

I think it could be done in a similar way to the way that mediainfo & java are done.

You don't "use" java like a GUI, it is installed as a useable program
Omertron
Power User
Posts: 9
Joined: 14 May 2012, 14:07

Re: Using Filebot on DSM

Post by Omertron »

Just to say that I have reached the same point as well, filebot runs well except for the mediainfo issue
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

arm should work. For i686 I just used the generic Linux native libs from their website. If someone could compile libmediainfo and libzen on their NAS specifically for GCLIB<2.4 then that should work.
:idea: Please read the FAQ and How to Request Help.
Omertron
Power User
Posts: 9
Joined: 14 May 2012, 14:07

Re: Using Filebot on DSM

Post by Omertron »

rednoah wrote:arm should work. For i686 I just used the generic Linux native libs from their website. If someone could compile libmediainfo and libzen on their NAS specifically for GCLIB<2.4 then that should work.
How would I go about doing that?

I tried compiling the shared libraries for mediainfo but failed with some rather obscure error.

To be honest,I'm about ready to give up. I've spent days trying to get this to work, and whilst it's very powerful, it's really overkill for what I want
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Maybe Eterimos could help. He seems to have managed to compile for ARM just fine (http://filebot.sourceforge.net/forums/v ... &t=98#p886).
:idea: Please read the FAQ and How to Request Help.
Eterimos
Posts: 11
Joined: 29 Apr 2012, 08:10

Re: Using Filebot on DSM

Post by Eterimos »

I have described how to compile it for ARM in my previous post.
If it does not work for you on ATOM, you could post the error message - maybe I had faced the same error before.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Has anyone been able to compile libmediainfo for ATOM?
:idea: Please read the FAQ and How to Request Help.
Scorp1on
Posts: 6
Joined: 03 Dec 2012, 13:32

Re: Using Filebot on DSM

Post by Scorp1on »

Hello everyone ;)

after recognizing that mediainfo didnt work for me, i found out that my Ds 1812+ is Atom based.
so i followed the instruktions of Eterimos and compiled mediainfo successfully :)

But its still not working for me thats what i get after

Code: Select all

filebot -script "fn:sysinfo" -trust-script

Code: Select all

FileBot 3.1 (r1296)
JNA Native: 3.5.0
Dec 4, 2012 1:53:13 PM net.sourceforge.filebot.mediainfo.MediaInfo <clinit>
WARNING: Failed to preload libzen
MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': /usr/share/filebot/libmediainfo.so: undefined symbol: __dso_handle
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: /usr/share/filebot/lib7-Zip-JBinding.so: /lib/libc.so.6: version `GLIBC_2.4' not found (required by /usr/share/filebot/lib7-Zip-JBinding.so)
Extended Attributes: java.lang.NoClassDefFoundError: Ljava/nio/file/attribute/BasicFileAttributeView;
groovy.lang.MissingPropertyException: No such property: net for class: Script3
Java(TM) SE Runtime Environment 1.6.0_34 (headless)
32-bit Java HotSpot(TM) Embedded Client VM
Linux (i386)
Done ヾ(@⌒ー⌒@)ノ
here is my compiled libzen.so and libmediainfo.so
http://dl.dropbox.com/u/19234898/libmedia%3Alibzen.zip
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Code: Select all

Unable to load library 'mediainfo': /usr/share/filebot/libmediainfo.so: undefined symbol: __dso_handle
Means there is something wrong with the compiled library. Though I wouldn't even know where to start in looking for the problem. Maybe you can ask in the mediainfo forums how to compile it for embedded systems like yours.

EDIT:
I found this here in section "1. Implicit loading/linking of shared objects" where they use g++ instead of ld to fix the problem. Not exactly sure on details and if it is in fact that same issue.
http://rachid.koucha.free.fr/tech_corne ... tests.html
:idea: Please read the FAQ and How to Request Help.
Scorp1on
Posts: 6
Joined: 03 Dec 2012, 13:32

Re: Using Filebot on DSM

Post by Scorp1on »

i´ve asked in the mediainfo forums, but no luck there. The Developer links to this thread :)
i will asked in the synology forums now, maybe someone over there could help me.

I don´t even know where i could used "shared objects". Im a totally new to this :oops:
guess i bougt the wrong Nas. Filebot without Mediainfo wont work for my purpose :(
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

You could give zenitram from mediainfo ssh access to your device so he can login and try of he can figure it out. Maybe offer a bounty or something. ;)

EDIT: Maybe this helps?
http://gcc.gnu.org/java/faq.html#4_7
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

FileBot is using JNA to access native C libs. Try this to make sure JNA is working and that it's an issue with libmediainfo.so issue.

Code: Select all

filebot -script g:com.sun.jna.Native.main()
:idea: Please read the FAQ and How to Request Help.
Post Reply