Need help installing CLI version on NAS

Support for HandBrake on Linux, Solaris, and other Unix-like platforms
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Deleted User 19828

Need help installing CLI version on NAS

Post by Deleted User 19828 » Sat May 15, 2010 10:32 am

Hi,

I am trying to install HandbrakeCLI on my Qnap NAS for overnight converting by using a cron job. Before I figure that out (I am not a Linux guru), I need to install Handbrake on the NAS first. I can use the package manager "ipkg" on the NAS, and used this to install the dependencies (as far as i know i have all now).

After running "./configure --launch --disable-gtk" I get some errors:

1. The error below, but I have searched this and shouldn't be a problem:

Code: Select all

find: xcodebuild...(fail) not found
find: lipo...(fail) not found


2. An error about CFLAGS

Code: Select all

  : liba52/Makefile.am: installing `autotools/depcomp'
  : liba52/Makefile.am:1: `CFLAGS' is a user variable, you should not override it;
  : liba52/Makefile.am:1: use `AM_CFLAGS' instead.
  : src/Makefile.am:1: `CFLAGS' is a user variable, you should not override it;
  : src/Makefile.am:1: use `AM_CFLAGS' instead.
3. With gawk syntax errors with symbols like "#", "%" and ".".

4. Eventually the message:

Code: Select all

  : config.status: error: could not create Makefile
  : make: *** [contrib/a52dec/.stamp.configure] Error 1
-------------------------------------------------------------------------------
time end: Sat May 15 12:17:11 2010
duration: 50 seconds (50.04s)
result: FAILURE (code 2)
A full dump of the process: http://pastebin.com/tLg79fm6


I have been trying for some time now but I think I really need help now. Thanks in advance!
Paul

User avatar
Rodeo
HandBrake Team
Posts: 12199
Joined: Tue Mar 03, 2009 8:55 pm

Re: Need help installing CLI version on NAS

Post by Rodeo » Sat May 15, 2010 4:19 pm

paulvanleest wrote:1. The error below, but I have searched this and shouldn't be a problem:

Code: Select all

find: xcodebuild...(fail) not found
find: lipo...(fail) not found
Hmm, seems like the build system thinks your NAS is an OS X machine (i.e. it's looking for OS X dependencies).

Edit 2: Hmm, looking at the build log this indeed isn't a problem, the configure step isn't failing.

Anyway, why don't you just post the full build log? (hb-trunk/build/log/build.txt) Edit: sorry missed the link

Deleted User 19828

Re: Need help installing CLI version on NAS

Post by Deleted User 19828 » Sat May 15, 2010 8:32 pm

Thank you for your reply. At least I have confirmation not to try and fix that error ;-)

Just for sure, you can view the full build.txt file here: http://pastebin.com/pVBwjwVR

tlindgren
Bright Spark User
Posts: 237
Joined: Sun May 03, 2009 2:14 pm

Re: Need help installing CLI version on NAS

Post by tlindgren » Sun May 16, 2010 2:41 pm

paulvanleest wrote:I am trying to install HandbrakeCLI on my Qnap NAS for overnight converting by using a cron job. Before I figure that out (I am not a Linux guru), I need to install Handbrake on the NAS first. I can use the package manager "ipkg" on the NAS, and used this to install the dependencies (as far as i know i have all now).
I hope you realize that the CPU on that unit will be very slow by modern standards, depending on exact model it could easily be ten times or even 30-50 times slower than even a cheap quad-core machine!

Also, you're probably going to have to build every single serious dependency first, most probably doesn't exist for that NAS and those that do exist are too old. It might work in the end but it could also break your NAS if the NAS actually depended on anything that you had to upgrade.

Or the NAS could die from overheating you did manage to do this without breaking it during building, it's similar to those people who were trying to make it run on Apple TV, it was dog slow, the fans went to 100% and then it shut down due to overheating!

Deleted User 19828

Re: Need help installing CLI version on NAS

Post by Deleted User 19828 » Sun May 16, 2010 3:11 pm

Thank you for the warning, I am aware of the speed of my NAS and also that it is not made to serve this purpose.

I believe it's fast enough and if the system gets too hot it is protected against that, and I will just not use it for this anymore if this really becomes a problem.

Right now I just want to get it to work... any help would be greatly appreciated!

User avatar
s55
HandBrake Team
Posts: 9535
Joined: Sun Dec 24, 2006 1:05 pm

Re: Need help installing CLI version on NAS

Post by s55 » Sun May 16, 2010 6:47 pm

It's not a supported platform, so your pretty much on your own with it. From the looks of it, our build system isn't going to support that platform without some hacking.

hunterk
Bright Spark User
Posts: 179
Joined: Tue Jun 03, 2008 2:27 pm

Re: Need help installing CLI version on NAS

Post by hunterk » Mon May 17, 2010 2:05 am

if that's one of the Celeron-powered NAS, could you not use an x86 CLI binary compiled on another system, assuming the few dynamically linked libraries are up-to-date, rather than trying to build it directly on the NAS?

Deleted User 19828

Re: Need help installing CLI version on NAS

Post by Deleted User 19828 » Tue May 18, 2010 7:43 am

hunterk wrote:if that's one of the Celeron-powered NAS, could you not use an x86 CLI binary compiled on another system, assuming the few dynamically linked libraries are up-to-date, rather than trying to build it directly on the NAS?
Thank you for the tip, I have seen a post of someone who managed to install handrake like that on my type of NAS. I took a compiled binary from the .deb downloaded from the Handbrake site.

I seem to have some older versions of glib...

Code: Select all

./HandBrakeCLI: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./HandBrakeCLI)
./HandBrakeCLI: /lib/libc.so.6: version `GLIBC_2.7' not found (required by ./HandBrakeCLI)
Now trying to get another compiled version, compiled under another, since Package glib (2.20.4-1) is installed in root and according to ipkg up to date.

micster
Posts: 6
Joined: Thu Oct 04, 2007 3:04 am

Re: Need help installing CLI version on NAS

Post by micster » Tue Dec 28, 2010 7:48 am

I am also interrested in doing this. There is a topic over on the Qnap Forum where somebody said they got this working by extracting the contents of a .DEB file for HanBrakeCLI. I attempted this, but most of the dependencies are in the wrong spot. Handbrake is looking for the lib files in "/usr/lib" and the Qnap puts them in "/opt/bin/" or something like that. I got several of them linked together with symbolic links (though I was still missing a few), but when I restarted the Qnap NAS they were removed. I think I remember something about adding something into your "$PATH variable" but it looked fine.
Last edited by micster on Tue Dec 28, 2010 11:53 am, edited 1 time in total.

micster
Posts: 6
Joined: Thu Oct 04, 2007 3:04 am

Re: Need help installing CLI version on NAS

Post by micster » Tue Dec 28, 2010 11:52 am

Okay I found this guide online and it says to

Code: Select all

svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
cd hb-trunk
./configure --launch --disable-gtk
Which I think is the same thing that Paul was doing up above.
I get the same warnings that looks like this:

Code: Select all

find: xcodebuild...(fail) not found
find: lipo...(fail) not found
If we ignore those as benign, everything seems to go fine until we get to the make part. The contents of the full build log (hb-trunk/build/log/build.txt) are as follows:

Code: Select all

launch: /opt/bin/make -j1
/opt/bin/m4 -Iproject ../libhb/project.h.m4 > libhb/project.h
set -e; cd ./contrib/a52dec/a52dec/; rm -fr aclocal.m4 autom4te.cache; autoreconf -fiv; CC=/opt/bin/gcc CFLAGS="" CXX=/opt/bin/g++ CXXFLAGS="" CPPFLAGS="" LDFLAGS="" ./configure --prefix=/share/MD0_DATA/Public/handbrake/hb-trunk/build/contrib/ --disable-dependency-tracking --disable-shared --enable-static
autoreconf: Entering directory `.'
autoreconf: configure.in: not using Gettext
autoreconf: running: aclocal  --output=aclocal.m4t
Can't exec "aclocal": No such file or directory at /opt/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory
make: *** [contrib/a52dec/.stamp.configure] Error 1
time end: Tue Dec 28 03:20:40 2010
duration: 1 seconds (1.22s)
result: FAILURE (code 2)
When autoreconf tries to call aclocal it fails and says No such file. I tried Googling this Warning and everything I found says "Do you have automake and autoconf installed?" Which I do:

Code: Select all

Package automake (1.11.1-1) installed in root is up to date.
Package autoconf (2.68-1) installed in root is up to date.
It seems like these scripts are just looking in the wrong spot for the files they need. Indeed, I searched for the file that it is complaining about missing and located it in the following location:

Code: Select all

/opt/bin/aclocal-1.11
If we could somehow just tell autoreconf where to look to find aclocal I think it might work. This is about as far as I know how to take this, so hopefully somebody will come along with some more knowledge and help out.

User avatar
Rodeo
HandBrake Team
Posts: 12199
Joined: Tue Mar 03, 2009 8:55 pm

Re: Need help installing CLI version on NAS

Post by Rodeo » Tue Dec 28, 2010 2:29 pm

micster wrote:I get the same warnings that looks like this:

Code: Select all

find: xcodebuild...(fail) not found
find: lipo...(fail) not found
These are only needed when building for/under Mac OS X. It's not your problem.

User avatar
JohnAStebbins
HandBrake Team
Posts: 5442
Joined: Sat Feb 09, 2008 7:21 pm

Re: Need help installing CLI version on NAS

Post by JohnAStebbins » Tue Dec 28, 2010 5:02 pm

Not much you can do with a broken autoconf. Pretty much everything depends on it working. Maybe you can write yourself a script that creates symbolic links to where it is looking so you can re-run the script whenever you want to build handbrake.

micster
Posts: 6
Joined: Thu Oct 04, 2007 3:04 am

Re: Need help installing CLI version on NAS

Post by micster » Tue Dec 28, 2010 8:46 pm

Thanks guys for the heads up.

Is there a way to tell where it's looking for aclocal at? So I can try creating a symbolic link to it? I was reading that Autoreconf loads a file called aclocal.m4 to find where aclocal is located or something, I couldn't find that file though :(

In the error message there is this line:

Code: Select all

Can't exec "aclocal": No such file or directory at /opt/share/autoconf/Autom4te/FileUtils.pm line 326.
Which I was hoping would give me a clue on where it SHOULD be, but when I go to that line in the code it just says something like "Print and error message if we can't find a command."

Any more help anyone can give would be much appreciated.

User avatar
JohnAStebbins
HandBrake Team
Posts: 5442
Joined: Sat Feb 09, 2008 7:21 pm

Re: Need help installing CLI version on NAS

Post by JohnAStebbins » Tue Dec 28, 2010 10:09 pm

I think the error message here is misleading. autoreconf isn't failing to find aclocal. Rather, aclocal is failing to find FileUtils.pm in the expected place. So you need to find that and link to it from /opt/share/autoconf/Autom4te.

autoreconf creates aclocal.m4 by calling the aclocal pearl script (located in /usr/bin on my system). This script is failing to find the above file and exits with an error.

micster
Posts: 6
Joined: Thu Oct 04, 2007 3:04 am

Re: Need help installing CLI version on NAS

Post by micster » Wed Dec 29, 2010 6:00 am

Okay I made some progress. I was having a separate problem and another user named "micke" told me he never builds on the NAS, he has a separate Linux system that he uses and builds on that. The key it seems is using the Debian distribution Etch which is comparable to what is installed on the Qnap NAS (it uses the same libraries and such).

Step 1.
Do a google search for debian-40r7-i386-DVD-1.iso I found it here and here. There seems to be three DVDs in total, but I only needed the first.

Step 2.
Install Debian Etch on an alternate system. I found it was easiest to use VirtualBox and just install it onto my main Windows machine. The setup is pretty straight forward, with one tricky part... When asked if you want to use a Fixed Size disk or a Flexible Size disk, choose Fixed. I tried flexible and it got stuck, so just set aside a few GB for the Debian installation and use the fixed size.

Step 3.
Install the missing dependencies. I followed the instructions found on the HandBrake website about compiling for Linux. At the moment that website seems to be down, but if you use google you can view the cached version. I recommend only trying to install what is needed for the Command-Line version of Handbrake because it has less dependencies.

Code: Select all

su root
apt-get install subversion build-essential autoconf automake make libtool zlib1g-dev libbz2-dev
You also need YASM which I couldn't find via apt-get, you might have better luck though. I got it working by installing it from source.

Step 4.
Create a folder on your newly acquired Debian box to work out of, I called mine Handbrake. Then download and build HandBrake from the svn repository:

Code: Select all

mkdir HandBrake
cd HandBrake
svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
cd hb-trunk
./configure --launch --disable-gtk
This step took a while, but once finished navigate into the folder called "build" and there should be a HandBrakeCLI executable in there. When running the above step make sure you are not getting any more errors. I was missing "make" the first time I tried.

Step 5.
The final thing to do is copy the HandBrakeCLI that we just built onto your Qnap NAS. I accomplished this by emailing the file to myself using GMail from within the Debian Box. Maybe you know a better way to transfer files across Operating Systems?

I still have some more testing to do, but after copying the HandBrakeCLI file to my NAS I was able to run it without getting warnings:

Code: Select all

[/share/Public/handbrake/hb-trunk/build] # ./HandBrakeCLI -u
[21:36:11] hb_init: checking for updates
[21:36:11] Using http://handbrake.fr/appcast_unstable.xml
[21:36:11] latest: 0.9.4, build 2009112300
[21:36:11] hb_init: checking cpu count
[21:36:11] hb_init: starting libhb thread
HandBrake svn3717 (2010122801) - Linux i686 - http://handbrake.fr
Your version of HandBrake is up to date.
I haven't tried to actually transcode anything yet, but I will update this post with the results soon.

Post Reply