[SYNOLOGY ATOM] How To Correctly Install FileBot+MediaInfo

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
AnGeL
Posts: 11
Joined: 25 Mar 2014, 23:31

[SYNOLOGY ATOM] How To Correctly Install FileBot+MediaInfo

Post by AnGeL »

Hello to everyone!
That's my first post here on the forum.

I've spend quite some time searching for a simple way to use all the power of Filebot... i admit that at first i had some trouble with longy command lines and dependencies, but in the end i've made it!
I've installed FileBot 4.0 + LibMediaInfo + LibZen + 7zip native library + fpcalc on my Synology Nas (DS214play, DSM 4.0 final).

For your interest, the arch is i686, codenamed "evansport"... But that should be the same, the only requirement is to have the ipk file for your arch.

This tutorial will fix the nasty "error 1 returned code" while installing using the ipkg utility (synology uses a strange path for its optware binaries... so we have to fix them by hand)

I assume you already have a working java enviroment, if you dont have it you can download it from the package center (Java Embedded SE, from MissileHugger repo)


Do all the nasty things in a tmp dir... allocated on your volume, so it wont rape your flash zone

Code: Select all

cd /volume1/@tmp/
mkdir filebot
cd filebot
wget http://sourceforge.net/projects/filebot/files/filebot/FileBot_4.0/filebot_4.0_i686.ipk/download
This should wget the ipk file for you, now it's time to extract it:

Code: Select all

ar x filebot_4.0_i686.ipk
ls
if it's ok, you should see these files in your dir now:

Code: Select all

control.tar.gz  data.tar.gz  debian-binary  filebot_4.0_i686.ipk
Nice...

Now we will extract the real binaries...

Code: Select all

tar xzvf data.tar.gz
and put them in place

Code: Select all

cd opt/usr/share/filebot/
mkdir /opt/share/filebot/
mv * /opt/share/filebot/
cd /opt/share/filebot/bin
mv filebot.sh /opt/bin/filebot
chmod +x /opt/bin/filebot
now we have to edit the /opt/bin/filebot with the path adjustment we made...
feel free to use any editor, i prefer nano. The resulting file will contain these lines:

Code: Select all

#!/bin/sh
java -Dunixfs=false -DuseExtendedFileAttributes=false -DuseCreationDate=false -Dfile.encoding=UTF-8 -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dapplication.deployment=ipkg -Dapplication.analytics=true -Duser.home=/opt/share/filebot/data -Dapplication.dir=/opt/share/filebot/data -Djava.io.tmpdir=/opt/share/filebot/data/temp -Djna.library.path=/opt/share/filebot -Djava.library.path=/opt/share/filebot -Dnet.sourceforge.filebot.AcoustID.fpcalc=/opt/share/filebot/fpcalc -jar /opt/share/filebot/FileBot.jar "$@"
Now save everything and test filebot with:

Code: Select all

filebot -script fn:sysinfo
The results should be pretty as:

Code: Select all

Mar 26, 2014 12:21:47 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
FileBot 4.0 (r2056)
JNA Native: 4.0.0
MediaInfo: MediaInfoLib - v0.7.64
7-Zip-JBinding: OK
chromaprint-tools: fpcalc version 1.1.0 (/opt/share/filebot/fpcalc)
Extended Attributes: DISABLED
Groovy Engine: 2.2.0
Java(TM) SE Embedded Runtime Environment 1.8.0 (headless)
32-bit Java HotSpot(TM) Embedded Client VM
Linux (i386)
Done ヾ(@⌒ー⌒@)ノ

Done! :)

Now clean the tmp dir with

PAY ATTENTION TO THIS COMMAND! THIS COULD RUIN YOUR DATA IF UNCORRECTLY TYPED!

Code: Select all

rm -fr /volume1/@tmp/filebot

I hope this will help someone... :)
Sorry for my english, im italian and i hope that everyone understood!
Have an happy renaming :P
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by rednoah »

Cool! Nice guide!

Can you tell why the ipkg doesn't work out of the box? Is there something I can fix in the ipkg package?
:idea: Please read the FAQ and How to Request Help.
AnGeL
Posts: 11
Joined: 25 Mar 2014, 23:31

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by AnGeL »

I think that the problem should be in the installations path of the binaries... And so the post install script (which should create a sym link to filebot.sh, but I'm not sure of this.. Please correct me if im wrong) fail to create a symlink in /opt/usr/bin... Which does not exists!
The right path is /opt/bin

Be sure to place filebot dir in /opt/share instead of /opt/usr/share (which does not exists)
And fix the paths in the filebot.sh (so Java do not complain about missing libmedianfo..)


I'll be happy to test the ipk for you!
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by rednoah »

Commited the changes for now. You can tested it a few months from now when I release the 4.1_RC packages.
:idea: Please read the FAQ and How to Request Help.
nbanbury
Posts: 3
Joined: 02 Apr 2014, 19:50

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by nbanbury »

Hi there

I have tried to follow these instructions, but when I get to this command

Code: Select all

ar x filebot_4.0_i686.ipk
I get the following error

Code: Select all

sh: ar: not found
Can you help? (I am a total noob so please be gentle!)
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by rednoah »

Not sure what you're doing, and what "ar" is supposed to mean, but you can read this:
http://www.filebot.net/forums/viewtopic.php?f=3&t=1479
:idea: Please read the FAQ and How to Request Help.
nbanbury
Posts: 3
Joined: 02 Apr 2014, 19:50

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by nbanbury »

Thanks. All I was was following the code from the OP to try to install filebot to my Synology NAS.

Seems I need more knowledge than I currently understand to get it going. Your link requires knowledge I don't have - e.g. is /bin/bash installed, etc.

Not to worry, I'll live without it, cheers.
User avatar
bonelifer
Power User
Posts: 81
Joined: 23 Mar 2013, 18:27

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by bonelifer »

"ar" should probably be "tar"
nbanbury
Posts: 3
Joined: 02 Apr 2014, 19:50

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by nbanbury »

That it should! But it's OK I think this is still too technical for me to get use out of. Appreciate your help though!
AnGeL
Posts: 11
Joined: 25 Mar 2014, 23:31

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by AnGeL »

"ar" is a tool which is part of binutils, it's useful to decompress archives... (not to be mistaken with tar)

(you should install binutils... so if you have a synology, just do: ipkg install binutils)
AnGeL
Posts: 11
Joined: 25 Mar 2014, 23:31

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by AnGeL »

For rednoah: and by the way.... the ipkg returns error 127 while installing in the "normal" way using ipkg install...
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by rednoah »

I don't maintain ipkg much. If you can figure out why it returns 127 I can fix it.
:idea: Please read the FAQ and How to Request Help.
AnGeL
Posts: 11
Joined: 25 Mar 2014, 23:31

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by AnGeL »

i've recently tested i686 Filebot 4.1 RC3 ipkg package...

It installs well but there are some path errors:
Package installs things in /opt/usr/share/filebot/

1) But filebot.sh contains java paths referring to "/opt/share/filebot" instead of "/opt/usr/share/filebot"
2) The simlink in postinstall is:

Code: Select all

ln -s -f /opt/share/filebot/bin/filebot.sh /opt/bin/filebot
but should be:

Code: Select all

ln -s -f /opt/usr/share/filebot/bin/filebot.sh /opt/bin/filebot


And the baby works ;)

let me know if you fix this ;)
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by rednoah »

Didn't someone have the same request the other way around? /opt/usr/share/filebot seems better to me, but isn't this again breaking things for other people? Is there a standard at all? Or variables? There's like zero specification on how the directory structure within an .ipkg should look like.


There will be lots of other issues as well since all paths are set to /opt/share and not /opt/usr/share. Check filebot.sh and correct the paths.

EDIT: Fixed and uploaded new packages to the RC3 folder.
:idea: Please read the FAQ and How to Request Help.
AnGeL
Posts: 11
Joined: 25 Mar 2014, 23:31

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by AnGeL »

honestly i've been around ipkg (first with a Netgear Stora, and now with DS214) and i dont know if there are right or wrong path to use... :roll: that's a good question
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by rednoah »

It's using /opt/share/filebot now and at least within my .ipkg package it's consistent now. :D
:idea: Please read the FAQ and How to Request Help.
AnGeL
Posts: 11
Joined: 25 Mar 2014, 23:31

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by AnGeL »

glad i've had the chance to help you with the development of this fantastic tool... My NAS it's magic now ;) :lol:
sbarnea
Posts: 16
Joined: 04 May 2014, 21:06

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by sbarnea »

Bug report: ipkg does not create a symlink to fpcalc inside /opt/bin/ -- it does create one for filebot but not for fpcalc. Due to this the tool will fail to run fpcalc when needed. Manually creating the symlink solves the problem.

Did this on Synology 214+
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by rednoah »

It's not supposed to. The filebot.sh passes in the absolute path to the executable:

Code: Select all

-Dnet.filebot.AcoustID.fpcalc=/opt/share/filebot/fpcalc
Did you just update the jar and not filebot.sh for the last major release? FileBot will default to just trying "fpcalc" if the full path isn't passed in.
:idea: Please read the FAQ and How to Request Help.
Pulpi
Posts: 22
Joined: 29 Aug 2014, 22:25

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by Pulpi »

Great guide, but the part with MediaInfo isn`t working for me :(

Any suggests to solve this? How you´ve done the symlink for fpcalc? It may work for mediainfo either
cf_junik
Posts: 2
Joined: 18 Jun 2014, 17:00

Re: [SYNOLOGY ATOM] How To Correctly Install FileBot+MediaIn

Post by cf_junik »

Great Guide, It help me to fix Filebot
Thank you
Post Reply