Using Filebot on DSM

Any questions? Need some help?
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: 19140
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: 19140
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: 19140
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: 19140
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: 19140
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: 19140
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: 19140
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: 19140
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: 19140
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: 19140
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 "[email protected]"
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: 19140
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: 19140
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
Post Reply