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.
Please detail your question or problem in as much detail as possible:
I am trying to build HandBrake-1.0.1 on openSUSE Leap 42.2. I have installed all the missing packages I can find on the openSUSE repo sites including packman but I am still getting errors.
Hi and thanks for the info. The files I quote are the only ones in the HandBrake-1.0.1/build/log directory and nothing I can see relevant in /var/log. Where else should I look please?
I did keep the text output from the attempt to compile, a rather large file at 1.2MiB. I can put it in dropbox but with whom should I share?
Regards,
Budge
I can't reproduce your problem. I installed a fresh openSuse Leap 42.2 in a VM. Then installed all the necessary dependencies (all that are available in the opensuse repo anyway, more on this later).
Since openSuse does not supply lame or x264, I modified a file to make HandBrake build these rather than searching for some unofficial build of these for Suse. The file to modify is HandBrake/make/include/main.defs. Here's the diff after changing
Hi John,
Many thanks and noted. All a bit over my head but I shall try and repeat with a new 42.2 installation.
The applications that are not on the official openSUSE repo site, particularly the multimedia stuff are usually installed from Packman community repo site and I had done this before trying to build Handbrake. It is possible an issue crept in here.
I will stay with the offical installation and do what you did and see if I can get it right that way.
As you will have seen, I am not a coder so may need a bit of guidance if I get stuck.
Meanwhile, many thanks again,
Alastair.
This installs a collection of development related tools. I probably didn't need all of them, but it is a easy shortcut to get things going. You might want to just try doing that one thing on top of what you've already done and see if it changes behaviour.
Hi and many thanks. I ran the above command and that installed a good number of tools. Then ran make again and got one error concerning libxml2. Checked my installation and the devel package was missing so installed that and got a bit further but still getting an error. Last few lines of build process are as follows:-
-
Libraries have been installed in:
/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/lib64
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/mkdir -p '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/lib64/pkgconfig'
/usr/bin/install -c -m 644 src/libbluray.pc '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/lib64/pkgconfig'
/usr/bin/mkdir -p '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/include/libbluray'
/usr/bin/install -c -m 644 src/file/filesystem.h src/libbluray/bluray.h src/libbluray/bluray-version.h src/libbluray/keys.h src/libbluray/player_settings.h src/libbluray/bdnav/clpi_data.h src/libbluray/bdnav/meta_data.h src/libbluray/decoders/overlay.h src/util/log_control.h '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/include/libbluray'
make[2]: Leaving directory '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/libbluray/libbluray-0.9.3'
make[1]: Leaving directory '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/libbluray/libbluray-0.9.3'
touch contrib/libbluray/.stamp.install
/usr/bin/gcc -std=gnu99 -pipe -fmessage-length=0 -Wall -g0 -O3 -mfpmath=sse -msse2 -DUSE_LIBAV_AAC -D__LIBHB__ -DUSE_PTHREAD -DSYS_LINUX -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_X265 -DHAS_STRERROR_R -DARCH_X86_64 -I./libhb/ -I./contrib/include -I/usr/include/libxml2 -c ../libhb/audio_resample.c -o libhb/audio_resample.o
In file included from ../libhb/common.h:14:0,
from ../libhb/audio_resample.c:10:
../libhb/hb_dict.h:13:21: fatal error: jansson.h: No such file or directory
#include <jansson.h>
^
compilation terminated.
../libhb/module.rules:12: recipe for target 'libhb/audio_resample.o' failed
make: *** [libhb/audio_resample.o] Error 1
ibmserver2:/home/alastair/Downloads/HandBrake-1.0.1/build #
It is the fatal error that has lost me. Should I start over or try something else?
Thanks again for your help,
Budge
Hi John,
Installed this last bunch of tools and ran make. A very impressive process but not quite there it seems. My error this time is reported as follows:-
-
Libraries have been installed in:
/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/lib64
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/mkdir -p '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/lib64/pkgconfig'
/usr/bin/install -c -m 644 src/libbluray.pc '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/lib64/pkgconfig'
/usr/bin/mkdir -p '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/include/libbluray'
/usr/bin/install -c -m 644 src/file/filesystem.h src/libbluray/bluray.h src/libbluray/bluray-version.h src/libbluray/keys.h src/libbluray/player_settings.h src/libbluray/bdnav/clpi_data.h src/libbluray/bdnav/meta_data.h src/libbluray/decoders/overlay.h src/util/log_control.h '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/include/libbluray'
make[2]: Leaving directory '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/libbluray/libbluray-0.9.3'
make[1]: Leaving directory '/home/alastair/Downloads/HandBrake-1.0.1/build/contrib/libbluray/libbluray-0.9.3'
touch contrib/libbluray/.stamp.install
/usr/bin/gcc -std=gnu99 -pipe -fmessage-length=0 -Wall -g0 -O3 -mfpmath=sse -msse2 -DUSE_LIBAV_AAC -D__LIBHB__ -DUSE_PTHREAD -DSYS_LINUX -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_X265 -DHAS_STRERROR_R -DARCH_X86_64 -I./libhb/ -I./contrib/include -I/usr/include/libxml2 -c ../libhb/audio_resample.c -o libhb/audio_resample.o
/usr/bin/gcc -std=gnu99 -pipe -fmessage-length=0 -Wall -g0 -O3 -mfpmath=sse -msse2 -DUSE_LIBAV_AAC -D__LIBHB__ -DUSE_PTHREAD -DSYS_LINUX -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_X265 -DHAS_STRERROR_R -DARCH_X86_64 -I./libhb/ -I./contrib/include -I/usr/include/libxml2 -c ../libhb/opencl.c -o libhb/opencl.o
/usr/bin/gcc -std=gnu99 -pipe -fmessage-length=0 -Wall -g0 -O3 -mfpmath=sse -msse2 -DUSE_LIBAV_AAC -D__LIBHB__ -DUSE_PTHREAD -DSYS_LINUX -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_X265 -DHAS_STRERROR_R -DARCH_X86_64 -I./libhb/ -I./contrib/include -I/usr/include/libxml2 -c ../libhb/qsv_memory.c -o libhb/qsv_memory.o
/usr/bin/gcc -std=gnu99 -pipe -fmessage-length=0 -Wall -g0 -O3 -mfpmath=sse -msse2 -DUSE_LIBAV_AAC -D__LIBHB__ -DUSE_PTHREAD -DSYS_LINUX -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_X265 -DHAS_STRERROR_R -DARCH_X86_64 -I./libhb/ -I./contrib/include -I/usr/include/libxml2 -c ../libhb/encvorbis.c -o libhb/encvorbis.o
/usr/bin/gcc -std=gnu99 -pipe -fmessage-length=0 -Wall -g0 -O3 -mfpmath=sse -msse2 -DUSE_LIBAV_AAC -D__LIBHB__ -DUSE_PTHREAD -DSYS_LINUX -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_X265 -DHAS_STRERROR_R -DARCH_X86_64 -I./libhb/ -I./contrib/include -I/usr/include/libxml2 -c ../libhb/hb.c -o libhb/hb.o
In file included from ../libhb/hb.c:13:0:
../libhb/encx264.h:13:18: fatal error: x264.h: No such file or directory
#include "x264.h"
^
compilation terminated.
../libhb/module.rules:12: recipe for target 'libhb/hb.o' failed
make: *** [libhb/hb.o] Error 1
alastair@ibmserver2:~/Downloads/HandBrake-1.0.1/build>
In your hands once more.
Many many thanks for your help.
Budge
Since openSuse does not supply lame or x264, I modified a file to make HandBrake build these rather than searching for some unofficial build of these for Suse. The file to modify is HandBrake/make/include/main.defs. Here's the diff after changing
Do you know how to use a text editor? It's basically a matter of moving a couple of lines of code down below the "endif" in that file. You also mentioned you are using pacman? You should be able to find the necessary packages there if you don't want to modify the file. I don't know the exact package names, but would be something like libx264-devel and liblame-devel (sometimes they leave off the "lib" prefix).
Hi John,
Can use vi or vim and at first assumed that I was to insert your lines into the main.defs file but I couldn't work out where they went. I was looking for the relevant "if" to start the conditional statement to go with the endif. I think I see it now. As I said, not a coder.
So my first thoughts were correct just knowledge deficient.
I have found libx264-devel and installed from packman but not liblame-devel or lame-devel so I would like to use your code.
Here is last few lines of my edit of main.defs where I inserted your code after the last endif.
The example I posted is what's called a "diff". It shows what lines I moved by showing what was removed with '-' at the beginning of the line and where they were inserted with a '+' at the beginning of the line. So you weren't meant to copy that text literally. You just need to move the 2 lines that are preceded by '-' down to where the '+' signs indicate I moved them.
I feel I am making progress and possibly learning a bit. Thank you for being so patient but I still cannot fly solo. It seems to me modules libdvdnav and libbluray are included. Are these the same as ldvdnav and lbluray? BTW what language is all this?
Grateful for further guidance please when you have time.
Hi John,
Checked my installation and the libdvdnav-devel and libbluray-devel were missing. Added these and make ran without any errors. Then went to sudo make install which gave me :-
/usr/bin/cp ./HandBrakeCLI /usr/local/bin/HandBrakeCLI
make -C ./gtk/ prefix=/usr/local install
make[1]: Entering directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk'
Making install in src
make[2]: Entering directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk/src'
make[3]: Entering directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk/src'
/usr/bin/mkdir -p '/usr/local/bin'
/bin/sh ../libtool --mode=install /usr/bin/install -c ghb '/usr/local/bin'
libtool: install: /usr/bin/install -c ghb /usr/local/bin/ghb
for icon in hb-icon.svg ; do \
mkdir -p //usr/local/share/icons/hicolor/scalable/apps/; \
/usr/bin/install -c -m 644 /home/alastair/Downloads/HandBrake-1.0.1/build/../gtk/src/$icon //usr/local/share/icons/hicolor/scalable/apps/$icon; \
done
Updating Gtk icon cache.
gtk-update-icon-cache: Cache file created successfully.
mkdir -p //usr/local/share/applications/; \
/usr/bin/install -c -m 644 /home/alastair/Downloads/HandBrake-1.0.1/build/../gtk/src/ghb.desktop //usr/local/share/applications/ghb.desktop
make[3]: Leaving directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk/src'
make[2]: Leaving directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk/src'
Making install in po
make[2]: Entering directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk/po'
linguas="cs da de es fr it_IT ja_JP ko no pt_BR ro_RO ru th zh_CN "; \
for lang in $linguas; do \
dir=/usr/local/share/locale/$lang/LC_MESSAGES; \
/bin/sh /home/alastair/Downloads/HandBrake-1.0.1/gtk/install-sh -d $dir; \
if test -r $lang.gmo; then \
/usr/bin/install -c -m 644 $lang.gmo $dir/ghb.mo; \
echo "installing $lang.gmo as $dir/ghb.mo"; \
else \
/usr/bin/install -c -m 644 /home/alastair/Downloads/HandBrake-1.0.1/build/../gtk/po/$lang.gmo $dir/ghb.mo; \
echo "installing /home/alastair/Downloads/HandBrake-1.0.1/build/../gtk/po/$lang.gmo as" \
"$dir/ghb.mo"; \
fi; \
if test -r $lang.gmo.m; then \
/usr/bin/install -c -m 644 $lang.gmo.m $dir/ghb.mo.m; \
echo "installing $lang.gmo.m as $dir/ghb.mo.m"; \
else \
if test -r /home/alastair/Downloads/HandBrake-1.0.1/build/../gtk/po/$lang.gmo.m ; then \
/usr/bin/install -c -m 644 /home/alastair/Downloads/HandBrake-1.0.1/build/../gtk/po/$lang.gmo.m \
$dir/ghb.mo.m; \
echo "installing /home/alastair/Downloads/HandBrake-1.0.1/build/../gtk/po/$lang.gmo.m as" \
"$dir/ghb.mo.m"; \
else \
true; \
fi; \
fi; \
done
installing cs.gmo as /usr/local/share/locale/cs/LC_MESSAGES/ghb.mo
installing da.gmo as /usr/local/share/locale/da/LC_MESSAGES/ghb.mo
installing de.gmo as /usr/local/share/locale/de/LC_MESSAGES/ghb.mo
installing es.gmo as /usr/local/share/locale/es/LC_MESSAGES/ghb.mo
installing fr.gmo as /usr/local/share/locale/fr/LC_MESSAGES/ghb.mo
installing it_IT.gmo as /usr/local/share/locale/it_IT/LC_MESSAGES/ghb.mo
installing ja_JP.gmo as /usr/local/share/locale/ja_JP/LC_MESSAGES/ghb.mo
installing ko.gmo as /usr/local/share/locale/ko/LC_MESSAGES/ghb.mo
installing no.gmo as /usr/local/share/locale/no/LC_MESSAGES/ghb.mo
installing pt_BR.gmo as /usr/local/share/locale/pt_BR/LC_MESSAGES/ghb.mo
installing ro_RO.gmo as /usr/local/share/locale/ro_RO/LC_MESSAGES/ghb.mo
installing ru.gmo as /usr/local/share/locale/ru/LC_MESSAGES/ghb.mo
installing th.gmo as /usr/local/share/locale/th/LC_MESSAGES/ghb.mo
installing zh_CN.gmo as /usr/local/share/locale/zh_CN/LC_MESSAGES/ghb.mo
make[2]: Leaving directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk/po'
make[2]: Entering directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk'
make[3]: Entering directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk'
make[2]: Leaving directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk'
make[1]: Leaving directory '/home/alastair/Downloads/HandBrake-1.0.1/build/gtk'
alastair@ibmserver2:~/Downloads/HandBrake-1.0.1/build>
This looks good to me but I have not yet found how to run it. No GUI version and although there is a large executable file HandBrakeCLI sitting in my build subdirectory it doesn't want to run. Tried thus:-
You should not have needed to install dvdnav or bluray. HandBrake builds both of those. But it seems you got past that somehow.
There are various languages involved in the build system and the actual code. The configure script is written in Python. Some of the macros used are generated with M4 (version numbers and such). Much of the build system are just "Make" files (e.g. make/include/main.defs is a fragment of a make file that gets included by the main make file build/GNUmakefile that is generated by configure). The core of HandBrake (libhb), HandBrakeCLI, and the Linux GUI are all written in C. The windows GUI is C# and the OSX GUI is Objective C. The other libraries HandBrake uses are written mostly in C, C++, and hand coded assembly for speed critical parts of encoders and decoders.
The executable for the Linux GUI is "ghb". It got installed in /usr/local/bin. You'll also find it in a subdirectory of your build directory, build/gtk/src/ghb. HandBrakeCLI is the command line version. You have to tell it everything you want to do on the command line (HandBrakeCLI --help to see all the available options).
Hi John,
It did and it works. Many many thanks for helping me with this, for putting up with my ignorance and also for the brief tutorials. I owe you a bottle of wine.
One last question:-
You said at the start you built HandBrake in an openSUSE VM. How on earth did all the additional required libraries get installed on that VM version or did you know what was required and install them at the start?
The required dependencies are all documented for other Linux platforms in our documentation. I just had to search for the equivalent packages on Suse and install them.
I gave a list of all additional packages I installed in an earlier post. Here it is again if you missed it.