Board index Help and Support Using Filebot on DSM

Using Filebot on DSM

Any questions? Need some help?

Post 27 Mar 2012, 07:51

Posts: 2
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 ?

Post 27 Mar 2012, 08:16
rednoah User avatar
The Source

Posts: 2072
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 27 Mar 2012, 08:40

Posts: 2
I will try this out once I get my hands on the NAS.

Post 30 Mar 2012, 05:27
rednoah User avatar
The Source

Posts: 2072
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 15 Apr 2012, 16:35

Posts: 19
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.

Post 15 Apr 2012, 16:46
rednoah User avatar
The Source

Posts: 2072
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 15 Apr 2012, 17:03

Posts: 19
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)

Post 15 Apr 2012, 17:30

Posts: 19
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

Post 16 Apr 2012, 00:56
rednoah User avatar
The Source

Posts: 2072
Location: 北京

Seems to be working fine. This is for subtitles:
./java -jar FileBot.jar -get-missing-subtitles /volume1/downloads --lang en
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 16 Apr 2012, 01:02
rednoah User avatar
The Source

Posts: 2072
Location: 北京

For renaming folders and sub folders you can try this script:
./java -jar FileBot.jar -script http://filebot.sf.net/scripts/renall.groovy /volume1/downloads --db thetvdb
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 16 Apr 2012, 10:48

Posts: 19
Great thanks, will check it out!

Post 16 Apr 2012, 11:01

Posts: 19
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 (°_°)

Post 16 Apr 2012, 11:05

Posts: 19
Is there a way to scan sub folders from the CLI?

Post 16 Apr 2012, 11:21
rednoah User avatar
The Source

Posts: 2072
Location: 北京

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.
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)
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 16 Apr 2012, 11:43

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

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>

Post 01 May 2012, 13:48

Posts: 11
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?

Post 01 May 2012, 15:34
rednoah User avatar
The Source

Posts: 2072
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 02 May 2012, 02:23
rednoah User avatar
The Source

Posts: 2072
Location: 北京

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 :(
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 02 May 2012, 12:36
rednoah User avatar
The Source

Posts: 2072
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 02 May 2012, 18:53

Posts: 11
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..

Post 03 May 2012, 00:56
rednoah User avatar
The Source

Posts: 2072
Location: 北京

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.
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 06 May 2012, 11:06

Posts: 11
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.html?21316-Installation-mkvtoolnix-auf-DS-211/page2&highlight=mediainfo to fix my Synology's automake. It may be optional! You can try without this first.

# 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:
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

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:
/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:

/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!

Post 06 May 2012, 11:28
rednoah User avatar
The Source

Posts: 2072
Location: 北京

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. ;)
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 08 May 2012, 01:38
rednoah User avatar
The Source

Posts: 2072
Location: 北京

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

Now you can just do that to get the latest version:
ipkg install "http://sourceforge.net/projects/filebot/files/filebot/FileBot_2.62/filebot_2.62_arm.ipk"
FileBot is free software. Please help support FileBot by writing a review or considering a donation.
Image

Post 13 May 2012, 10:04

Posts: 5
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:
ipkg install "http://sourceforge.net/projects/filebot/files/filebot/FileBot_2.62/filebot_2.62_arm.ipk"


I tried this, got the following error:

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

Next

Return to Help and Support