[Implemented] H.265 main10 profile not working

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
osztrovszky
Posts: 1
Joined: Wed Jul 22, 2015 1:35 pm

[Implemented] H.265 main10 profile not working

Post by osztrovszky »

Hello Guys!
I have a h265 10 bit ts video.
I'd like to make a mp4 file with handbrake, keeping the 10bit color depth.
I'm choosing H.265, then at the profiles, Main 10.
However the output file is not 10 bit.
I've checked the nighly edition, but there is no Main10 at the profiles. Why is that?

latest Handbrake
Windows 7, Windows 8.1

Thanks,
Zsolt
moneymatt4life
Veteran User
Posts: 436
Joined: Fri Mar 09, 2012 5:26 am

Re: H.265 main10 profile not working

Post by moneymatt4life »

because handbrake doesn't support 10bit output... x265 did recently add this multi-bitdepth .dll thingy though, but fairly sure handbrake would dither it to 8bit regardless, unless handbrake's pipeline was changed or something :? so, not sure if that would be of any help currently :P
User avatar
JohnAStebbins
HandBrake Team
Posts: 5585
Joined: Sat Feb 09, 2008 7:21 pm

Re: H.265 main10 profile not working

Post by JohnAStebbins »

x265 is statically linked in HandBrake, so the dll thing won't work. 10 bit output is not supported by HandBrake.
ByteShare
Posts: 35
Joined: Fri Aug 07, 2015 1:21 am

Re: H.265 main10 profile not working

Post by ByteShare »

JohnAStebbins wrote:x265 is statically linked in HandBrake, so the dll thing won't work. 10 bit output is not supported by HandBrake.
Will it eventually?
User avatar
BradleyS
Moderator
Posts: 1859
Joined: Thu Aug 09, 2007 12:16 pm

Re: H.265 main10 profile not working

Post by BradleyS »

HandBrake's entire pipeline is 8-bit yuv420p, so this would require major changes under the hood. Not planned for the very near future.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5585
Joined: Sat Feb 09, 2008 7:21 pm

Re: [Invalid] H.265 main10 profile not working

Post by JohnAStebbins »

Turns out, this wasn't as hard as anticipated. Though I still question the usefulness of encoding HandBrake's 8bit video data using a 10bit encoder.
https://github.com/HandBrake/HandBrake/ ... 7044dc35f6
https://github.com/HandBrake/HandBrake/ ... 39700b64f7
https://github.com/HandBrake/HandBrake/ ... a76171f6c2
User avatar
BradleyS
Moderator
Posts: 1859
Joined: Thu Aug 09, 2007 12:16 pm

Re: [Invalid] H.265 main10 profile not working

Post by BradleyS »

Assuming the future is 10-bit and BT.2020, this is a great first effort, John.
User avatar
BradleyS
Moderator
Posts: 1859
Joined: Thu Aug 09, 2007 12:16 pm

Re: [Implemented] H.265 main10 profile not working

Post by BradleyS »

Marking invalid->implemented.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5585
Joined: Sat Feb 09, 2008 7:21 pm

Re: [Implemented] H.265 main10 profile not working

Post by JohnAStebbins »

I forgot to mention, HandBrake does not distribute the necessary shared libraries that this requires. We dynamically load them if found in the standard library search path on the system. So if you want to use 10 or 12 bit x265 encoding, you must find or build and install these libraries yourself.
ByteShare
Posts: 35
Joined: Fri Aug 07, 2015 1:21 am

Re: [Implemented] H.265 main10 profile not working

Post by ByteShare »

JohnAStebbins wrote:I forgot to mention, HandBrake does not distribute the necessary shared libraries that this requires. We dynamically load them if found in the standard library search path on the system. So if you want to use 10 or 12 bit x265 encoding, you must find or build and install these libraries yourself.
So they will work if we install them? Can you explain how? Just a simple link to which build we should use and the exact path would be really helpful. Thank you.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5585
Joined: Sat Feb 09, 2008 7:21 pm

Re: [Implemented] H.265 main10 profile not working

Post by JohnAStebbins »

ByteShare wrote: So they will work if we install them? Can you explain how? Just a simple link to which build we should use and the exact path would be really helpful. Thank you.
It's different for every platform. There are *no* simple links. I only know linux, and even there it varies from one distribution to another. I'm afraid this is something we will have to answer on a case by case basis. And in many cases I'm afraid the answer is going to be "I don't know".
ByteShare
Posts: 35
Joined: Fri Aug 07, 2015 1:21 am

Re: [Implemented] H.265 main10 profile not working

Post by ByteShare »

JohnAStebbins wrote:
ByteShare wrote: So they will work if we install them? Can you explain how? Just a simple link to which build we should use and the exact path would be really helpful. Thank you.
It's different for every platform. There are *no* simple links. I only know linux, and even there it varies from one distribution to another. I'm afraid this is something we will have to answer on a case by case basis. And in many cases I'm afraid the answer is going to be "I don't know".
What I mean is do I just get the latest build from: http://x265.ru/en/builds/
and put it in:
C:\Program Files\HandBrake
or
C:\Users\%user%\AppData\Roaming\HandBrake
?
I'm just not familiar with where Handbrake puts the x265 builds. I don't think it should be a case by case basis since the install should work about the same on every Windows platform. I'm a little familiar with Linux, so I'd expect the install to be similary familiar for most Linux installs as well (obviously different than a Windows install).
User avatar
s55
HandBrake Team
Posts: 9961
Joined: Sun Dec 24, 2006 1:05 pm

Re: [Implemented] H.265 main10 profile not working

Post by s55 »

HandBrake does not and will not use x265.exe
All the existing libraries are statically linked inside in hb.dll so you won't find any of the existing libraries.

Basically, you need to compiled version of the dll library. Most probably it'll need to be cross-compiled version with GCC. I have a sneaking suspicion a VC version won't work.

Note, this is also untested on windows, so may or may not work at all.

I don't know of any sources of the dll, so you may be forced to cross-compile under linux to produce one.
ByteShare
Posts: 35
Joined: Fri Aug 07, 2015 1:21 am

Re: [Implemented] H.265 main10 profile not working

Post by ByteShare »

Ah, okay. I got it. Thank you.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5585
Joined: Sat Feb 09, 2008 7:21 pm

Re: [Implemented] H.265 main10 profile not working

Post by JohnAStebbins »

If anyone who figures out the secret sauce to make this work on windows, please share it with us.

Linux and OSX are pretty straight forward, though the details will vary depending on distribution and your favourite 3rd party repositories. Install from your distro or third party repository, or build from source using standard system build tools and install libraries to the standard system library location (/usr/lib on linux).
Lazyncoder
Regular User
Posts: 63
Joined: Wed Dec 17, 2014 11:19 am

Re: [Implemented] H.265 main10 profile not working

Post by Lazyncoder »

JohnAStebbins wrote:I forgot to mention, HandBrake does not distribute the necessary shared libraries that this requires. We dynamically load them if found in the standard library search path on the system. So if you want to use 10 or 12 bit x265 encoding, you must find or build and install these libraries yourself.
Is there anyway to do the same for 8bit too?
Because, as you already know better, x265 is developing like crazy. we only get major version updates in HB. so if there will be anyway to update/install latests version for advanced users, it will be awesome.
ByteShare
Posts: 35
Joined: Fri Aug 07, 2015 1:21 am

Re: [Implemented] H.265 main10 profile not working

Post by ByteShare »

JohnAStebbins wrote:I forgot to mention, HandBrake does not distribute the necessary shared libraries that this requires. We dynamically load them if found in the standard library search path on the system. So if you want to use 10 or 12 bit x265 encoding, you must find or build and install these libraries yourself.
Can someone explain to me why distributing the shared libraries for 8bit is so different than 10bit?
I was looking at how to do this again but I have some holes in my understanding about shared libraries. I don't know where handbrake is looking for the 265 that comes with the setup.exe for handbrake, and I was told that the x265-10bit.exes aren't something handbrake uses. Is it a matter of the hb.dll?
If I need to make a new thread please let me know, as I'm just trying to understand how to get this added feature working.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5585
Joined: Sat Feb 09, 2008 7:21 pm

Re: [Implemented] H.265 main10 profile not working

Post by JohnAStebbins »

ByteShare wrote: Can someone explain to me why distributing the shared libraries for 8bit is so different than 10bit?
It's no different. HandBrake doesn't distribute an 8bit *shared* library for x265. The 8bit library is statically linked to HandBrake.
I was looking at how to do this again but I have some holes in my understanding about shared libraries. I don't know where handbrake is looking for the 265 that comes with the setup.exe for handbrake and I was told that the x265-10bit.exes aren't something handbrake uses.
Correct, no external exe's are used by HandBrake. HandBrake expects the 10bit x265 *dll*. I don't know windows all that well, but I believe you can put this dll in the same directory as HandBrake gets installed in.
ByteShare
Posts: 35
Joined: Fri Aug 07, 2015 1:21 am

Re: [Implemented] H.265 main10 profile not working

Post by ByteShare »

JohnAStebbins wrote:Correct, no external exe's are used by HandBrake. HandBrake expects the 10bit x265 *dll*. I don't know windows all that well, but I believe you can put this dll in the same directory as HandBrake gets installed in.
I tried several combinations and several different dll files from: http://www.msystem.waw.pl/x265/
I tried all of these file names in the main handbrake folder (with the extension .dll):
libx265_main10
libx265_main
libx265
x265_main10
x265main10
x265

With all of these dlls:
x265-1.9+15-425b583_vs2015
x265-1.9+2-ee38630-stable_Win64-vs2015
x265-1.9+15-425b583_vs2015-AVX
For all 3 of these I tried the provided libx265.dll and the libx265_main10.dll, depending on which or if both were available.

This took me some time to do all of these combinations, even when running only 10 sec encodes, but the all defaulted back to Main, rather than Main10.
I'm concluding I used the wrong location, wrong filename, and/or wrong dll.
Any advice?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5585
Joined: Sat Feb 09, 2008 7:21 pm

Re: [Implemented] H.265 main10 profile not working

Post by JohnAStebbins »

It attempts to dynamically load the file named libx265_main10.dll. It probably needs to be in the same directory where HandBrakeCLI.exe and hb.dll are. But as I said, I know very little about how windows searches for shared libraries.
ByteShare
Posts: 35
Joined: Fri Aug 07, 2015 1:21 am

Re: [Implemented] H.265 main10 profile not working

Post by ByteShare »

Okay, thank you for that clarification. Still can't get it work. I'm going to start a new thread in the Windows section to see if someone can help me.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5585
Joined: Sat Feb 09, 2008 7:21 pm

Re: [Implemented] H.265 main10 profile not working

Post by JohnAStebbins »

ByteShare wrote:Okay, thank you for that clarification. Still can't get it work. I'm going to start a new thread in the Windows section to see if someone can help me.
Just to clarify, you *are* using the HandBrake nightly build, right?
ByteShare
Posts: 35
Joined: Fri Aug 07, 2015 1:21 am

Re: [Implemented] H.265 main10 profile not working

Post by ByteShare »

I was using both the nightline and the 10.5.
Just saw this today: https://trac.handbrake.fr/changeset/966 ... e745f87d52
Looks like something was broken to start. I just need to confirm the names of the dlls to add and I can compile the hd.dll...still weird to me to add support but not bother putting the dlls in the package.
Update:
s55 wrote:Looks like you need to build x265 in a very specific way otherwise this won't work. The versions on that site are incompatible with our builds.
We'll maybe look into providing some dll's on the forum for those who want to experiment
User avatar
s55
HandBrake Team
Posts: 9961
Joined: Sun Dec 24, 2006 1:05 pm

Re: [Implemented] H.265 main10 profile not working

Post by s55 »

No, nothing was "broken". The WinGui didn't have support in the first place. It worked fine under HandBrakeCLI.
Post Reply