Page 1 of 3

Using Filebot on DSM

Posted: 27 Mar 2012, 07:51
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 ?

Re: Using Filebot on DSM

Posted: 27 Mar 2012, 08:16
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.

Re: Using Filebot on DSM

Posted: 27 Mar 2012, 08:40
by iha81
I will try this out once I get my hands on the NAS.

Re: Using Filebot on DSM

Posted: 30 Mar 2012, 05:27
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.

Re: Using Filebot on DSM

Posted: 15 Apr 2012, 16:35
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.

Re: Using Filebot on DSM

Posted: 15 Apr 2012, 16:46
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.

Re: Using Filebot on DSM

Posted: 15 Apr 2012, 17:03
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)

Re: Using Filebot on DSM

Posted: 15 Apr 2012, 17:30
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

Re: Using Filebot on DSM

Posted: 16 Apr 2012, 00:56
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

Re: Using Filebot on DSM

Posted: 16 Apr 2012, 01:02
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

Re: Using Filebot on DSM

Posted: 16 Apr 2012, 10:48
by melonboy
Great thanks, will check it out!

Re: Using Filebot on DSM

Posted: 16 Apr 2012, 11:01
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 (°_°)

Re: Using Filebot on DSM

Posted: 16 Apr 2012, 11:05
by melonboy
Is there a way to scan sub folders from the CLI?

Re: Using Filebot on DSM

Posted: 16 Apr 2012, 11:21
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)

Re: Using Filebot on DSM

Posted: 16 Apr 2012, 11:43
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>

Re: Using Filebot on DSM

Posted: 01 May 2012, 13:48
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?

Re: Using Filebot on DSM

Posted: 01 May 2012, 15:34
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.

Re: Using Filebot on DSM

Posted: 02 May 2012, 02:23
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 :(

Re: Using Filebot on DSM

Posted: 02 May 2012, 12:36
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.

Re: Using Filebot on DSM

Posted: 02 May 2012, 18:53
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..

Re: Using Filebot on DSM

Posted: 03 May 2012, 00:56
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.

Re: Using Filebot on DSM

Posted: 06 May 2012, 11:06
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!

Re: Using Filebot on DSM

Posted: 06 May 2012, 11:28
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. ;)

Re: Using Filebot on DSM

Posted: 08 May 2012, 01:38
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"

Re: Using Filebot on DSM

Posted: 13 May 2012, 10:04
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