Using Filebot on DSM

Any questions? Need some help?
Post Reply
iha81
Posts: 2
Joined: 27 Mar 2012, 07:48

Using Filebot on DSM

Post by iha81 »

I would like to use and automate the use of Filebot on my Synology DS411J using cron. I still have not tested using filebot on DSM but I believe it will not work since there is no binary for the ARM architecture or am I missing something ?
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

FileBot runs on any platform that has Java SE 6 or higher. There should be Java implementations for Linux-ARM. How well that'll work I also don't know.

EDIT:
http://java.sun.com/javase/embedded/#FAQ

Maybe you can make it work with that Java 7 for Embedded. That should be enough to run the FileBot cmdline.
:idea: Please read the FAQ and How to Request Help.
iha81
Posts: 2
Joined: 27 Mar 2012, 07:48

Re: Using Filebot on DSM

Post by iha81 »

I will try this out once I get my hands on the NAS.
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Let me know how things are coming along. It would be cool if someone could write a tutorial on how to install Java on Linux/ARM and make FileBot run.
:idea: Please read the FAQ and How to Request Help.
melonboy
Posts: 19
Joined: 15 Apr 2012, 16:28

Re: Using Filebot on DSM

Post by melonboy »

I have installed java on my DS411J as I wanted to run YAMJ on it it.

I am willing to try and Filebot running if someone can help.
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Try to find out how to install Java SE for Linux/ARM for your device. Check the link above for packages for Java SE for Embedded.
:idea: Please read the FAQ and How to Request Help.
melonboy
Posts: 19
Joined: 15 Apr 2012, 16:28

Re: Using Filebot on DSM

Post by melonboy »

I have got java installed already and can execute the .jar file using:

./java -jar FileBot_2.61.jar -version

and have returned:

FileBot 2.61 (r965) / Java(TM) SE Runtime Environment 1.6.0_30 (headless)
melonboy
Posts: 19
Joined: 15 Apr 2012, 16:28

Re: Using Filebot on DSM

Post by melonboy »

OK, I am learning!

./java -jar FileBot_2.61.jar -rename /volume1/downloads --db thetvdb

Just need to work out how to get rid of the spaces and search sub folders
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Seems to be working fine. This is for subtitles:

Code: Select all

./java -jar FileBot.jar -get-missing-subtitles /volume1/downloads --lang en
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

For renaming folders and sub folders you can try this script:

Code: Select all

./java -jar FileBot.jar -script http://filebot.sf.net/scripts/renall.groovy /volume1/downloads --db thetvdb
:idea: Please read the FAQ and How to Request Help.
melonboy
Posts: 19
Joined: 15 Apr 2012, 16:28

Re: Using Filebot on DSM

Post by melonboy »

Great thanks, will check it out!
melonboy
Posts: 19
Joined: 15 Apr 2012, 16:28

Re: Using Filebot on DSM

Post by melonboy »

Looks like I can't use the groovy scripts.


renall.groovy /volume1/downloads --db thetvdb
FileNotFoundException: /usr/local/YAMJ/ejre1.6.0_30/bin/.jar
java.io.FileNotFoundException: /usr/local/YAMJ/ejre1.6.0_30/bin/.jar
at Script2$_run_closure15.doCall(Script2.groovy:22)
at Script2$_run_closure16_closure69.doCall(Script2.groovy:23)
at Script2$_run_closure16.doCall(Script2.groovy:23)
at Script2$_run_closure19.doCall(Script2.groovy:27)
at Script3.run(Script3.groovy:6)
at net.sourceforge.filebot.cli.ScriptShell$2.run(Unknown Source)
at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
at net.sourceforge.filebot.cli.ScriptShell.run(Unknown Source)
at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)
at net.sourceforge.filebot.Main.main(Unknown Source)
Failure (°_°)
melonboy
Posts: 19
Joined: 15 Apr 2012, 16:28

Re: Using Filebot on DSM

Post by melonboy »

Is there a way to scan sub folders from the CLI?
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Are you sure you didn't mess up the cmdline call somehow? Because Groovy seems do alot of things before an exception occurs.

If I run it with illegal arguments I get exactly the same stacktrace as you. So I'm pretty sure there's something wrong with the input.

Code: Select all

FileNotFoundException: X:\test
java.io.FileNotFoundException: X:\test
	at Script2$_run_closure15.doCall(Script2.groovy:22)
	at Script2$_run_closure16_closure69.doCall(Script2.groovy:23)
	at Script2$_run_closure16.doCall(Script2.groovy:23)
	at Script2$_run_closure19.doCall(Script2.groovy:27)
	at Script3.run(Script3.groovy:6)
	at net.sourceforge.filebot.cli.ScriptShell$2.run(Unknown Source)
	at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
	at net.sourceforge.filebot.cli.ScriptShell.run(Unknown Source)
	at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)
	at net.sourceforge.filebot.Main.main(Unknown Source)
:idea: Please read the FAQ and How to Request Help.
melonboy
Posts: 19
Joined: 15 Apr 2012, 16:28

Re: Using Filebot on DSM

Post by melonboy »

Indeed you are right, I screwed up somewhere, now it's fine :-)

Code: Select all

DSMOJO> ./java -jar FileBot_2.61.jar -script http://filebot.sf.net/scripts/renall.groovy /volume1/TVSeries/Rescue.Me/ --db thetvdb -non-strict
Rename episodes using [TheTVDB]
Auto-detected query: [Rescue Me]
Fetching episode data for [Rescue Me]
Fetching episode data for [Rescue Me (2002)]
Skipped [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x01 - Baptism.avi] because [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x01 - Baptism.avi] already exists
Skipped [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x02 - French.avi] because [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x02 - French.avi] already exists
Skipped [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x04 - Jimmy.avi] because [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x04 - Jimmy.avi] already exists
Skipped [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x05 - Sheila.avi] because [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x05 - Sheila.avi] already exists
Skipped [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x07 - Play.avi] because [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x07 - Play.avi] already exists
Skipped [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x08 - Iceman.avi] because [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x08 - Iceman.avi] already exists
Skipped [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x10 - Control.avi] because [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x10 - Control.avi] already exists
Skipped [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x11 - Mickey.avi] because [/volume1/TVSeries/Rescue.Me/Season5/Rescue Me - 5x11 - Mickey.avi] already exists
Renamed 8 files
Rename episodes using [TheTVDB]
Auto-detected query: [Rescue Me]
Fetching episode data for [Rescue Me]
Fetching episode data for [Rescue Me (2002)]
[MOVE] Renamed [/volume1/TVSeries/Rescue.Me/Season6/Rescue.Me.S06E01_Legacy.mkv] to [Rescue Me - 6x01 - Legacy.mkv]
[MOVE] Renamed [/volume1/TVSeries/Rescue.Me/Season6/Rescue.Me.S06E02_Change.mkv] to [Rescue Me - 6x02 - Change.mkv]
[MOVE] Renamed [/volume1/TVSeries/Rescue.Me/Season6/Rescue.Me.S06E03_Comeback.mkv] to [Rescue Me - 6x03 - Comeback.mkv]
[MOVE] Renamed [/volume1/TVSeries/Rescue.Me/Season6/Rescue.Me.S06E04_Breakout.mkv] to [Rescue Me - 6x04 - Breakout.mkv]
[MOVE] Renamed [/volume1/TVSeries/Rescue.Me/Season6/Rescue.Me.S06E05_Blackout.mkv] to [Rescue Me - 6x05 - Blackout.mkv]
[MOVE] Renamed [/volume1/TVSeries/Rescue.Me/Season6/Rescue.Me.S06E06_Sanctuary.mkv] to [Rescue Me - 6x06 - Sanctuary.mkv]
[MOVE] Renamed [/volume1/TVSeries/Rescue.Me/Season6/Rescue.Me.S06E07_Forgiven.mkv] to [Rescue Me - 6x07 - Forgiven.mkv]
[MOVE] Renamed [/volume1/TVSeries/Rescue.Me/Season6/Rescue.Me.S06E08_Cowboy.mkv] to [Rescue Me - 6x08 - Cowboy.mkv]
[MOVE] Renamed [/volume1/TVSeries/Rescue.Me/Season6/Rescue.Me.S06E09_Goodbye.mkv] to [Rescue Me - 6x09 - Goodbye.mkv]
[MOVE] Renamed [/volume1/TVSeries/Rescue.Me/Season6/Rescue.Me.S06E10_A.D.D..mkv] to [Rescue Me - 6x10 - A.D.D..mkv]
Renamed 10 files
Done ã¾(ï¼ âã¼âï¼ )ã
DSMOJO>
Eterimos
Posts: 11
Joined: 29 Apr 2012, 08:10

Re: Using Filebot on DSM

Post by Eterimos »

have you also been able to get mediainfo to work?

I have downloaded the FIleBot JAR and Embedded Java and it's working fine. But I require media information as well.

I'm using a DS411Slim with ARM5 processor.
I have not found a MediaInfo.dll that was compiled for ARM. I tried compiling it myself but have not been successful so far.
In general will FileBot use the MediaInfo.dll if it is compiled correctly and placed in the same folder like FileBot.jar?
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Yep, FileBot will just use the lib if it's on the same folder, but I have no idea what Java Native Access will do on an ARM system, if it can access/load libs compiled for ARM.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Checked what native libs JNA packages to dynamically access native code.

This is what I got:
darwin
freebsd-amd64
freebsd-i386
linux-amd64
linux-i386
sunos-amd64
sunos-sparc
sunos-sparcv9
sunos-x86
win32-amd64
win32-x86

No support for ARM right now it seems :(
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Actually the latest JNA package support linux-arm as well. So if manage to build libmediainfo.so and libzen.so for linux-arm I can give you a test build that should be able to load it.
: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 »

Great!
I have been able to build libmediainfo.so and libzen.so on the DS. I have also compiled mediainfo and tested it.. It shows me the media info with a sample MKV.
Now I have tried to run FileBot using them (placed both files in the same folder as FileBot.jar) and as expected it failed with WARNING: Failed to preload libzen
I have downloaded the 3.4.0 jna.jar and built a new FileBot.jar using it but I get the same warning and no media info is used while renaming.

I would like to try your test build..
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Actually that is what I would have done...

1. Get this jar: https://github.com/twall/jna/blob/master/dist/jna.jar
2. Replace filebot/lib/jna.jar with that
3. Package using ant fatjar

Uploaded the new fatjar here: http://sourceforge.net/projects/filebot ... ebot/HEAD/

On Win/Linux/Mac it would usually work without a hitch if there is no problem with looking up the .so files. Maybe that's the problem? Try specifying jna.library.path like I do in the Linux startup script here.
http://filebot.svn.sourceforge.net/view ... filebot.sh

EDIT: Does DSM use ipkg or opkg? If we manage to get this working I can add a another package to my build so people on DSM can just do something like opkg -install filebot and get everything set up.
: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 »

Sorry for the delay, I haven't had the time to look into this further.

It is working now. I had to specify the jna.library.path as you said.
These are all the steps I followed if anybody is interested:

Installed Oracle Java from ejre-7u4-fcs-b20-linux-arm-sflt-headless-12_apr_2012.tar
Installed your patched FileBot.jar to /usr/share/filebot

Tested FileBot .. working fine except MediaInfo -> shows Warning libzen not found

I had to follow step 4 as described on this page http://www.synology-forum.de/showthread ... =mediainfo to fix my Synology's automake. It may be optional! You can try without this first.

Code: Select all

# Create a directory for the source files and link it to root:
mkdir /volume1/src
ln -s /volume1/src /src
cd /src

# Download and extract Tarball
wget ftp://ftp.gnu.org/gnu/automake/automake-1.11.1.tar.bz2
tar xvjf automake-1.11.1.tar.bz2 

# build automake
cd automake-1.11.1
./configure --prefix=/opt
make
ipkg -force-depends remove automake
make install
Then I was able to compile MediaInfoLib and ZenLib:

Code: Select all

cd /src
wget http://downloads.sourceforge.net/mediainfo/MediaInfo_DLL_0.7.57_GNU_FromSource.tar.bz2
tar -xjvf MediaInfo_DLL_0.7.57_GNU_FromSource.tar.bz2
cd MediaInfo_DLL_GNU_FromSource
./SO_Compile.sh
this creates /src/MediaInfo_DLL_GNU_FromSource/MediaInfoLib/Project/GNU/Library/.libs/libmediainfo.so

Code: Select all

cd /src/MediaInfo_DLL_GNU_FromSource/ZenLib/Project/GNU/Library/
./configure -enable-shared
make clean
make
this creates /src/MediaInfo_DLL_GNU_FromSource/ZenLib/Project/GNU/Library/.libs/libzen.so
(my Linux knowledge is very limited.. there might be a way to compile both at the same time)

then I copied libmediainfo.so and libzen.so to /usr/share/filebot

I adjusted the filebot.sh:

Code: Select all

/opt/ejre1.7.0_04/bin/java -Dunixfs=false -Xmx256m -Djna.library.path=/usr/share/filebot -Djava.library.path=/usr/share/filebot -jar /usr/share/filebot/FileBot.jar "$@"
Now it works using the following command:

Code: Select all

/usr/share/filebot/filebot.sh --action test -rename /volume1/video/Movies/_____________.2012.720p.BluRay.x264-AMIABLE.mkv --db imdb -non-strict --format "{n.space('.
')}.{y}.{def h = video.height as int; h > 720 ? 1080 : h > 480 ? 720 : 480}p.{source}.{vc}-{group}"

Rename movies using [IMDb]
Looking up movie by filehash via [IMDb]
IMDb: Hash lookup not supported
Auto-detect movie from context: [/volume1/video/Movies/_____________.2012.720p.BluRay.x264-AMIABLE.mkv]
[TEST] Rename [/volume1/video/Movies/_____________.2012.720p.BluRay.x264-AMIABLE.mkv] to [_____________.2012.720p.BluRay.x264-AMiABLE.mkv]
Processed 1 files
Done ?(?????)?
(My sample already has my preferred format.. it shows that mediainfo obtains the same information! I replaced the actual movie name with ___)

I am using ipkg on the Synology DS. I'm not sure if ipkg is possible. It would be very cool to automatically install / update it from there!
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Please send me the native libs you compiled and the paths where apps should be installed. I'll try to build you an ipkg package that works out of the box. Will need your help with testing on this. ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Thanks for your help! Added the ipkg/arm package to the website.

Now you can just do that to get the latest version:

Code: Select all

ipkg install "http://sourceforge.net/projects/filebot/files/filebot/FileBot_2.62/filebot_2.62_arm.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:Thanks for your help! Added the ipkg/arm package to the website.

Now you can just do that to get the latest version:

Code: Select all

ipkg install "http://sourceforge.net/projects/filebot/files/filebot/FileBot_2.62/filebot_2.62_arm.ipk"
I tried this, got the following error:

Code: Select all

ipkg install "http://sourceforge.net/projects/filebot/files/filebot/File
Bot_2.62/filebot_2.62_arm.ipk"
Downloading http://sourceforge.net/projects/filebot/files/filebot/FileBot_2.62/filebot_2.62_arm.ipk
Clearing state_want and state_flag for pkg=filebot (arch_priority=0 flag=16 want=2)
Nothing to be done
An error ocurred, return value: 4.
Collected errors:
Cannot find package filebot.
Check the spelling or perhaps run 'ipkg update'
System:
Synology 712+
DSM 4.0-2219
User avatar
rednoah
The Source
Posts: 24646
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: 24646
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: 24646
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: 24646
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: 24646
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: 24646
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

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: 24646
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: 24646
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: 24646
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: 24646
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: 24646
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: 24646
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: 24646
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.
aka4ajax
Posts: 3
Joined: 06 Dec 2012, 14:10

Re: Using Filebot on DSM

Post by aka4ajax »

Hello Everyone and great to be part of the forum finally, after monitoring it for some time from the wings.

Now i am a real novice and thats the reason i have held back from joining the forum, as i did not want to embarrass my self too much. Well now I have had some limited success with Filebot and my DiskStation running DSM 4.1.1.
The packages i am running which i got from MissileHugger.com are:
FileBot 3.1-1
YAMj 2.7-2
Java 1.7.0_06-1 SE Embedded
MediaInfo 0.7.6-1
Web console 0.2.6.2 installed

I use web console to run the script, which to be honest I am not sure what I am doing, but i did get it to change the names of 90% of my 2000 movie folders, which was one of the main things i wanted to achieve.

I would like to know more now and how i actually did this and why it did not accept some of the files, ISO and DVD rips.
But what i would like to start with is getting FileBot to run a script across my whole collection and supply the correct name, artwork and information to allow YAMJ to create a movie wall.

So if anyone is willing to hold my hand and educate me i would be very grateful.

My movies around 2000 are on /volume1/video/Movies/
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

First of all learn how to login via ssh so you can play with the cmdline. Also depends a bit of how well the movies are already named, if it's bad it'll be ignored, if it's bad and misleading there could be mismatches as well. ISO files are simply ignored, but you can have FileBot extract all those so you have VIDEO_TS folders which FileBot will handle as expected.

For all the extra tasks you can play with the shared scripts.

Watch this:
http://www.youtube.com/watch?v=brGyo2uQzSs

If you're using utorrent-postprocess and know that you're only processing videos adding --def ut_label=movie will speed things up since it'll skip movie/episode detection.

PS: FileBot is not using the cmdline mediainfo tool, it access the native C library directly (nobody managed to compile it and make it work on ATOM yet though).
:idea: Please read the FAQ and How to Request Help.
aka4ajax
Posts: 3
Joined: 06 Dec 2012, 14:10

Re: Using Filebot on DSM

Post by aka4ajax »

Many thanks for your quick response;

The reason i am using Web Console and not ssh is i am connecting remotely via the DiskStation GUI as I am working in Asia and the Diskstation is in the UK.

I will watch the youtube video and come back to you, thanks again.
aka4ajax
Posts: 3
Joined: 06 Dec 2012, 14:10

Re: Using Filebot on DSM

Post by aka4ajax »

Ok i just figured out the best way forward for me, after watching your video on Youtube.
Do you think this will work, log into a pc on my network using "remote desktop" and run the command line from there.
I will have to download filebot onto that machine first and run the scripts.

Is that right?
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Yep, just install the .msi and it should work right out of the box. Just setup your testdata and play with it.
: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 »

spent the last few days trying to compile mediainfo.
but no luck yet :(
rednoah wrote: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()
Ok, looks like here´s a problem to:

Code: Select all

MissingPropertyException: No such property: main for class: com.sun.jna.Native
groovy.lang.MissingPropertyException: No such property: main for class: com.sun.jna.Native
	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 (?_?)
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

I guess the () mess with the command, maybe on linux it has to be filebot -script "g:com.sun.jna.Native.main()". Anyway, if you run -script fn:sysinfo and you get JNA Native: 3.5.0 then JNA works.
:idea: Please read the FAQ and How to Request Help.
sbarnea
Posts: 16
Joined: 04 May 2014, 21:06

Re: Using Filebot on DSM

Post by sbarnea »

two years later and I find the same problem on DSM 5 (Synology) running on 214+.

For this NAS there is no bootstrap yet and based on the number of architectures I doubt I will see MediaInfo in it too soon.

I guess the best be to ignore this and in the longer run to switch to a JAVA only implementation, lot lower the number of external dependencies, which are prone to break.
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Yeah, but porting things like 7zip and MediaInfo into pure Java code would be a humongous tasks and impossible to maintain.

I know for a fact though that it works on the DS214j (armv7) ;)

Code: Select all

[admin@DiskStation /volume1]$ filebot -script fn:sysinfo
FileBot 4.1 (r2245)
JNA Native: 4.0.0
MediaInfo: MediaInfoLib - v0.7.64
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
chromaprint-tools: fpcalc version 1.1.0 (/volume1/app/filebot/fpcalc)
Extended Attributes: OK
Groovy Engine: 2.3.2
JRE: Java(TM) SE Runtime Environment 1.8.0 (headless)
JVM: 32-bit Java HotSpot(TM) Client VM
OS: Linux (arm)
uname: Linux DiskStation 3.2.40 #4482 Fri Apr 18 16:53:08 CST 2014 armv7l GNU/Linux synology_armada370_213j
Done ヾ(@⌒ー⌒@)ノ
:idea: Please read the FAQ and How to Request Help.
Brailyn
Posts: 7
Joined: 17 Jun 2015, 02:17

Re: Using Filebot on DSM

Post by Brailyn »

I too have the DS 214+ and am curious if it is possible to get libmediainfo working on the latest DSM 5.2?

If it is, can someone post a bit of an instruction?
User avatar
rednoah
The Source
Posts: 24646
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Filebot on DSM

Post by rednoah »

Install FileBot & MediaInfo via package sources and it should work out-of-the-box. If not, where's the logs?

@see viewtopic.php?f=3&t=1802
:idea: Please read the FAQ and How to Request Help.
Brailyn
Posts: 7
Joined: 17 Jun 2015, 02:17

Re: Using Filebot on DSM

Post by Brailyn »

Yep, again I was looking for the wrong thing. Didn't correlate that MediaInfo was for audio.

Running

Code: Select all

filebot -script fn:sysinfo
gives me,

Code: Select all

filebot -script fn:sysinfo
FileBot 4.6 (r3052)
JNA Native: 4.0.0
MediaInfo: MediaInfoLib - v0.7.73
p7zip: Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
chromaprint-tools: java.io.IOException: Cannot run program "/usr/local/chromaprint/bin/fpcalc": error=2, No such file or directory
Extended Attributes: OK
Groovy Engine: 2.4.3
JRE: Java(TM) SE Runtime Environment 1.8.0_33 (headless)
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 2 Core / 245 MB Max Memory / 15 MB Used Memory
OS: Linux (arm)
uname: Linux Nezura 3.2.40 #5565 SMP Mon Jun 8 16:45:49 CST 2015 armv7l GNU/Linux synology_armadaxp_ds214+
Done ヾ(@⌒ー⌒@)ノ

Nezura> filebot -script fn:sysinfo
Again, thanks for saving the day Rednoah:)
Post Reply