x264 library version on compiled HandBrakeCLI

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
plittlefield
Posts: 38
Joined: Wed Nov 18, 2009 10:03 am

x264 library version on compiled HandBrakeCLI

Post by plittlefield » Fri Aug 17, 2018 3:13 pm

Hello,

On the github Releases page https://github.com/HandBrake/HandBrake/ ... /tag/1.1.0 it shows that the x264 library has been updated to version 155 r2893.

I have compiled HandBrakeCLI for Linux using the page at https://handbrake.fr/docs/en/latest/dev ... linux.html.

However, when I look at the 'mediainfo' details of an MP4 file I created using this, I see a different x264 version...

Code: Select all

Writing library                          : x264 core 148 r2643 5c65704
...and was wondering what I have done wrong and how to use the latest version of the x264 library?

Thanks,

:-)

Paully

HandBrake 20180810154915-d667a3d-master
Ubuntu Linux 16.04.5 LTS

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

Re: x264 library version on compiled HandBrakeCLI

Post by s55 » Fri Aug 17, 2018 3:33 pm

On linux, HandBrake will use the system version of x264. It's not bundled as with Windows/Mac.

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

Re: x264 library version on compiled HandBrakeCLI

Post by JohnAStebbins » Fri Aug 17, 2018 4:02 pm

s55 wrote:
Fri Aug 17, 2018 3:33 pm
On linux, HandBrake will use the system version of x264. It's not bundled as with Windows/Mac.
... Unless you are using the flatpak release. The flatpak release bundles most of the same things as the other platforms.

plittlefield
Posts: 38
Joined: Wed Nov 18, 2009 10:03 am

Re: x264 library version on compiled HandBrakeCLI

Post by plittlefield » Sat Aug 18, 2018 9:45 am

Ah, I think I follow.

I just thought the build process would download the latest versions of all the required libraries and compile them in to the final binary...

...so I need to update my Ubuntu Server 16.04 x264 library (headers, etc.)?

The only reason I started this compile process was because the updates using the 'daily snapshots PPA' for 16.04 stopped :-(

plittlefield
Posts: 38
Joined: Wed Nov 18, 2009 10:03 am

Re: x264 library version on compiled HandBrakeCLI

Post by plittlefield » Sat Aug 18, 2018 11:02 am

Ok, so I have removed the system's default software...

Code: Select all

sudo apt-get remove ffmpeg x264 libx264-dev
...then installed the latest x264...

Code: Select all

sudo apt-get install nasm
cd ~/Downloads
git clone git://git.videolan.org/x264
cd x264/
./configure --enable-shared
make
sudo make install
x264 --version
x264 0.157.2932 303c484
built on Aug 18 2018, gcc: 7.3.0
...so far, so good... so now I can recompile HandBrakeCLI again and get the latest x264?

plittlefield
Posts: 38
Joined: Wed Nov 18, 2009 10:03 am

Re: x264 library version on compiled HandBrakeCLI

Post by plittlefield » Mon Aug 20, 2018 2:33 pm

I have hit a problem... and HandBrake will not compile after compiling x264, x265, fdk-aac and ffmpeg successfully.

Here are the last few lines of the output...

Code: Select all

  : /usr/bin/g++ -pipe -Wl,-S -fmessage-length=0 -Wall -g0 -O3 -mfpmath=sse -msse2 -DUSE_NVENC -DUSE_X265 -I./libhb/ -I./contrib/include -I/usr/include/libxml2 -o HandBrakeCLI -Wl,--start-group test/test.o test/parsecsv.o ./libhb/libhandbrake.a -L./contrib/lib -lass -lavformat -lavfilter -lavcodec -lavutil -lswresample -lpostproc -lmp3lame -ldvdnav -ldvdread -lfribidi -lsamplerate -lswscale -lvpx -ltheoraenc -ltheoradec -lvorbis -lvorbisenc -logg -lx264 -lbluray -lfreetype -lxml2 -lbz2 -lz -ljansson -lharfbuzz -lopus -lspeex -llzma -lfontconfig -lx265 -lpthread -ldl -lm -Wl,--end-group
  : ./contrib/lib/libavfilter.a(af_resample.o): In function `config_output':
  : af_resample.c:(.text+0x1a1): undefined reference to `avresample_close'
  : af_resample.c:(.text+0x1aa): undefined reference to `avresample_free'
  : af_resample.c:(.text+0x1bd): undefined reference to `avresample_alloc_context'
  : af_resample.c:(.text+0x2ae): undefined reference to `avresample_open'
  : ./contrib/lib/libavfilter.a(af_resample.o): In function `request_frame':
  : af_resample.c:(.text+0x49b): undefined reference to `avresample_get_out_samples'
  : af_resample.c:(.text+0x4ff): undefined reference to `avresample_convert'
  : ./contrib/lib/libavfilter.a(af_resample.o): In function `filter_frame':
  : af_resample.c:(.text+0x595): undefined reference to `avresample_get_delay'
  : af_resample.c:(.text+0x5a9): undefined reference to `avresample_get_out_samples'
  : af_resample.c:(.text+0x5eb): undefined reference to `avresample_convert'
  : af_resample.c:(.text+0x600): undefined reference to `avresample_available'
  : ./contrib/lib/libavfilter.a(af_resample.o): In function `resample_child_class_next':
  : af_resample.c:(.text+0x151): undefined reference to `avresample_get_class'
  : ./contrib/lib/libavfilter.a(af_resample.o): In function `uninit':
  : af_resample.c:(.text.unlikely+0xf): undefined reference to `avresample_close'
  : af_resample.c:(.text.unlikely+0x18): undefined reference to `avresample_free'
  : ./contrib/lib/libavfilter.a(af_resample.o): In function `init':
  : af_resample.c:(.text.unlikely+0x4a): undefined reference to `avresample_get_class'
  : collect2: error: ld returned 1 exit status
  : ../test/module.rules:47: recipe for target 'HandBrakeCLI' failed
  : make: *** [HandBrakeCLI] Error 1
-------------------------------------------------------------------------------
time end: Mon Aug 20 15:27:18 2018
duration: 10 seconds (10.83s)
result: FAILURE (code 2)
-------------------------------------------------------------------------------

...what have I done wrong?

Paully

Ubuntu 16.04.5 LTS

HandBrake 20180810154915-d667a3d-master (last successful compile with Ubuntu libraries)

x264 0.157.2932 303c484
(libswscale 4.0.0)
(libavformat 57.10.3)
built on Aug 20 2018, gcc: 5.4.0 20160609

x265 [info]: HEVC encoder version 2.8+64-ge42e7bb
x265 [info]: build info [Linux][GCC 5.4.0][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX XOP FMA4 FMA3 BMI1

ffmpeg version N-91646-g78d4b6b Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609

plittlefield
Posts: 38
Joined: Wed Nov 18, 2009 10:03 am

Re: x264 library version on compiled HandBrakeCLI

Post by plittlefield » Mon Aug 20, 2018 3:16 pm

OK, so problem solved... I just needed to run the system wide library linker, clean up the build directory from last time, and then add some extra options to the configure command...

Code: Select all

sudo ldconfig
make clean
./configure --force --verbose --launch-jobs=$(nproc) --launch --disable-gtk --enable-x265 --enable-fdk-aac --enable-nvenc
sudo make --directory=build install

alpo
Posts: 6
Joined: Sat Sep 01, 2018 5:23 pm

Re: x264 library version on compiled HandBrakeCLI

Post by alpo » Sat Sep 01, 2018 6:46 pm

On linux, HandBrake will use the system version of x264. It's not bundled as with Windows/Mac.
A couple questions:
  1. Does the same hold true for x265?
  2. Will downloading, compiling, and installing the latest x265 encoder from x265.org resolve the message "x265 [info]: using cpu capabilities: none!"?

This is for a CentOS7 system.

mduell
Veteran User
Posts: 6106
Joined: Sat Apr 21, 2007 8:54 pm

Re: x264 library version on compiled HandBrakeCLI

Post by mduell » Sat Sep 01, 2018 9:02 pm

Building x265 correctly, or using the HB flatpak build, will do that.

alpo
Posts: 6
Joined: Sat Sep 01, 2018 5:23 pm

Re: x264 library version on compiled HandBrakeCLI

Post by alpo » Sat Sep 01, 2018 9:29 pm

Thanks, mduell. It seems my particular issue was installing a HandBrake-compatible version of nasm. For anyone looking for further details, please see this thread.

Post Reply