How To Get HB With FDK-AAC + x265 v2.6 (Windows)

HandBrake for Windows support
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.
WhatZit
Posts: 77
Joined: Sat Feb 13, 2016 2:45 am

How To Get HB With FDK-AAC + x265 v2.6 (Windows)

Post by WhatZit » Fri Aug 12, 2016 2:35 pm

EDIT: Superceded by new information here: viewtopic.php?f=11&t=34953#p163970

Since nobody else has bothered to write an updated step-by-step for the Windows build, I thought I'd do it.

1. Fresh install a copy of Ubuntu (i.e. 16.04 LTS). Save yourself pain and only use Ubuntu.

2. Using Terminal, enter: sudo apt-get install git yasm libtool intltool cmake

3. Use FireFox to download this MinGW: https://sourceforge.net/projects/mingw- ... 2/download

4. Use File Manager to extract that archive into "mingw" under your home (topmost) dir (the one with "Downloads", "Public", etc)

5. Open a Terminal window, which should automatically start in your home dir. Type "ls" and you should see that "mingw" dir among a bunch of others.

6. Type: export PATH=~/mingw/bin:$PATH Remember: all folder/file names are CASE-SENSITIVE!

7. Type: x86_64-w64-mingw32-gcc -v to make sure Linux can find the compiler. If you see some "not installed" nonsense, go back to step 4.

8. Type: cd mingw then type: find . -name "*.la" -type f -delete

9. Type: cd .. then type: git clone https://github.com/HandBrake/HandBrake.git

10. Type: cd HandBrake then type: ./configure --cross=x86_64-w64-mingw32 --enable-x265 --enable-qsv --enable-fdk-aac --launch-jobs=1 --force --launch

11. Cross your fingers, toes, arms, legs & eyes. After 10-20 minutes, you should get a SUCCESS message. If not, ughhh... you have the best chance of success using a FRESH Ubuntu install, the nominated MinGW, and only installing the packages from step 2. DON'T go mucking about with your Ubuntu if all you want is FDK HandBrake!

12. Use the File Manager to copy the \HandBrake\build\HandBrakeCLI.exe and \HandBrake\build\libhd\hb.dll to some location that Windows can access.

13. Boot into Windows, and download the latest NIGHTLY build from https://handbrake.fr/nightly.php

14. Download the 10-bit x265 stub from: download/file.php?id=151

15. You might like to backup your existing HandBrake directory, and definitely export your presets. There's a good chance a new version might, at the very least, wipe out your user presets.

16. Install the nightly over the top of your old install. Now, you might NOT have to do this, but it's what I did and it worked. Yes, I know that you can run the Nightly alongside the release. Do it your own way if you want.

17. Copy the 10-bit stub into the install directory.

18. Copy the files from step 12 into your install directory, overwriting the old ones.

19. Load it up and see if it works! You might have to exit and restart if you had an unprocessed queue from the old version, or it wiped out your old presets, or both, because UI elements won't work. I also had to select a VP9 preset and restart before VP8/9 appeared in the list of encoders, so, yes, weird stuff happens.
Last edited by WhatZit on Sun Dec 03, 2017 4:30 am, edited 5 times in total.

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

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by s55 » Fri Aug 12, 2016 2:48 pm

We now include a script to build MinGW from source. See "scripts/mingw-w64-build"
Pass "x86_64" as an argument to it and optionally where to put the toolchain directory. (default is ~/toolchains/)
Give it 10~20 minutes. The script will let you know if your missing any dependencies.
We've stopped using the sourceforge one as it was built in an oddball way.

Also, you should check yasm is versoin 1.3 or later. 1.2 will lead to very slow builds. "yasm -v"


p.s as far as building goes, this is pretty simple compared to many, particularly when you consider it's a cross-compiled version, not natively compiled.

WhatZit
Posts: 77
Joined: Sat Feb 13, 2016 2:45 am

Re: How To Get HB With FDK-AAC + x265 v2.6 (Windows)

Post by WhatZit » Sat Aug 27, 2016 12:52 am

The MinGW from SourceForge (Step 2 above) is, indeed, built in a funny way, such as the hard definition of file paths which will cause "not found" errors during compiles. This is why Step 8 was included.

s55's script to build MinGW simplifies the process and improves reliability, at the expense of a longer total build time. Well worth it.

So, I've revised the step-by-step. Note that this is for people who have never compiled HandBrake before, and only want to add the FDK-AAC option to their executable. Remember, if you get stuck/confused by Ubuntu, the Workspace Switcher lets you run a Firefox Google search in one space whilst the Terminal is open and scaring you in another.


1. Fresh install a copy of Ubuntu (i.e. 16.04.3 LTS). Save yourself pain and only use Ubuntu (due to a known set of packages).

2. Open a Terminal window, and maximise it so you can watch all the text fly by. You should start in your "Home" directory, which is: user@computer:~$

3. Enter: sudo apt-get install cmake curl gcc g++ git intltool libtool m4 bison flex pax make patch python tar wget yasm automake
This will install/upgrade everything to the latest versions.

OPTIONAL: After the above command, if you see some sort of message about packages no longer being required, enter: sudo apt autoremove to delete them. These are usually old system kernels left over from software updates, and can/should be removed. BTW, the Ubuntu desktop uses System Settings->Details (the "gear" icon) to perform much the same function as Windows Update.

4. Enter: git clone https://github.com/HandBrake/HandBrake.git This will download HB from the repository and place it in a directory called "HandBrake". Note that this is the NIGHTLY "master" code, not the latest "stable" release. I've personally found that the Nightly is quite stable PROVIDED that you avoid cloning it during periods of intensive (i.e. multiple daily) developmental commits (see https://github.com/HandBrake/HandBrake/commits/master).

5. Enter: HandBrake/scripts/mingw-w64-build x86_64 Remember: all folder/file names are CASE-SENSITIVE! This will take 10 minutes to download MinGW and build it inside the "toolchains" directory.

6. When Step 5 is finished, you'll see a message very much like:
run the following command and add it to your shell startup script
(e.g., .bashrc or .bash_profile) to make persistent across sessions:
export PATH="/home/user/toolchains/mingw-w64-5.0.3-gcc-7.2.0/mingw-w64-x86_64/bin:${PATH}"

7. Use the mouse to copy the export PATH= ...etc... whole line, and paste it into the Terminal. You might have to use the right-mouse context menu to Copy/Paste. This adds the MinGW compiler into the command search path.

8. Enter: x86_64-w64-mingw32-gcc -v to make sure Linux can find the compiler. If you see some "not installed" nonsense, go back to Step 6 and check carefully. There is no error message for adding a non-existent path string to ${PATH}.

9. Enter: cd HandBrake then enter:
./configure --cross=x86_64-w64-mingw32 --enable-x265 --enable-qsv --enable-fdk-aac --enable-libav-aac --launch-jobs=1 --force --launch

10. After 10-20 minutes, and mind-boggling walls of text, you should get a SUCCESS message. I've not had this fail since using s55's build script for the MinGW compiler. If you do have persistent problems, your best chance of success is to use a fresh UBUNTU install, using the File Manager to delete any existing HandBrake and toolchains directories you might have, only installing the packages from Step 3, and not go fiddling about with your Ubuntu setup.

11. Use the File Manager to copy the HandBrake/build/HandBrakeCLI.exe and HandBrake/build/libhd/hb.dll to some location that Windows can access.

12. Boot into Windows, and download the latest NIGHTLY build from: https://handbrake.fr/nightly.php

13. Backup your existing \Program Files\HandBrake directory, and definitely export your custom presets. There's a good chance a new version might, at the very least, wipe out your user presets.

14. Install the Nightly. I always overwrite my old install (click "Cancel" to keep during setup), and it always works. Note that you can also install the Nightly independently alongside the Release version if you want. If you get weird crashes when you run HB, definitely delete/uninstall any previous versions entirely, then reinstall.

15. Copy the files from step 11 into your install directory, overwriting the old ones.

16. Load it up and see if it works! The first time running it may result in missing UI elements or options. Exit & restart HB, and all should be good. Sometimes, to fix crashing on startup, you also need to delete the "\Users\(you)\AppData\Roaming\HandBrake" directory in your Windows drive, so that HandBrake can create a fresh configuration.

EDIT: Updated (and tested) for HandBrake v1.1.0+, and x265 v2.6
Last edited by WhatZit on Wed Jan 03, 2018 11:57 pm, edited 12 times in total.

drizzle
Posts: 9
Joined: Fri Nov 22, 2013 5:39 pm

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by drizzle » Sat Sep 03, 2016 12:29 am

Thanks for a very helpful post. I encountered the m4 related error described in (1) below, so I did the workaround to use the newer m4 1.4.17 and everything went smoothly from there on.
https://mattgadient.com/2016/06/20/work ... -on-linux/

Other useful tips might be how to update/upgrade the Ubuntu, and how to fetch/merge HandBrake updates to generate an even newer build .. that supports Opus :D

DougH
Posts: 18
Joined: Fri Sep 23, 2016 12:52 am

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by DougH » Fri Sep 23, 2016 1:00 am

After successfully compiling Handbrake by following the steps listed above I did a "git pull" tonight to obtain the latest sources.

I then ran the following command: ./configure --cross=x86_64-mingw32 --enable-x265 --enable-qsv --enable-fdk-aac --launch-jobs=1 --force --launch

after a few seconds configure fails with the following last two lines:

find: x86_64-w64-mingw32-ar...(fail). Not found
: name[0] = x86_64-w64-mingw32-ar
ERROR: Cannot continue; configure stop.

I can sometimes fix this by deleting the toolchains directory, other times configure goes through the compiling process and then spits out a FAILURE (Code 2).

Has anyone else come across this or is this something odd on my end?

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

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by Rodeo » Fri Sep 23, 2016 12:25 pm

Every now and then, you may have to delete the complete build directory (as well as toolchains, if it's not already inside build), and start compiling from scratch.

virgilfox
Posts: 6
Joined: Fri Jan 23, 2015 1:07 pm

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by virgilfox » Fri Dec 16, 2016 2:58 pm

I'm in the process of following the build steps listed above using Ubuntu 16.10 and having trouble. Per the Ubuntu wiki, "In Ubuntu 16.10, as an additional compiler hardening measure, we've enabled PIE and immediate binding by default on amd64 and ppc64le."

This seems to be affecting the toolchain build process as described in the posts above. I had to add "-no-pie" to CFLAGS and CXXFLAGS to get most of the components in the toolchain build script (mingw-w64-build) to build without error. I'm stuck on compiling the GCC component of the toolchain... I'm not sure where to put the "-no-pie" flag as the toolchain gcc build seems to fail at the configure step when it is searching for the GNU gmp library.

Here's what I'm getting in gcc.log when attempting to build the toolchain:

Code: Select all

checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.
When I look in the gcc configure.log, I see the following which makes it seem that the gcc configure script is attempting to compile gmp without the "-no-pie" flag which, of course, fails:

Code: Select all

.
.
.
configure:5757: checking for the correct version of the gmp/mpfr/mpc libraries
configure:5788: gcc -o conftest -I/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp-6.1.0-x86_64/include -I/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/bui
ld-mingw-w64-x86_64/mpfr-3.1.4-x86_64/include -I/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/mpc-1.0.3-x86_64/include -I/home/dengelsma/toolchains/mingw-w64-5.0.0
-gcc-5.4.0/build-mingw-w64-x86_64/isl-0.14-x86_64/include -I/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp-6.1.0-x86_64/include -I/home/dengelsma/toolchains/min
gw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/mpfr-3.1.4-x86_64/include -I/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/mpc-1.0.3-x86_64/include  -I/home/dengelsma
/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp-6.1.0-x86_64/include -I/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/mpfr-3.1.4-x86_64/include -I/
home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/mpc-1.0.3-x86_64/include -I/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/isl-0.14-x86_64
/include -L/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp-6.1.0-x86_64/lib -L/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/mpfr-3.
1.4-x86_64/lib -L/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/mpc-1.0.3-x86_64/lib -L/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/i
sl-0.14-x86_64/lib conftest.c  -L/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp-6.1.0-x86_64/lib -L/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mi
ngw-w64-x86_64/mpfr-3.1.4-x86_64/lib -L/home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/mpc-1.0.3-x86_64/lib -lmpc -lmpfr -lgmp >&5
/usr/bin/ld: /home/dengelsma/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp-6.1.0-x86_64/lib/libgmp.a(fat_entry.o): relocation R_X86_64_32S against symbol `__gmpn_cpuvec' can n
ot be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
.
.
.
Anyone have any workarounds for getting around the "hardening" forced by Ubuntu 16.10?

Thank you!

AndrewUK
Posts: 6
Joined: Wed Nov 23, 2016 7:03 pm

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by AndrewUK » Fri Dec 30, 2016 8:25 pm

I followed this excellent guide and compiled a nightly from about 2 weeks ago successfully with FDK for Windows. Now that the new version 1.0.1 is out , does this guide only work for nightly builds, or is there a way to compile the latest official release? If so can anyone tell me which bits I would need to modify to do it?

I guess this command -- git clone https://github.com/HandBrake/HandBrake.git -- downloads the code from the nightly repository rather than the official stable release, but I am a linux noob so don't really know...

Basically I just want to be able to compile the current stable release with the FDK option rather than having to use a nightly build.

Thanks for any advice!

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

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by mduell » Fri Dec 30, 2016 8:57 pm

Checkout the 1.0.1 tag in the repo instead of HEAD.

davidm71
Posts: 40
Joined: Sat Dec 31, 2016 2:44 am

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by davidm71 » Sat Dec 31, 2016 7:11 pm

Confused about the last reply regarding compiling 1.0.1...

Please clarify?

Thank you


davidm71
Posts: 40
Joined: Sat Dec 31, 2016 2:44 am

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by davidm71 » Sat Dec 31, 2016 10:00 pm

Thanks I'll have to read that over. Was able to get HE-AAC (FDK) working on the Nightly build but the 10 bit x265 stub, even though it gets added to handbreaks options, fails to work. Also installing the Nightly over the 1.0.1 just creates a new install folder and doesnt over write the old one for what its worth. Also just to be clear when you say copy those three files into the install directory you mean the 'program files/Handbrake Nightly' folder??

Edit: I guess you need to find the right compatible version of the 10 bit x265 library file thats on that thread posted above. Anyhow wonder what advantage is there to 10 bit video files anyhow??

Thanks

WhatZit
Posts: 77
Joined: Sat Feb 13, 2016 2:45 am

Why 10-Bit?

Post by WhatZit » Sun Jan 01, 2017 2:44 am

davidm71 wrote:Edit: I guess you need to find the right compatible version of the 10 bit x265 library file thats on that thread posted above. Anyhow wonder what advantage is there to 10 bit video files anyhow??
To reduce confusion, I've updated the "s55's script" instructions above to include changes for v1.0x and x265 v2.1 (the latest branch included in HB). All tested and working.

Regarding the use of 10-bit encoding with x265 (or anything else for that matter), yes... most players that can parse 10-bit encodes will dither the output back to 8-bit to maintain hardware support (unless you have full UHD equipment, which should leave it alone).

However, 10-bit encoding is typically not used to maintain 10-bit depth throughout the whole transport process, but to allow greater efficiencies in the encoding process, particularly to avoid the abominable BANDING.

It's a fairly simple concept: 8-bit encoding provides a colour precision of 256 R/G/B levels, whereas 10-bit encoding provides 1024 R/G/B levels.

This means that rather than deciding whether to represent any particular shade's value as (for example) 211 or 212 in 8-bits (2 choices), the encoder can choose a 10-bit value between 844 and 848 (842 and 850 in practice, for 9 choices).

The results of this are that there is little to no hard, sudden changes in tone or colour (aka Banding) in flat areas of the image (sky, walls, etc) that have been "baked-in" to the source by your encoding, something that would have happened under 8-bits.

x265 has one other reason for using 10-bit encoding even if the target playback system is 8-bit, and that is bitrate efficiency. It is possible to eliminate banding using 8-bit encoding, but it requires significant processing time (2-pass at a minimum), and excessively high bitrates to achieve it. For example, a 10-bit bandless encode might end up being 2000kbps and take 1 hour at CRF, whereas an 8-bit bandless encode might require 4500kbps and take 3.5 hours at ABR.

The 10-bit vs 8-bit bandwagon has been done (and proven) to death on Anime boards, so you can search there for more info. The important thing to remember is: we don't currently encode in 10-bit because of playback hardware. No, no, no, although that might change rapidly in the coming years, too. So, why not be future-proof as well as having highest quality at the smallest filesizes?

Of course, if you are stuck using some primitive flop of a playback thing from 2010 that can't even recognise 10-bit encodes, let alone play them back, dithered or not, then sure, avoid 10-bit like the plague.

davidm71
Posts: 40
Joined: Sat Dec 31, 2016 2:44 am

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by davidm71 » Sun Jan 01, 2017 2:51 am

Wonder if Plex supports 10 bit playback? I've already encoded a significant amount of my video collection into Mkv x265 and shocked to find out my Samsung plasma doesn't support the codec in dlna streamed playback, but PowerDVd 16 and Plex do. Both do a nice job but would be better if I had hardware support..

Thanks

WhatZit
Posts: 77
Joined: Sat Feb 13, 2016 2:45 am

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by WhatZit » Sun Jan 01, 2017 3:24 am

davidm71 wrote:I've already encoded a significant amount of my video collection into Mkv x265 and shocked to find out my Samsung plasma doesn't support the codec in dlna streamed playback, but PowerDVd 16 and Plex do.
Oh boy, do I HATE DLNA, but that's another story...

Yes, Plex supports transcoding 10-bit HEVC into something a Samsung should be able to play, but perhaps not by default.

Check that you are not "Direct Streaming/Playing" to the Samsung, or sending non-transcoded streams or incompatible formats: https://support.plex.tv/hc/en-us/articl ... p-Settings

Plex loves hiding important options in sub-menus where you can "stumble" across them: https://support.plex.tv/hc/en-us/articles/200250347

If all else fails, you might need to manually edit the capabilities of your Samsung TV's client IP in DLNA Advanced: https://support.plex.tv/hc/en-us/articl ... 50536-DLNA

davidm71
Posts: 40
Joined: Sat Dec 31, 2016 2:44 am

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by davidm71 » Sun Jan 01, 2017 3:46 am

You are a treasure of information. Thank you.

As far as my understanding of the way Plex works is that it transcodes the video so the tv can play them otherwise Samsung has not updated the TV to support that codec so direct stream wont work.

Sorry off topic..

AndrewUK
Posts: 6
Joined: Wed Nov 23, 2016 7:03 pm

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by AndrewUK » Sun Jan 01, 2017 6:35 pm

Thanks for that, very useful and pointed me in the right direction. I think I successfully managed it by modifying the steps in the guide as follows.

Initially Step 5 failed with missing libraries/dependencies or something. To fix it I did this, in addition to doing Step 3:

sudo apt-get install bison flex pax

Then, instead of Step 4 I ran this command:

git clone --branch 1.0.1 https://github.com/HandBrake/HandBrake.git

I think this means I pulled the official 1.0.1 release rather than a nightly.

The rest of the guide worked as-is. I did a test encode and all seems to be OK, and FDK is available to select as an AAC codec!

Hope this helps someone!

davidm71
Posts: 40
Joined: Sat Dec 31, 2016 2:44 am

Re: Why 10-Bit?

Post by davidm71 » Mon Jan 02, 2017 4:27 am

WhatZit wrote:
davidm71 wrote:Edit: I guess you need to find the right compatible version of the 10 bit x265 library file thats on that thread posted above. Anyhow wonder what advantage is there to 10 bit video files anyhow??

The 10-bit vs 8-bit bandwagon has been done (and proven) to death on Anime boards, so you can search there for more info. The important thing to remember is: we don't currently encode in 10-bit because of playback hardware. No, no, no, although that might change rapidly in the coming years, too. So, why not be future-proof as well as having highest quality at the smallest filesizes?

Of course, if you are stuck using some primitive flop of a playback thing from 2010 that can't even recognise 10-bit encodes, let alone play them back, dithered or not, then sure, avoid 10-bit like the plague.

So what do you recommend 8 bit or 10 bit?? Also noticed my file sizes are double with 'Grain' tuned into the setting. I'm going to go with ten bit minus grain to get better color reproduction and less banding like you said. Say no to Grain. Thanks.

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

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by mduell » Mon Jan 02, 2017 5:06 am

AndrewUK wrote:git clone --branch 1.0.1 https://github.com/HandBrake/HandBrake.git
1.0.1 should be a tag not a branch.

Gnd0
Posts: 11
Joined: Sun Jul 19, 2015 9:27 am

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by Gnd0 » Mon Jan 02, 2017 7:48 pm

@mduell

I'd like to compile the 1.0.1 release instead of a nightly version.

AndrewUKs line

Code: Select all

git clone --branch 1.0.1 https://github.com/HandBrake/HandBrake.git
worked perfectly for me

whereas

Code: Select all

git clone --tag 1.0.1 https://github.com/HandBrake/HandBrake.git
results in error: unknown option `tag'

Would you be so kind to post the correct command as I am not familiar with git (yet :wink: ). Thanks!


rwatt
Posts: 2
Joined: Wed Jan 04, 2017 5:27 pm

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by rwatt » Wed Jan 04, 2017 5:40 pm

In order to check out the tag, you need to clone the repository first.

Code: Select all

git clone https://github.com/HandBrake/HandBrake.git
Change to that directory.

Code: Select all

cd HandBrake
Now you can list the tags.

Code: Select all

git tag
And check out the 1.0.1 tag.

Code: Select all

git checkout tags/1.0.1

rwatt
Posts: 2
Joined: Wed Jan 04, 2017 5:27 pm

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by rwatt » Wed Jan 04, 2017 6:35 pm

UPDATE 04-Jan-2017 18:20 (-0600)
Ok, you can disregard the problems below. Ubuntu 16.10 introduces issues with compiling that I could not get around and I got tired of trying. I installed 16.04 LTS and everything seems to be compiling just fine now. Obviously, there are probably proper workarounds for compiling this on 16.10, so if you figure it out, please post here.

Original Post
The problem I'm running into is after Step 6. It appears to complete the mingw32 build fairly quickly (and without errors), but there are no messages to add the mingw32 directory to my path. Obviously, it doesn't allow me to proceed (even after adding the directory to my path), because x86_64-w64-mingw32-gcc is not getting built. It does find x86_64-w64-mingw32-ar.

Running scripts/mingw-w64-build x86_64 appears to complete without errors.

Code: Select all

richard@ubuntu-vm:~/HandBrake$ scripts/mingw-w64-build x86_64
path: /home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0
verify:
  config-ddd7f33.tar.gz
curl -Lf --connect-timeout 30 "http://git.savannah.gnu.org/gitweb/?p=config.git;a=snapshot;h=ddd7f33;sf=tgz" -o "/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/pkg/config-ddd7f33.tar.gz"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 55232    0 55232    0     0  86212      0 --:--:-- --:--:-- --:--:-- 86300
  binutils-2.26.tar.bz2
curl -Lf --connect-timeout 30 "https://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.bz2" -o "/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/pkg/binutils-2.26.tar.bz2"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24.3M  100 24.3M    0     0  6498k      0  0:00:03  0:00:03 --:--:-- 6497k
  mingw-w64-v5.0.0.tar.bz2
curl -Lf --connect-timeout 30 "http://downloads.sourceforge.net/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v5.0.0.tar.bz2" -o "/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/pkg/mingw-w64-v5.0.0.tar.bz2"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   387    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 10.6M  100 10.6M    0     0  4487k      0  0:00:02  0:00:02 --:--:-- 5200k
  gmp-6.1.0.tar.bz2
curl -Lf --connect-timeout 30 "https://ftp.gnu.org/gnu/gmp/gmp-6.1.0.tar.bz2" -o "/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/pkg/gmp-6.1.0.tar.bz2"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2327k  100 2327k    0     0   895k      0  0:00:02  0:00:02 --:--:--  895k
  mpfr-3.1.4.tar.gz
curl -Lf --connect-timeout 30 "https://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.gz" -o "/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/pkg/mpfr-3.1.4.tar.gz"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1657k  100 1657k    0     0  1061k      0  0:00:01  0:00:01 --:--:-- 1062k
  mpc-1.0.3.tar.gz
curl -Lf --connect-timeout 30 "https://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz" -o "/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/pkg/mpc-1.0.3.tar.gz"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  654k  100  654k    0     0   687k      0 --:--:-- --:--:-- --:--:--  686k
  isl-0.14.tar.bz2
curl -Lf --connect-timeout 30 "ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.14.tar.bz2" -o "/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/pkg/isl-0.14.tar.bz2"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1367k  100 1367k    0     0   688k      0  0:00:01  0:00:01 --:--:--  688k
curl -Lf --connect-timeout 30 "http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/infrastructure/isl-0.14.tar.bz2" -o "/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/pkg/isl-0.14.tar.bz2"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1367k  100 1367k    0     0  1108k      0  0:00:01  0:00:01 --:--:-- 1109k
  gcc-5.4.0.tar.bz2
curl -Lf --connect-timeout 30 "https://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2" -o "/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/pkg/gcc-5.4.0.tar.bz2"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 91.2M  100 91.2M    0     0  6511k      0  0:00:14  0:00:14 --:--:-- 7041k

Code: Select all

extract:
  config-ddd7f33.tar.gz
  binutils-2.26.tar.bz2
  mingw-w64-v5.0.0.tar.bz2
  gmp-6.1.0.tar.bz2
  mpfr-3.1.4.tar.gz
  mpc-1.0.3.tar.gz
  isl-0.14.tar.bz2
  gcc-5.4.0.tar.bz2
host:
  name: linux
  arch: x86_64
  type: x86_64-pc-linux-gnu
  vcpu: 4
target: x86_64-w64-mingw32
build:
  binutils 2.26
  mingw-w64 5.0.0 headers
  gmp 6.1.0
I manually added this to my path anyway.

Code: Select all

/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/mingw-w64-x86_64/bin
Verification fails.

Code: Select all

richard@ubuntu-vm:~$ x86_64-w64-mingw32-gcc -v
The program 'x86_64-w64-mingw32-gcc' is currently not installed. You can install it by typing:
sudo apt install gcc-mingw-w64-x86-64
Configuration fails.

Code: Select all

richard@ubuntu-vm:~/HandBrake$ ./configure --cross=x86_64-w64-mingw32 --enable-x265 --enable-qsv --enable-fdk-aac --launch-jobs=1 --force --launch
probe: host tuple...(pass) x86_64-unknown-linux-gnu
compute: available architectures...(pass) x86_64
find: ar...(pass) /usr/bin/ar
find: cp...(pass) /bin/cp
find: gcc...(pass) /usr/bin/gcc
find: gmake...(pass) /usr/bin/make
find: gm4...(pass) /usr/bin/m4
find: mkdir...(pass) /bin/mkdir
find: gpatch...(pass) /usr/bin/patch
find: rm...(pass) /bin/rm
find: ranlib...(pass) /usr/bin/ranlib
find: strip...(pass) /usr/bin/strip
find: gtar...(pass) /bin/tar
find: yasm...(pass) /usr/bin/yasm
find: autoconf...(pass) /usr/bin/autoconf
find: automake...(pass) /usr/bin/automake
find: cmake...(pass) /usr/bin/cmake
find: libtool...(fail) not found
find: pkg-config...(pass) /usr/bin/pkg-config
find: xcodebuild...(fail) not found
find: lipo...(fail) not found
find: x86_64-w64-mingw32-ar...(pass) /home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/mingw-w64-x86_64/bin/x86_64-w64-mingw32-ar
find: x86_64-w64-mingw32-gcc...(fail) not found
  : name[0] = x86_64-w64-mingw32-gcc
ERROR: unable to continue; configure stop.
EDIT
Here are errors in the gmp.log.

Code: Select all

/usr/bin/ld: /home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp/.libs/libgmp.a(fat_entry.o): relocation R_X86_64_32S against symbol `__gmpn_cpuvec' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:763: recipe for target 't-bswap' failed
make[4]: *** [t-bswap] Error 1
make[4]: Leaving directory '/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp/tests'
Makefile:1182: recipe for target 'check-am' failed
make[3]: *** [check-am] Error 2
make[3]: Leaving directory '/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp/tests'
Makefile:822: recipe for target 'check-recursive' failed
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory '/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp/tests'
Makefile:954: recipe for target 'check-recursive' failed
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory '/home/richard/toolchains/mingw-w64-5.0.0-gcc-5.4.0/build-mingw-w64-x86_64/gmp'
Makefile:1246: recipe for target 'check' failed
make: *** [check] Error 2

Gnd0
Posts: 11
Joined: Sun Jul 19, 2015 9:27 am

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by Gnd0 » Thu Jan 05, 2017 10:12 pm

rwatt, your posting concerning git tags worked like a charm! Thank you for sharing :D

davidm71
Posts: 40
Joined: Sat Dec 31, 2016 2:44 am

Re: How To Get HB With FDK-AAC + 10-Bit x265 v2.0 (Windows)

Post by davidm71 » Fri Jan 06, 2017 10:07 am

rwatt wrote:In order to check out the tag, you need to clone the repository first.

Code: Select all

git clone https://github.com/HandBrake/HandBrake.git
Change to that directory.

Code: Select all

cd HandBrake
Now you can list the tags.

Code: Select all

git tag
And check out the 1.0.1 tag.

Code: Select all

git checkout tags/1.0.1

So the above terminal commands are all thats needed to set HandBrake to 1.0.1 ??

Thanks

Post Reply