View Full Version : Pass over HDR10+ and Dolby Vision information?
ShortKatz
25th January 2021, 22:02
Now that HandBrake finally has a first 10-bit pipeline, I was experimenting with converting some HDR movies. For regular HDR10 this is relatively easy. You just need to read out the HDR values with e.g. MediaInfo and than add the --master-display and --max-cll values in HandBrakes additional option box.
But, how would I do this with dynamic metadata from HDR10+ and Dolby Vision sources?
quietvoid
25th January 2021, 22:24
For HDR10+ you can extract to JSON using https://github.com/quietvoid/hdr10plus_parser
And then feed the JSON to x265: https://x265.readthedocs.io/en/master/cli.html#cmdoption-dhdr10-info
For Dolby Vision, same principle: https://github.com/quietvoid/dovi_tool#extract-rpu
Feed to x265 with: https://x265.readthedocs.io/en/master/cli.html#cmdoption-dolby-vision-rpu
Also have to specify the profile.
You'll need to figure out what profile your devices are compatible with, most likely converting to profile 8.1 is fine for most cases.
However this does not support cropped Dolby Vision encodes out of the box just yet, a modification to the code is necessary to override the metadata.
benwaggoner
26th January 2021, 01:08
And note a lot of Dolby Vision devices don't support Profile 8.1, and most sources aren't in that either. Converting between DoVi versions requires a full tone remapping, beyond the abilities of something like Handbreak.
quietvoid
26th January 2021, 02:14
And note a lot of Dolby Vision devices don't support Profile 8.1, and most sources aren't in that either. Converting between DoVi versions requires a full tone remapping, beyond the abilities of something like Handbreak.
So far most streaming devices and Android TVs have no problem with YCbCr HDR10 + Profile 8.1 compatible RPU in the same stream, the Dolby engine interprets them correctly.
It's much more compatible than profile 7, at least :)
It's just a question of unsetting some flags and then the decoder has no problem. Converting profile 5 would be a different story.
Nico8583
26th January 2021, 11:34
Hi :)
I'm interested, my TV is a Samsung Q70R so not compatible with DoVi, only HDR10+. What is the result if I recode a DoVi stream to x265 DoVi stream ? It will play as a standard HDR10 stream or it will not be compatible ?
Thank you.
benwaggoner
26th January 2021, 22:28
Hi :)
I'm interested, my TV is a Samsung Q70R so not compatible with DoVi, only HDR10+. What is the result if I recode a DoVi stream to x265 DoVi stream ? It will play as a standard HDR10 stream or it will not be compatible ?
Thank you.
If it is a Profile 8.x source, then the bitstream is in a "native" color volume and will work without the metadata, although perhaps with lower quality without the dynamic metadata.
If it's a non-backwards compatible base layer, like Profile 5, you'd need to do a full tone mapping conversion with specialized tools. That's a full format conversion, not even a straight reencode let alone a remux.
Nico8583
26th January 2021, 23:23
Thank you !
How can I know the DoVi profile version ? With MediaInfo ?
And how does it work with original Blu ray ? My TV will play it as an HDR / HDR10 stream ? I don't have any DoVi BD now so I can't try but I ask for the future.
benwaggoner
27th January 2021, 01:47
Thank you !
How can I know the DoVi profile version ? With MediaInfo ?
And how does it work with original Blu ray ? My TV will play it as an HDR / HDR10 stream ? I don't have any DoVi BD now so I can't try but I ask for the future.
MediaInfo should tell you.
And I don't think any DoVi BD titles use 8.x.
Nico8583
27th January 2021, 01:50
MediaInfo should tell you.
And I don't think any DoVi BD titles use 8.x.
Thank you so DoVi BD use profile 5 ? Or 7 ?
quietvoid
27th January 2021, 04:24
Thank you so DoVi BD use profile 5 ? Or 7 ?
Profile 7.
Nico8583
27th January 2021, 09:58
Profile 7.
Thank you so if I want to convert an DoVi BD (profile 7) to x265 DoVi file I must use profile 5, 8.1 or 8.2 because x265 supports only these profiles ?
And I must convert profile 7 to profile 8.1 so I can keep HDR10 + DoVi metadata ?
Thank you.
quietvoid
27th January 2021, 15:23
Correct. However, you can only convert profile 7 to 8.1 with the existing tools. Since they share the same HDR10 base layer.
Profile 5 conversion is much more complex.
Nico8583
27th January 2021, 16:25
OK thank you I'll try it. There are DoVi BD with profile 5 or all are profile 7 ? There is no quality difference between profile 7 or 8.1 ? Thank you.
quietvoid
27th January 2021, 17:04
All Dolby Vision UHD BDs are profile 7.
Profile 7 FEL has the potential to be better, but in most cases (and current technology) it is not noticeably so.
It is also only fully compatible on UHD BD players.
Profile 7 MEL is equivalent to profile 8.1.
You can use google to find the differences between FEL and MEL.
Blue_MiSfit
27th January 2021, 19:18
Erm, Profile 7 supports an enhancement layer, but 8.1 does not (just metadata on top of the HDR10 base)
quietvoid
27th January 2021, 20:17
Erm, Profile 7 supports an enhancement layer, but 8.1 does not (just metadata on top of the HDR10 base)
Profile 7 MEL has a useless enhancement layer, so it's pretty much the same metadata.
Nico8583
27th January 2021, 20:26
And there is no link between Dolby Vision metadata and HDR10+ metadata ? It's not possible to find a way to convert DoVi metadata informations to HDR10+ ? I don't know the structure of each file, perhaps it's stupid.
quietvoid
27th January 2021, 21:15
And there is no link between Dolby Vision metadata and HDR10+ metadata ? It's not possible to find a way to convert DoVi metadata informations to HDR10+ ? I don't know the structure of each file, perhaps it's stupid.
There are patents on converting from Dolby Vision to HDR10+ but there are no public algorithms.
benwaggoner
27th January 2021, 21:35
And there is no link between Dolby Vision metadata and HDR10+ metadata ? It's not possible to find a way to convert DoVi metadata informations to HDR10+ ? I don't know the structure of each file, perhaps it's stupid.
For Profile 8.1 DoVi, conversion to HDR10+ is theoretically possible as they both have a HDR-10 base layer. Something like ColorFront Transkoder might have, or might get that sort of functionality. But it'd have to be a company with lots of image science chops who licenses tech from both Dolby and HDR10+ LLC.
Generating new dynamic metadata based on the base layer is possible today, and should yield pretty identical results in the cases where metadata is descriptive based on analysis without specific creative intent metadata tuning. Transkoder can do that today.
Another likely scenario is to generate both HDR10+ and DoVi 8.1 metadata simultaneously, and then insert the respective metadata into the same base layer HDR10 encoded bitstream.
Nico8583
27th January 2021, 23:09
Thank you both. Is there a BD movie with DoVi and HDR10+ ? Or it's not possible ?
It should be a good thing to get a public algorithm to convert DoVi to HDR10+, I'm trying to find some informations.
SeeMoreDigital
28th January 2021, 10:42
Thank you both. Is there a BD movie with DoVi and HDR10+ ? Or it's not possible ?
It should be a good thing to get a public algorithm to convert DoVi to HDR10+, I'm trying to find some informations.Yes there are...
The Blu-ray Forum has a constantly updated list of HDR10+ movies (https://forum.blu-ray.com/showthread.php?t=300877) (there are currently only around 50). If you click on a movie cover you'll be able to find out which movies are also encoded with Dolby Vision.
Here's a few to get you started: -
1917 (https://www.blu-ray.com/movies/1917-4K-Blu-ray/259242/) [With FEL Dolby Vision]
Birds of Prey (And The Fantabulous Emancipation of One Harley Quinn) (https://www.blu-ray.com/movies/Birds-of-Prey-And-the-Fantabulous-Emancipation-of-One-Harley-Quinn-4K-Blu-ray/260459/) [With MEL Dolby Vision]
Jaws (https://www.blu-ray.com/movies/Jaws-4K-Blu-ray/265299/) [With FEL Dolby Vision]
The Shining (https://www.blu-ray.com/movies/The-Shining-4K-Blu-ray/238513/) [With MEL Dolby Vision]
The Wizard Of Oz (https://www.blu-ray.com/movies/The-Wizard-of-Oz-4K-Blu-ray/242165/) [With MEL Dolby Vision]
I bought 'Birds Of Prey' a few weeks ago, which offers MEL Dolby Vision and HDR10+. But there are some FEL Dolby Vision and HDR10+ releases too ;)
Cheers
Nico8583
28th January 2021, 13:30
Thank you, I'll look to buy one of them ;)
ShortKatz
28th January 2021, 19:23
Wow, thanks to all of you for all suggestions. I will give this a try. On the long run it seems it is planned that HandBrake simply passthru all mastering display / content light / dynamic metadata.
RanmaCanada
28th January 2021, 20:09
Wow, thanks to all of you for all suggestions. I will give this a try. On the long run it seems it is planned that HandBrake simply passthru all mastering display / content light / dynamic metadata.
If it does, that would be fantastic.
ShortKatz
29th January 2021, 18:56
If it does, that would be fantastic.
At least for mastering display / content light metadata there is a PR. I've tested it and it works nicely for me.
Stacey Spears
31st January 2021, 22:55
Thank you both. Is there a BD movie with DoVi and HDR10+ ? Or it's not possible ?
It should be a good thing to get a public algorithm to convert DoVi to HDR10+, I'm trying to find some informations.
Yes, 2018 Robin hood has both. When you put both into the same encoded file, then you may not have a choice which version you see. I think one defaults to HDR10+.
I have both on my disc, but in separate encodes. My next disc will also have SL-HDR2 (Advanced HDR by Technicolor).
SeeMoreDigital
31st January 2021, 23:22
Yes, 2018 Robin hood has both. When you put both into the same encoded file, then you may not have a choice which version you see. I think one defaults to HDR10+.Robin Hood!!! That's a terrible movie. And yes it does default to HDR10+ when played in an OPPO coupled with an HDR10+ and Dolby Vision capable television, such as the 2020/21 Panasonic or Philips models :eek:
Cheers
ShortKatz
9th February 2021, 22:57
By the way, if somebody is interested to give this a try. The latest HandBrake snapshot build now supports 10bit HDR10 (if all filters are disabled and the output codec is 10bit) and passthru of all mastering display / content light metadata. I used it to encode my Wonder Woman UHD Blu-ray for a test.
Lollaskates
1st September 2021, 04:00
For HDR10+ you can extract to JSON using https://github.com/quietvoid/hdr10plus_parser
And then feed the JSON to x265: https://x265.readthedocs.io/en/master/cli.html#cmdoption-dhdr10-info
For Dolby Vision, same principle: https://github.com/quietvoid/dovi_tool#extract-rpu
Feed to x265 with: https://x265.readthedocs.io/en/master/cli.html#cmdoption-dolby-vision-rpu
Also have to specify the profile.
You'll need to figure out what profile your devices are compatible with, most likely converting to profile 8.1 is fine for most cases.
However this does not support cropped Dolby Vision encodes out of the box just yet, a modification to the code is necessary to override the metadata.
Sorry, new to handling DV - Ive got a DV profile 7 MKV , (BL+EL+RPU) that i'm trying to encode with x265. In your instructions above, you mention extracting the RPU and then feeding it to x265.
Am I extracting the RPU as-is and then feeding it to x265 and specifying profile 8.1? or am I using that same tool to convert the RPU from profile 7 to profile 8.1 and then feeding it to x265 while specifying profile 8.1?
Thanks
quietvoid
1st September 2021, 13:22
You would have to convert the RPU to profile 8, and "crop" if necessary for your encode.
The command would look like this:
dovi_tool -m 2 -c extract-rpu
If not cropping AND downscaling, then it gets more complicated since you have to edit the RPU itself..
Lollaskates
2nd September 2021, 00:34
You would have to convert the RPU to profile 8, and "crop" if necessary for your encode.
The command would look like this:
dovi_tool -m 2 -c extract-rpu
If not cropping AND downscaling, then it gets more complicated since you have to edit the RPU itself..
Thanks! For me just encoding it as-is, no cropping or downscaling.
Cheers
LazyNcoder
5th September 2021, 11:51
You would have to convert the RPU to profile 8, and "crop" if necessary for your encode.
The command would look like this:
dovi_tool -m 2 -c extract-rpu
If not cropping AND downscaling, then it gets more complicated since you have to edit the RPU itself..
Let me get this straight. If there is no cropping, should we still use the crop switch?
I want to encode a bluray which has both HDR10+ and DV
for the HDR10+ part, I did it with hdr10plus_parser.exe
Since I heard you cannot crop the video on HDR10+, I didn't crop it.
Now, I want to include both HDR10+ and DV just like the source
Should I use the crop switch?
My plan is to feed both json and rpu to x265
Is this the correct way?
I'd be thankful if any one can help me with this.
Also, does -m 2 convert the profile to 8.1 or 8.2??
What switches should I enable for the DV on x265?
quietvoid
5th September 2021, 14:07
Let me get this straight. If there is no cropping, should we still use the crop switch?
I want to encode a bluray which has both HDR10+ and DV
for the HDR10+ part, I did it with hdr10plus_parser.exe
Since I heard you cannot crop the video on HDR10+, I didn't crop it.
Now, I want to include both HDR10+ and DV just like the source
Should I use the crop switch?
My plan is to feed both json and rpu to x265
Is this the correct way?
I'd be thankful if any one can help me with this.
Also, does -m 2 convert the profile to 8.1 or 8.2??
What switches should I enable for the DV on x265?
You can absolutely crop with HDR10+, and resizing the image as well.
In summary for Dolby Vision...
Source video 2160p with letterbox bars:
encoded as 2160p with letterbox bars: don't use crop.
encoded as 2160p and cropped (no more letterbox bars): use crop.
encoded as 1080p with letterbox bars: you need to edit the active area to set the final letterbox bars size as offsets, see documentation (https://github.com/quietvoid/dovi_tool/blob/main/editor.md).
encoded as 1080p and cropped: use crop.
If you encode HDR10 video (from a HDR10 profile 7 source, such as UHD BD), you should convert to profile 8.1 (which is Dolby Vision w/ HDR10 backwards compatibility)
So that would be mode 2.
In x265, you would add these for Dolby Vision: --dolby-vision-profile 8.1 --dolby-vision-rpu RPU.bin
However if you're not setting VBV rates, x265 will warn you.
And for HDR10+, it's recommended to only add: --dhdr10-info metadata.json
Hopefully this clears up some confusion.
LazyNcoder
5th September 2021, 20:08
You can absolutely crop with HDR10+, and resizing the image as well.
In summary for Dolby Vision...
Source video 2160p with letterbox bars:
encoded as 2160p with letterbox bars: don't use crop.
encoded as 2160p and cropped (no more letterbox bars): use crop.
encoded as 1080p with letterbox bars: you need to edit the active area to set the final letterbox bars size as offsets, see documentation (https://github.com/quietvoid/dovi_tool/blob/main/editor.md).
encoded as 1080p and cropped: use crop.
If you encode HDR10 video (from a HDR10 profile 7 source, such as UHD BD), you should convert to profile 8.1 (which is Dolby Vision w/ HDR10 backwards compatibility)
So that would be mode 2.
In x265, you would add these for Dolby Vision: --dolby-vision-profile 8.1 --dolby-vision-rpu RPU.bin
However if you're not setting VBV rates, x265 will warn you.
And for HDR10+, it's recommended to only add: --dhdr10-info metadata.json
Hopefully this clears up some confusion.
First of all, thank you for being so humble. Couldn't have more respect for someone like you.
So, is there anything needed when we crop a HDR10+ video? something like -c switch with DV? Nothing? Just crop it like a regular video and it's fine?
I did everything you said but I get this error everytime:
Error: fwrite() call failed when writing frame: 3, plane: 1, errno: 32
Output 45 frames in 38.79 seconds (1.16 fps)
Video encoding using x265 failed with exit code: -1073741819 (0xC0000005)
-----------
I figured out this is about empty VBV parameteres.
After adding --vbv-bufsize 20000 --vbv-maxrate 20000 to the command like, the problem goes away but the results has missing DV in it. It's just a HDR10+ video as media info states.
The source is:
"Dolby Vision, Version 1.0, dvhe.07.06, BL+EL+RPU, Blu-ray compatible / SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible"
The result(with --dolby-vision-profile 8.1 --dolby-vision-rpu "E:\1.bin"
"SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible"
Any suggestions?
quietvoid
5th September 2021, 20:16
There's nothing to do for the HDR10+ metadata, it's supposed to be compatible for any resolution.
For MediaInfo to detect Dolby Vision, you need to mux the video to a compatible container.
MKVToolNix version 58 and newer supports this.
Does the x265 log mention if it worked successfully?
It should say this: VES muxing with Dolby Vision RPU file successful in x265
LazyNcoder
7th September 2021, 10:58
There's nothing to do for the HDR10+ metadata, it's supposed to be compatible for any resolution.
For MediaInfo to detect Dolby Vision, you need to mux the video to a compatible container.
MKVToolNix version 58 and newer supports this.
Does the x265 log mention if it worked successfully?
It should say this: VES muxing with Dolby Vision RPU file successful in x265
Thank you very much. I checked the hevc before muxing to MKV. After muxing it, mediainfo shows the DV.
But there is one other thing. I noticed the info on the source:
Dolby Vision, Version 1.0, dvhe.07.06, BL+EL+RPU
But on the encoded file it's:
Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU
Is this OK? I mean the "EL" is missing on the encoded file. I don't know what that is anyways :D
Again, thank you
quietvoid
7th September 2021, 13:08
But there is one other thing. I noticed the info on the source:
Dolby Vision, Version 1.0, dvhe.07.06, BL+EL+RPU
But on the encoded file it's:
Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU
Is this OK? I mean the "EL" is missing on the encoded file. I don't know what that is anyways :DYes it's normal, only profile 7 requires the EL (enhancement layer), which is a separate video track.
Boulder
7th September 2021, 14:15
So is it possible to downscale the normal video to 1440p or 1080p and then combine it with the DV data when encoding?
quietvoid
7th September 2021, 14:23
So is it possible to downscale the normal video to 1440p or 1080p and then combine it with the DV data when encoding?
It should work fine, there's only more steps involved if there are still letterbox bars in the content.
Boulder
7th September 2021, 17:14
It should work fine, there's only more steps involved if there are still letterbox bars in the content.
I never leave the black bars there, I always crop them before denoising and downscaling. So this would be just a case of running dovi_tool -m 2 -c extract-rpu to get the RPU file for the x265 encoding part?
quietvoid
7th September 2021, 17:20
So this would be just a case of running dovi_tool -m 2 -c extract-rpu to get the RPU file for the x265 encoding part?
Yes, normally.
Balling
11th September 2021, 11:17
You can just use ffmpeg -i file.mp4 -strict unofficial file.mp4
You can also change mp4 brand with -brand.
That will preserve DoVi sidedata and will play on LG TVs, triggering Dolby Vision icon.
DoVi support commit needed: https://github.com/FFmpeg/FFmpeg/commit/b8243b3edfe91dcd74621edd5fd4f5f95b7bf8f3
Nico8583
12th October 2021, 14:58
Yes it's normal, only profile 7 requires the EL (enhancement layer), which is a separate video track.
Hi,
Another question about that.
MakeMKV can make a single track profile 7 with BL+EL+RPU but profile 7 is a separate tracks ?! How can it do that ? Is it a real supported format ?Thanks !
SeeMoreDigital
12th October 2021, 15:05
MakeMKV can make a single track profile 7 with BL+EL+RPU but profile 7 is a separate tracks ?! How can it do that ? Is it a real supported format ?Thanks !
Such muxes no longer conform to 'Profile 7'...
quietvoid
12th October 2021, 15:16
Hi,
Another question about that.
MakeMKV can make a single track profile 7 with BL+EL+RPU but profile 7 is a separate tracks ?! How can it do that ? Is it a real supported format ?Thanks !
It just adds the second track NALUs as type 63 (regular HEVC NALUs) and type 62 (RPU). All of this is added after every slice in the BL (HDR10 stream).
Such muxes no longer conform to 'Profile 7'...
Not quite, it is still conformant as a "Combo Dolby Vision stream in a single Dolby Vision PID".
Combo Dolby Vision stream containing the BL, EL and RPU substreams
or BL and RPU substreams shall be carried as a regular AVC/HEVC
stream using the T-STD model.
SeeMoreDigital
12th October 2021, 15:20
Not quite, it is still conformant as a "Combo Dolby Vision stream in a single Dolby Vision PID".Surely our friends over at Dolby have created a new profile number for such muxes ;)
quietvoid
12th October 2021, 15:21
Another profile isn't necessary, this is just another way to carry the information.
SeeMoreDigital
12th October 2021, 15:30
Another profile isn't necessary, this is just another way to carry the information.That does surprise me. It's not like Dolby to make things simple!
Nico8583
12th October 2021, 18:02
Thanks for these informations. So what is the better way to keep DoVi ? Profile 7 like MakeMKV ? And do you think it could be possible to add this way to DoVi tool ? Thanks.
quietvoid
12th October 2021, 18:30
Thanks for these informations. So what is the better way to keep DoVi ? Profile 7 like MakeMKV ? And do you think it could be possible to add this way to DoVi tool ? Thanks.
MakeMKV would still be the simplest way, since it supports both discs and existing dual track MKVs.
Maybe one day dovi_tool can mux both tracks, but it would probably only support the raw streams as input.
SeeMoreDigital
12th October 2021, 21:10
Thanks for these informations. So what is the better way to keep DoVi ? Profile 7 like MakeMKV ? And do you think it could be possible to add this way to DoVi tool ? Thanks.What's the make/model of your playback device and TV?
Nico8583
12th October 2021, 22:59
@quietvoid : Thanks, I would like to make an automated process so MakeMKV is not the best way for me. Is there a quality or compatibility difference between MakeMKV output (BL + EL + RPU in a single track) and dovi_tool (profile 7 BL + EL to single track profile 8.1) from an UHD BD source ?
Edit : The purpose is to encode to x265.
@SeeMoreDigital : Currently a Samsung QLED so without DoVi support but I plan to buy a LG or Sony later so I would like to create my MKV with HDR10+ and DoVi support. My playback device is a Nvidia Shield 2019 Pro currently.
quietvoid
13th October 2021, 00:25
@quietvoid : Thanks, I would like to make an automated process so MakeMKV is not the best way for me.
MakeMKV can be used in CLI, something like this: makemkvcon mkv file:/path/to/disc 1
Is there a quality or compatibility difference between MakeMKV output (BL + EL + RPU in a single track) and dovi_tool (profile 7 BL + EL to single track profile 8.1) from an UHD BD source ?
Edit : The purpose is to encode to x265.
If you plan on encoding with x265, I'm not sure how smooth the process will be if you want to keep the EL.
Otheriwse, the RPU can be used with x265 directly.
In the end, quality depends on the final playback. Only UHD disc players support profile 7 correctly, anything else is going to be the equivalent of profile 8.1.
Because the EL is not used at all. So you should keep that in mind.
Nico8583
13th October 2021, 23:40
Thanks quietvoid again ;)
I would like to not use MakeMKV because while is in a beta state it's free but when the final version will be released I don't know. So I just found yusesope's tool (last GAMMA version) and I can read it can do the same. So I will try it as soon as possible.
The BL+EL+RPU mux into a single track (like yusesope or MakeMKV do) would be a great improvment in dovi_tool :)
Nico8583
14th October 2021, 16:44
I just looked more at dovi_tool usage but the source needs to be a single track dual layer ? So a track from MakeMKV ?
quietvoid
14th October 2021, 16:58
I just looked more at dovi_tool usage but the source needs to be a single track dual layer ? So a track from MakeMKV ?
For what command?
The RPU, for UHD sources, is usually in the 2nd video track, which you can get by demuxing the m2ts.
That video can be used to extract the RPU.
Nico8583
14th October 2021, 19:13
To convert an UHD Blu Ray to profile 8.1. It supports only M2TS as input ? What about if a playlist contains multiple M2TS ?
Same question to extract RPU from an UHD Blu Ray in order to encode with x265 ? And do you if it's possible to encode while keeping both HDR10+ and DoVi metadata ? Thanks.
quietvoid
14th October 2021, 21:08
To convert an UHD Blu Ray to profile 8.1. It supports only M2TS as input ?No, it supports any container for HEVC but you need to use ffmpeg to pipe the data, there are examples in the readme.
What about if a playlist contains multiple M2TS ?You need to merge them into a single file first.
Same question to extract RPU from an UHD Blu Ray in order to encode with x265 ?Same principle as previous, you just need to mux the whole title and then use ffmpeg with dovi_tool.
And do you if it's possible to encode while keeping both HDR10+ and DoVi metadata ? Thanks.Yes, I explained this already here: https://forum.doom9.org/showthread.php?p=1934341#post1934341
Nico8583
14th October 2021, 21:30
Thanks again for all your answers.
So if I want to extract RPU from an UHD BD (FEL or MEL so 2 tracks) to use it with x265, I don't need to use MakeMKV but I can use "ffmpeg -i input.wantiwant -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o RPU.bin" ?
Because the doc says "Extracts Dolby Vision RPU from an single track dual layer encoded file."
Thanks !
quietvoid
14th October 2021, 21:40
Thanks again for all your answers.
So if I want to extract RPU from an UHD BD (FEL or MEL so 2 tracks) to use it with x265, I don't need to use MakeMKV but I can use "ffmpeg -i input.wantiwant -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o RPU.bin" ?
Because the doc says "Extracts Dolby Vision RPU from an single track dual layer encoded file."
Thanks !
Yes, you explicitly need to demux/pipe the video track which contains the RPU, so the EL.
If it's a single track containing both (such as what MakeMKV produces), then there's only one track so the examples work fine.
I will fix the documentation.
Nico8583
15th October 2021, 00:35
Thanks ! I did some tests, for someone who is searching to try it :
With an UHD BD (replace playlist number and paths, video track index if needed) : ffmpeg.exe -playlist 123 -i bluray:"D:\PathToTheUHDBDFolder" -map 0:v:1 -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o RPU.bin
With a MKV from MakeMKV (single track dual layer) : ffmpeg.exe -i "D:\Movie.mkv" -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o RPU.bin
With a MKV from mkvtoolnix (double track) (replace video track index if needed) : ffmpeg.exe -i "D:\Movie.mkv" -map 0:v:1 -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o RPU.bin
RPU is bit to bit identical for all outputs
Nico8583
16th October 2021, 23:26
Another question : is it possible to convert profile 7 dual track (BL + EL) to profile 8.1 with one command ? Or I need to extract BL track + extract RPU from EL track then inject to BL track and remux BL track to MKV ?
And if I do that, does the BL track will keep HDR10+ metadata if include ? Thanks.
quietvoid
16th October 2021, 23:43
Another question : is it possible to convert profile 7 dual track (BL + EL) to profile 8.1 with one command ?
Use the convert command: https://github.com/quietvoid/dovi_tool#convert
The examples do exactly what you're looking for.
You need a single video file first, though.
Otherwise, just extract the RPU and inject it back in the BL, yes.
And if I do that, does the BL track will keep HDR10+ metadata if include ? Thanks.
Yes.
Nico8583
16th October 2021, 23:55
Ok so the convert command can do that from a MakeMKV file. Or do you know another software than MakeMKV or yusesope just to combine BL+EL+RPU into a single track ? Thanks.
quietvoid
17th October 2021, 00:14
Or do you know another software than MakeMKV or yusesope just to combine BL+EL+RPU into a single track ? Thanks.
Not that I'm aware of.
Yomiko
17th October 2021, 02:43
I can think of two approaches but I don't know which one should be preferred.
1) Encode as HDR10, then inject-rpu with dovi_tool
2) Encode with x265 Dolby Vision options
Nico8583
19th October 2021, 09:54
Thanks quietvoid and inject RPU can work only with raw stream ? Is it possible to inject RPU to a stream inside a MKV ? Thanks
quietvoid
19th October 2021, 13:29
Thanks quietvoid and inject RPU can work only with raw stream ? Is it possible to inject RPU to a stream inside a MKV ? Thanks
Only raw stream currently.
In the future I hope it might be possible to make it possible to pipe from any container.
The output is always going to be the raw HEVC, though.
mattl0
28th October 2021, 03:44
Only raw stream currently.
In the future I hope it might be possible to make it possible to pipe from any container.
The output is always going to be the raw HEVC, though.
That is enough That would save a lot of time .
Question 1 with profile 8.1 example : Since injecting rpu into a BL HEVC is longer than simply use the convert command , are they both the same? I did some test and the rpu after each case have the same weight. But are they Injected the same way in the final hevc output?
Question 2 for profile 7 (can be applied to mel too): i saw that it is possible to have a BL and an EL file without rpu. Just need to mux both BL and EL.
With this approch, do you think it would be beneficial to mux the BL with the el, and then inject rpu generated from a json.
So we would have a p7 fel with an new rpu rpu.
A command to completly extract the rpu (so remove rpu to get one hevc file BL+el without rpu /. or two hevc BL + ( El minus the rpu)), would be noce if you ever feel like it, have the time and find it useful. The idea can be wrong too.
mattl0
28th October 2021, 03:54
Last one sorry,
I have a lg c1. It can read profile 8.1 Dolby vision for int player or plex. But how can I know that the rpu is really processed by the tv? Maybe you have a hint for this . Thank you @quietvoid .
A little of topic …maybe someone have an answer here…
I also have an android ugoos am6b+. But I have not convinced that it is decoding dolby p7 fel ok for the rgb tunneling. Resolution is always set to 1080p like if there are a certification limit or wtv else. Not sure if forcing it back to 2160p is ok. I have the feeling that the it is rendered in 1080p and then converted to 2160p for some reason . The process seems shady; from command line, I also can force the box to swtich to 10 bit when in tunneling mode , and the tv accept it…i do not know if this is normal, and what it does mean
quietvoid
28th October 2021, 12:40
Question 1 with profile 8.1 example : Since injecting rpu into a BL HEVC is longer than simply use the convert command , are they both the same? I did some test and the rpu after each case have the same weight. But are they Injected the same way in the final hevc output? If you only have a video that is already Dolby Vision, then just use convert.
Injecting is only useful for videos that were already encoded in HDR10, but don't contain Dolby Vision metadata.
Question 2 for profile 7 (can be applied to mel too): i saw that it is possible to have a BL and an EL file without rpu. Just need to mux both BL and EL. That makes no sense, the EL always contains the RPUs.
There isn't really a use case where editing an existing profile 7 is any useful.
Last one sorry,
I have a lg c1. It can read profile 8.1 Dolby vision for int player or plex. But how can I know that the rpu is really processed by the tv? Maybe you have a hint for this . Thank you @quietvoid .You can try this file: https://forum.makemkv.com/forum/viewtopic.php?p=113537#p113537
You might have to convert it to mp4 for the TV player.
benwaggoner
29th October 2021, 18:24
Last one sorry,
I have a lg c1. It can read profile 8.1 Dolby vision for int player or plex. But how can I know that the rpu is really processed by the tv? Maybe you have a hint for this . Thank you @quietvoid .
The LG will go into a "Dolby Vision" picture mode playing DoVi content. So just hit your settings button and see what picture mode it is in.
A little of topic …maybe someone have an answer here…
I also have an android ugoos am6b+. But I have not convinced that it is decoding dolby p7 fel ok for the rgb tunneling. Resolution is always set to 1080p like if there are a certification limit or wtv else. Not sure if forcing it back to 2160p is ok. I have the feeling that the it is rendered in 1080p and then converted to 2160p for some reason . The process seems shady; from command line, I also can force the box to swtich to 10 bit when in tunneling mode , and the tv accept it…i do not know if this is normal, and what it does mean
RGB 444 takes 1.5x the bandwidth of YUV 422. Depending on HDMI ports and cable, it's not uncommon for there to be enough bandwidth for YUV 422 but not RGB 444, so switching to RGB forces down resolution or frame rate.
You'll want both output and input to be HDMI 2.0, with at least an 18 Gbps rated HDMI cable.
You can make it work with older HDMI versions, but not at RGB 444 4Kp60.
PoeBear
30th October 2021, 04:35
Does the VUI base layer stuff on our custom MEL Profile 8.1 hatchetjobs matter? Per the specs (Dolby Vision Profiles and Levels, V1.3.3), Dolby requires a center-left chromaloc on the video track. But with a UHD Blu-ray/Profile 7 video track, Dolby requires top left chromaloc
Does that mean when playing the DV layer, it's gonna shift all my reds? Or is that something that would only affect if it were an FEL profile 8.1, as it would be expecting a different chroma layout to apply its 12-bit coloring?
mattl0
30th October 2021, 05:11
If you only have a video that is already Dolby Vision, then just use convert.
Injecting is only useful for videos that were already encoded in HDR10, but don't contain Dolby Vision metadata.
That makes no sense, the EL always contains the RPUs.
There isn't really a use case where editing an existing profile 7 is any useful.
You can try this file: https://forum.makemkv.com/forum/viewtopic.php?p=113537#p113537
You might have to convert it to mp4 for the TV player.
Thanks ! This works perfectly i can see all the changes on the video playback on my c1 with internal app.
mattl0
30th October 2021, 05:13
:thanks:The LG will go into a "Dolby Vision" picture mode playing DoVi content. So just hit your settings button and see what picture mode it is in.
RGB 444 takes 1.5x the bandwidth of YUV 422. Depending on HDMI ports and cable, it's not uncommon for there to be enough bandwidth for YUV 422 but not RGB 444, so switching to RGB forces down resolution or frame rate.
You'll want both output and input to be HDMI 2.0, with at least an 18 Gbps rated HDMI cable.
You can make it work with older HDMI versions, but not at RGB 444 4Kp60.
quietvoid
30th October 2021, 06:21
Does the VUI base layer stuff on our custom MEL Profile 8.1 hatchetjobs matter? Per the specs (Dolby Vision Profiles and Levels, V1.3.3), Dolby requires a center-left chromaloc on the video track. But with a UHD Blu-ray/Profile 7 video track, Dolby requires top left chromaloc
Does that mean when playing the DV layer, it's gonna shift all my reds? Or is that something that would only affect if it were an FEL profile 8.1, as it would be expecting a different chroma layout to apply its 12-bit coloring?
The specification only mentions that VUI parameters are required for profile 8.1
Dolby Vision bitstreams for all profiles other than profile 7 may use center-left or top-left luma-chroma siting.
A chroma sample location type VUI is mandatory unless center-left siting is used.
If a chroma sample location type VUI is present, it must be accurate
To me this means that if the base layer was not processed further, and uses top-left, then it is fine.
Usually people reencode profile 7 as profile 8.1 with top-left, and it seems to be OK.
For profile 7 with an EL, it is probably to make sure both video streams are aligned, yes.
Supposedly the new default is top-left for anything HDR10.
PoeBear
30th October 2021, 19:17
The specification only mentions that VUI parameters are required for profile 8.1
Yes, this is why I'm asking. The current trick to getting MEL playback in a container is to repackage it as Profile 8.1, but the HDR10 base layer will be out of spec (unless you change it at encoding)
I'm asking will there be playback issues due to the out-of-spec file? If so, will they be with MEL/FEL playback, or just FEL?
FEL testing really seems impossible for that anyway anyway, with nothing being able to play FEL back in container format, so it was more of a technical question to those that know the DV specs
Usually people reencode profile 7 as profile 8.1 with top-left, and it seems to be OK.
"Seems to be" is what I want to avoid. One can easily miss a small chroma shift and think everything is fine, especially if there's not a known correct image to compare against. If there's a spec, I'd like to adhere to it to avoid future problems. Especially since the Profile 8.1 thing is already a workaround due to a lot of TVs/devices not able to playback DV Profile 7.1
Supposedly the new default is top-left for anything HDR10
Yes when encoding for HDR10 you would set chromaloc to 2 (top-left), but that would go against Dolby's specs for Profile 8.1, which require for center-left (chromaloc 0), hence my inquiry
SeeMoreDigital
30th October 2021, 19:46
You can try this file: https://forum.makemkv.com/forum/viewtopic.php?p=113537#p113537That's a most impressive sample quietvoid ;)
quietvoid
30th October 2021, 20:14
Yes when encoding for HDR10 you would set chromaloc to 2 (top-left), but that would go against Dolby's specs for Profile 8.1, which require for center-left (chromaloc 0), hence my inquiry
I'm confused, my quote says that profile 8.1 can use top-left, and is not required to be center-left.
The conflicting information seems to be coming from the table, where it says that BL signal cross-compatibility ID 1 should be using center-left.
But not far down it says both can be used, for profiles other than 7.
PoeBear
30th October 2021, 22:37
But not far down it says both can be used, for profiles other than 7.
I guess that's where I'm getting confused. Then it says "As of the effective date of this specification, top-left chroma siting is not tested during Dolby Vision SoC or device certification"
Does that mean its device dependent on if it would work or not? Why would they put only center-left in the table, but then say that top-left is okay, but that they say they won't even test for it it? I guess I'm just confused by Dolby's documentation itself... :confused:
quietvoid
30th October 2021, 23:39
Yeah it's not very clear. Either way most (even UHD disc) players ignore the chroma location.
FWIW there are uses of profile 8.1 in streaming services such as Hulu, and they are encoded with top-left in the VUI.
von Suppé
2nd November 2021, 09:39
Interesting and highly educational thread. For someone new to HDR10+ and Dolby Vision, I love the questions asked & answered here on how to be able to handle metadata. And for the available tools I take my hat off to their creator.
Before I go try & do some reencoding some HDR10+/DV content myself, there is something not clear in my understanding the basics. A questions raises about HDR10+.
How is HDR10+ build up? Does it consist of an SDR videostream plus dynamic metadata? In other words, if I should take the dynamic metadata out of a HDR10+ videostream, would "just" a SDR videostream be left?
Or is there more to it? Hope you don't mind me asking.
quietvoid
2nd November 2021, 12:46
How is HDR10+ build up? Does it consist of an SDR videostream plus dynamic metadata? In other words, if I should take the dynamic metadata out of a HDR10+ videostream, would "just" a SDR videostream be left?
Or is there more to it? Hope you don't mind me asking.
HDR10+ is contained within a HDR10 video, so if you take out the metadata you end up with regular HDR10.
Same case with AV1, which can use ITU T-35 metadata OBUs to transport HDR10+ metadata.
benwaggoner
2nd November 2021, 23:04
Yeah it's not very clear. Either way most (even UHD disc) players ignore the chroma location.
FWIW there are uses of profile 8.1 in streaming services such as Hulu, and they are encoded with top-left in the VUI.
And I wouldn't be confident that the stream actually has the chroma located where flagged.
von Suppé
5th November 2021, 10:26
HDR10+ is contained within a HDR10 video, so if you take out the metadata you end up with regular HDR10.
Thanks for your explanation.
On UHD-BD there can be both a HDR10+ BL and Dolby Vision EL. I do understand correctly now, that in case of DV playback, the HDR10+ metadata is simply ignored and instead the DV RPU metadata will be used?
quietvoid
5th November 2021, 14:34
Thanks for your explanation.
On UHD-BD there can be both a HDR10+ BL and Dolby Vision EL. I do understand correctly now, that in case of DV playback, the HDR10+ metadata is simply ignored and instead the DV RPU metadata will be used?
I don't know, either the player makes a decision to prefer HDR10+/Dolby Vision or there's a configuration for it.
shroomM
6th November 2021, 09:54
Hi guys,
very interesting thread indeed, lots of great info!
I have a bit of a reverse question - if I have a DoVi Profile 8.1 stream - can that somehow be converted to Profile 7?
I assume I'd need to generate the EL - my understanding is that MEL is something that could potentially be generated relatively easily?
Then I guess I'd have to use the dovi_tool with convert and option "1" -"Converts the RPU to be MEL compatible.".
Then mux everything in a m2ts stream, one track the HDR10 base stream, the other EL+RPU.
Are there tools available today that would enable me to do this?
von Suppé
7th November 2021, 13:10
Wow, I must say this is fun. I'm learning more & more as I go by.
I did a few test re-encodes. With HDR10+ things went well. With Dolby Vision RPU to 8.1 things went also well. Both formats are triggered on my tv and playback is smooth.
In latest mkvtoolnix, I tried to create a (both HDR10+ and DV EL) dual-track mkv.
As base-layer, I imported a HDR10+ stream, which is a re-encoded HDR10 stream with injected HDR10+ metadata. This video on itself play fine and HDR10+ is triggered on my tv.
I imported an unaltered DoVi EL, which was demuxed from the UHD-BD (in this case, FEL + RPU). Since dual-track DoVi being profile 7, I thought it isn't necessary to extract RPU, change to another profile and inject back into FEL.
After muxing them together with latest mkvtoolnix, I can't get Dolby Vision triggered. Also altering settings in my player resulted in only HDR10+ playback. Which on itself looked good.
Is there anything I missed or is this not possible?
quietvoid
7th November 2021, 18:07
Hi guys,
very interesting thread indeed, lots of great info!
I have a bit of a reverse question - if I have a DoVi Profile 8.1 stream - can that somehow be converted to Profile 7?
I assume I'd need to generate the EL - my understanding is that MEL is something that could potentially be generated relatively easily?
Then I guess I'd have to use the dovi_tool with convert and option "1" -"Converts the RPU to be MEL compatible.".
Then mux everything in a m2ts stream, one track the HDR10 base stream, the other EL+RPU.
Are there tools available today that would enable me to do this?
I've pretty much answered this here: https://github.com/quietvoid/dovi_tool/issues/44
tl;dr it's complicated and no public software solution for it.
I imported an unaltered DoVi EL, which was demuxed from the UHD-BD (in this case, FEL + RPU). Since dual-track DoVi being profile 7, I thought it isn't necessary to extract RPU, change to another profile and inject back into FEL.
After muxing them together with latest mkvtoolnix, I can't get Dolby Vision triggered. Also altering settings in my player resulted in only HDR10+ playback. Which on itself looked good.
Is there anything I missed or is this not possible?
Support with Matroska is limited to single track files currently, see https://gitlab.com/mbunkus/mkvtoolnix/-/wikis/Dolby-Vision-support-status
Nico8583
7th November 2021, 18:21
So just to know, mkvtoolnix can't mux BL + EL as DoVi but only as standalone streams ?
quietvoid
7th November 2021, 18:28
So just to know, mkvtoolnix can't mux BL + EL as DoVi but only as standalone streams ?
Right, it doesn't mux the two together into a single track.
von Suppé
8th November 2021, 12:05
Support with Matroska is limited to single track files currently, see https://gitlab.com/mbunkus/mkvtoolnix/-/wikis/Dolby-Vision-support-status
Thank you for clearing this, quietvoid. I hope mosu will add DoVi dualtrack support in the near future.
Then, as for creating a singletrack video with both HDR10+ and DoVi (no FEL differential video-data, just RPU from MEL or FEL),
And do you if it's possible to encode while keeping both HDR10+ and DoVi metadata ?
Yes, I explained this already here: https://forum.doom9.org/showthread.php?p=1934341#post1934341
Please bear with me. I have read that thread a couple of times but I'm still confused. Am I to understand that I can just add HDR10+ metadata by injecting the metadata.json into a profile 8.1 DoVi stream?
And/or vice versa, adding 8.1 RPU by injecting RPU.bin into a HDR10+ stream?
shroomM
8th November 2021, 13:21
I've pretty much answered this here: https://github.com/quietvoid/dovi_tool/issues/44
tl;dr it's complicated and no public software solution for it.
Wow, ok, interesting, thank you for the reply.
I know it's probably futile, but part of me wants to get it working. :)
So if my understanding is correct, I'd need to:
1. prepare a MEL that would have the same exact frame types and order as the BL
2. recreate the NLQ data - I'm not sure exactly what this is. Can it actually be recreated? Is it per-title or is it the same across all content?
Maybe I'm misunderstanding, but it seems that user in that issue thread made it work somehow.
Do you mind if I ask questions there if he's willing to share the results / procedure?
quietvoid
8th November 2021, 13:56
Please bear with me. I have read that thread a couple of times but I'm still confused. Am I to understand that I can just add HDR10+ metadata by injecting the metadata.json into a profile 8.1 DoVi stream?
And/or vice versa, adding 8.1 RPU by injecting RPU.bin into a HDR10+ stream?Yes, that's how the inject commands work.
2. recreate the NLQ data - I'm not sure exactly what this is. Can it actually be recreated? Is it per-title or is it the same across all content?
Since you're going for MEL, it should be the same all the time.
This is the part of the code for modifying FEL to MEL: https://github.com/quietvoid/dovi_tool/blob/main/dolby_vision/src/rpu/rpu_data_nlq.rs#L97
At this point it's probably simpler for me to just add support for it.
shroomM
8th November 2021, 14:28
Since you're going for MEL, it should be the same all the time.
This is the part of the code for modifying FEL to MEL: https://github.com/quietvoid/dovi_tool/blob/main/dolby_vision/src/rpu/rpu_data_nlq.rs#L97
At this point it's probably simpler for me to just add support for it.
Nice, thanks for the pointer.
Heh, well, if you're gonna add it, that's surely the easiest for me :)
Otherwise, I'll have to look into Rust - my knowledge of it is a little ... rusty :)
quietvoid
8th November 2021, 14:47
It should be possible to do 8 to MEL now, using the git main branch.
I'll update this with a link to binaries soon.
See here for binaries: https://github.com/quietvoid/dovi_tool/actions/runs/1435034743
von Suppé
8th November 2021, 16:50
Okay, I'm getting there more & more. Thanks quietvoid, I simply wasn't aware that it's possible to inject both types of metadata, doh...
Mkvtoolnix not supporting dualtrack DoVi, for FEL I tried creating a mkv another way. First, I muxed the re-encoded HDR10+ stream and the original FEL (no changing of profile) together into BD with tsMuxer. Next, I imported the resulting BD in MakeMKV and remuxed back into mkv. This seems to work out okay.
I'm wondering, is there a way to not have to do this in these two steps? Or any other, better way?
quietvoid
8th November 2021, 17:13
MakeMKV supports the dual track MKVs, and is able to mux them back into a single one.
So you can skip the tsMuxer step.
von Suppé
8th November 2021, 18:05
MakeMKV supports the dual track MKVs...
Hey, I'm lost now. What dual-track mkv do you mean that MakeMKV is supporting? Don't tell me it's the non-working dual-track I created earlier with mkvtoolnix?
Nico8583
8th November 2021, 18:06
MakeMKV can make a single track (BL+EL+RPU) MKV from an UHD BD dual track
quietvoid
8th November 2021, 18:36
Hey, I'm lost now. What dual-track mkv do you mean that MakeMKV is supporting? Don't tell me it's the non-working dual-track I created earlier with mkvtoolnix?
Yea that one. :)
von Suppé
8th November 2021, 21:16
Wow, never thought of that one :D
After import in MakeMKV, this is the log:
- -
MakeMKV v1.16.5 win(x64-release) started
Debug logging enabled, log will be saved as C:\Users\*****/MakeMKV_log.txt
Opening files on harddrive at F:/TEST/DoVi recode/mkvtoolnix/dualtrack.mkv
Hack: Found secondary video stream with RPU, assuming DV EL
Hack: Attaching DV data from second video track to first one and discarding second video track
DEBUG: Code 458759 at U<hG.C@S9^8eLY`6$OjL:213137229
Operation successfully completed
- -
Should I be worried about the bold part?
When I import the ISO that is muxed together with the exact same streams as in the dual-track mkv, MakeMKV log does not show any of the two lines beginning with "Hack: ..."
The first line I can understand of course. But TBH, without the second one I feel more comfortable.
quietvoid
8th November 2021, 22:04
It just means that the second track isn't added, because it was merged with the first one.
It's probably just a warning specifically for MKV input.
shroomM
9th November 2021, 08:09
It should be possible to do 8 to MEL now, using the git main branch.
I'll update this with a link to binaries soon.
See here for binaries: https://github.com/quietvoid/dovi_tool/actions/runs/1435034743
Wow, that was fast, thank you!
I successfully converted a 8.1 RPU to 7 RPU, injected that into my dummy MEL, muxed to Bluray folder with tsMuxer and played it back on an Oppo 203 clone.
The video plays for a while, Dolby Vision is triggered (LG C9 TV), but I think I need to tweak my MEL and check if all the frames are exactly the same type - it seems as if i'm getting some decoding errors on playback after a while. Maybe I'm missing something when creating the MEL.
shroomM
9th November 2021, 22:50
OK, I think i figured out what was wrong - I was using the demux command on a BL+RPU HEVC stream, which seems to produce a corrupted BL.hevc.
I'm currently struggling with one thing - I believe I need to strip RPU from my BL, but as far as I understand this is not currently possible with the dovi_tool, right?
Maybe I'm off here, but if my source is 8.1 BL+RPU and I want to convert that to 7 BL and EL+RPU, I need to strip the RPU from the BL, no?
quietvoid
9th November 2021, 23:34
OK, I think i figured out what was wrong - I was using the demux command on a BL+RPU HEVC stream, which seems to produce a corrupted BL.hevc.
I'm currently struggling with one thing - I believe I need to strip RPU from my BL, but as far as I understand this is not currently possible with the dovi_tool, right?
Maybe I'm off here, but if my source is 8.1 BL+RPU and I want to convert that to 7 BL and EL+RPU, I need to strip the RPU from the BL, no?
demux shouldn't be producing a corrupted stream regardless of BL+RPU or BL+EL+RPU.
It removes both 62/63 type NALUs, resulting in a HDR10 only file.
It should be doing what you're looking for.
If you can reproduce corruption where demux is at fault, then I'd need a sample file.
The only corruptions I've come across so far was when using ffmpeg to demux the initial file.
shroomM
10th November 2021, 07:41
demux shouldn't be producing a corrupted stream regardless of BL+RPU or BL+EL+RPU.
It removes both 62/63 type NALUs, resulting in a HDR10 only file.
It should be doing what you're looking for.
If you can reproduce corruption where demux is at fault, then I'd need a sample file.
The only corruptions I've come across so far was when using ffmpeg to demux the initial file.
OK, good to know, thank you! I remember reading a post of yours about potential ffmpeg problems before, yes.
I will start from the beginning and see if I can pinpoint and reproduce the corruption and let you know if I can produce a sample for you.
shroomM
10th November 2021, 08:21
It was ffmpeg.
My source is Profile 8.1 in an MKV.
Using ffmpeg to extract and pipe the video to dovi_tool produces corrupted BL. Using mkvextract to get the video and feed that into dovi_tool fixes all the problems.
I'll try to produce a sample and submit a bug to ffmpeg.
Thanks for all the pointers!
von Suppé
12th November 2021, 11:01
I have done some re-encodings and metadata handling and am rather familiar now with the workflow. Having limited knowledge about every x265 parameter, generally I use --uhd-bd to be safe for HW players, together with --crf for quality settings.
I want to try some encodings outside of the uhd-bd compatibility. Are there specific parameters or settings to keep an eye on, in the context of adding HDR10+ and/or DoVi metadata?
Boulder
12th November 2021, 11:35
Depends on the HW player. I'd expect some SoC solution not worrying too much about anything as long as it can decode the HEVC video stream in hardware. To be on the safe side, you could set the VBV settings based on the level.
von Suppé
13th November 2021, 11:19
To be on the safe side, you could set the VBV settings based on the level.
Thanks Boulder. I wonder if I could unknowingly set too high a buffer or maxrate, specifically in regard to the second videostream, in case of Dolby Vision with FEL. Next to RPU metadata it holds differential videodata that a DV capable player can "add to" the 10bit baselayer in order to get full 12 bit colordepth. FEL bitrates are generally between 5 and 8 Mb/s. I wonder by setting vbv params high (too high) I'd possibly introduce buffering issues in the playback device.
[EDIT] @quietvoid: Are there constrictions to how the input is written in the "dovi_tool demux file.hevc" code?
Always using *.hevc - I experience seemingly erratic behaviour on acceptance of inputs other than "file.hevc" (which always works). As in no output.
benwaggoner
15th November 2021, 05:52
Depends on the HW player. I'd expect some SoC solution not worrying too much about anything as long as it can decode the HEVC video stream in hardware. To be on the safe side, you could set the VBV settings based on the level.
Yeah, unless you are trying to make an actual UHD Blu-ray disc itself, using Main Tier and an appropriate level should be more than sufficient.
quietvoid
15th November 2021, 14:48
Always using *.hevc - I experience seemingly erratic behaviour on acceptance of inputs other than "file.hevc" (which always works). As in no output.
There should be an error if the file doesn't end in .hevc/h265/265.
von Suppé
15th November 2021, 15:58
There should be an error if the file doesn't end in .hevc/h265/265.
No errors, I always use .hevc files. It's the name itself it seems. I wonder if it has restriction as in word-length or such.
Example: With gMKVExtract I demux a 1 track dual layer mkv. The resulting videostream I rename to gmkvextract.hevc.
Putting that in the demux command and running it, the commandwindow immediately closes again and doesn't yield any output. Renaming the stream to file.hevc and adjusting the commandline, the commandwindows stays working and it does result in BL and EL.
Note that in the workfolder I only have your dovi_tool.exe, the .cmd file and the concerning .hevc file of course. Has it something to do with Windows 7 64 bit maybe?
quietvoid
15th November 2021, 16:37
It might be because of the mkv in the name, but I thought I fixed that.
von Suppé
15th November 2021, 21:43
It might be because of the mkv in the name, but I thought I fixed that.
Hey, I think that's it. Tried 3 times with mkv in it. No dice. Glad you found it.
No worries, I know what to look out for now.
Thank you.
quietvoid
16th November 2021, 16:11
It should be fixed in 1.2.1.
Turns out I only fixed it in the HDR10+ tool.
von Suppé
16th November 2021, 19:49
It should be fixed in 1.2.1.
It is, works like a charm. Thanks for the fix :)
shodan5000
19th November 2021, 15:08
Would anyone happen to know if a GUI for dovi_tool is being worked on? I've tried to learn the CLI method and simply can't figure it out. A GUI for the hdr10plus_tool was created and that helped immensely.
von Suppé
19th November 2021, 17:07
A GUI for the hdr10plus_tool was created and that helped immensely.
I didn't know this. Could you provide a link on where to download?
shodan5000
19th November 2021, 22:21
I didn't know this. Could you provide a link on where to download?
https://github.com/jlw4049/HDR10Plus-Tool-Gui/releases
von Suppé
20th November 2021, 11:12
Thanks for the link.
I don't understand how to inject with this GUI. Could you tell me?
shodan5000
20th November 2021, 12:28
Thanks for the link.
I don't understand how to inject with this GUI. Could you tell me?
Open the application "HDR10PlusParser" and use the user interface to select your HDR10+ video file. Let it run through its process and it will have created a JSON file within the same folder/directory as the video file. The JSON file is what you will select to "inject" in a capable encoder. I use StaxRip personally. Jump over to the StaxRip thread for further details on its particular process of using the JSON file if that is the software you use or want to try.
von Suppé
20th November 2021, 13:02
Ah, I should have said that extracting isn't the problem, but I couldn't figure out how to inject with that same GUI.
I am quite accustomed to use cli with very basic scripts now. It's not so hard to get the gist of it.
von Suppé
23rd November 2021, 10:28
@quietvoid: I came across your post about remuxing HDR10+ to HDR10 here: https://forum.doom9.org/showthread.php?p=1932777#post1932777 which removes HDR10+ metadata, leaving HDR10.
I really feel this options belongs to your HDR10+ tool. If it's possible, is it weird/bold to ask you for implementing it?
kolak
23rd November 2021, 12:51
If TV doesn't do HDR10+ then it will simply skip it, so what is the point removing it ?
Nico8583
23rd November 2021, 13:21
If the TV does HDR10+ and DoVi, it seems to have an issue with some TV so perhaps the reason ?!
von Suppé
23rd November 2021, 13:42
If TV doesn't do HDR10+ then it will simply skip it, so what is the point removing it ?
For me ATM, educational reasons. Additionally, it may come in handy for people having certain player's Dolby Vision issues when both HDR10+ metadata and RPU are present.
Regardless of Dolby Vision, also - as described in the thread I linked - to be able to solve other playback issues of HDR10+ content.
quietvoid
23rd November 2021, 14:08
@quietvoid: I came across your post about remuxing HDR10+ to HDR10 here: https://forum.doom9.org/showthread.php?p=1932777#post1932777 which removes HDR10+ metadata, leaving HDR10.
I really feel this options belongs to your HDR10+ tool. If it's possible, is it weird/bold to ask you for implementing it?
To be honest it doesn't need an implementation in hdr10plus_tool.
You can just use any of demux/convert in dovi_tool with the new --drop-hdr10plus flag.
It doesn't matter if the video has Dolby Vision or not.
It's not in a release yet, though.
If TV doesn't do HDR10+ then it will simply skip it, so what is the point removing it ?
In a perfect world that would be the case. But some devices still cause problems.
kolak
23rd November 2021, 17:40
If the TV does HDR10+ and DoVi, it seems to have an issue with some TV so perhaps the reason ?!
Ok. Did not think about it this way.
Understand that for testing etc. it may be useful.
von Suppé
24th November 2021, 08:26
You can just use any of demux/convert in dovi_tool with the new --drop-hdr10plus flag.
It doesn't matter if the video has Dolby Vision or not.
It's not in a release yet, though.
Great! I'll be patient. Thanks a bunch.
Sosok
13th December 2021, 18:08
Good afternoon, please tell me how to edit the rpu.bin (dolby vision) file to add it to the encoder when making a rip. The source file is 3840x2160, and the final one will be 3840x1608.
shodan5000
17th December 2021, 01:07
Good afternoon, please tell me how to edit the rpu.bin (dolby vision) file to add it to the encoder when making a rip. The source file is 3840x2160, and the final one will be 3840x1608.
Best of luck getting an answer around here.
von Suppé
18th December 2021, 10:04
One can of course take effort to read this thread: https://forum.doom9.org/showthread.php?p=1951093#post1951093
cool advertise
19th January 2022, 21:58
An x265 encode, encoded as both dolby vision profile 8.1, and as hdr10+, will play as dolby vision in supported devices, otherwhise as hdr10+ if supported, otherwhise as hdr10 if this is only supported?
And what is the best compatible container for tvs (through usb hard drive), for a file like that (dv 8.1 + hdr10+), mkv or mp4?
For example the LG oled c15 will read it in mp4 as dolby vision?
benwaggoner
22nd January 2022, 02:29
An x265 encode, encoded as both dolby vision profile 8.1, and as hdr10+, will play as dolby vision in supported devices, otherwhise as hdr10+ if supported, otherwhise as hdr10 if this is only supported?
In theory it should work, but I'm not aware of any real-world testing of this configuration.
And what is the best compatible container for tvs (through usb hard drive), for a file like that (dv 8.1 + hdr10+), mkv or mp4?
For example the LG oled c15 will read it in mp4 as dolby vision?
Always .mp4 for maximum compatibility. The consumer electronics industry generally thinks of .mkv as a hobbyist/piracy thing that's under-documented and somewhat fraught to implement. Conversely, they have battle-tested, security-hardened, fuzz-tested .mp4 demuxers for a couple of decades now.
Given how many security breaches have come from media stack exploits in the last decade, the default is generally to implement the minimum number of features possible in order to reduce surface area available for hacking.
kolak
22nd January 2022, 19:59
Ffmpeg got some updates regarding DOVI.
Boulder
23rd January 2022, 12:47
Ffmpeg got some updates regarding DOVI.
Does that mean that applications like Kodi on SoC devices might be able to output DoVi content at some point, or are there still some things like licensing in the way?
rwill
23rd January 2022, 13:02
Does that mean that applications like Kodi on SoC devices might be able to output DoVi content at some point, or are there still some things like licensing in the way?
I see a bigger problem in certification.
Balling
15th February 2022, 16:36
I see a bigger problem in certification.
Who cares. Mpv works already.
Selur
15th February 2022, 16:40
Who cares.
Everybody that isn't a mpv fanboy,...
Balling
15th February 2022, 16:43
Everybody that isn't a mpv fanboy,...
What else? VLC is very buggy even in 601 vs 709 matrix, no one except mpv supports color managmnet of PAL and SMPTE C primaries. Only mpc-hc support color managment with icc besides mpv, and last only mpv can output PQ swapchain with Dolby Vision. Only mpv supports bt.2020-cl matrix, only mpv supports ICtCp... Etc. It still does not support superwhite though.
Mpv uses only nvidia decoder of YCbCr by default, which is correct compared to Intel's.
Selur
15th February 2022, 17:08
You are aware that this is the video encoding forum, right?
Balling
13th April 2022, 06:49
You are aware that this is the video encoding forum, right?
We are far from encoding reshaped content...
LazyNcoder
27th May 2022, 06:01
I've got one question about the -c option in dovi tool.
How does that work? I mean, sometimes I'm not certain about the exact amount of the letter box, so I maybe leave 2px or 4px up and down.
Does this mess up the encode? I mean, I rather encode in 3120x1616 or 3120x1608 rather than 3120x1606 3120x1604
Does this ruin it? if so, Is there any ways to fix it?
Thanks
von Suppé
27th May 2022, 11:50
-c zeroes L5 metadata. You use it when you have video without black borders being part of it. Should you have a few px left after recoding, you have to set L5 to those values. -QfG-'s scripts can help with this.
See https://forum.doom9.org/showthread.php?t=183479
Depending on your playback equipment, there is a chance that these small black bars will display differently than the black areas that are created to make it fullscreen.
May I ask why you use 3120 width?
LazyNcoder
27th May 2022, 12:07
-c zeroes L5 metadata. You use it when you have video without black borders being part of it. Should you have a few px left after recoding, you have to set L5 to those values. -QfG-'s scripts can help with this.
See https://forum.doom9.org/showthread.php?t=183479
Depending on your playback equipment, there is a chance that these small black bars will display differently than the black areas that are created to make it fullscreen.
Thank you very much. Is there any way to see from what pixel the DV metadata is being applied when it's fullscreen? so I can crop the image very precisely.
May I ask why you use 3120 width?
This is embrassing. I meant 3840. didn't noticed it and copy/pasted it multiple times :D
von Suppé
27th May 2022, 14:23
I think RPU is applied in the so-called 'active area', which I would wildly guess to be the videoresolution minus the L5 offset values. But I can be horribly wrong here; RPU carries a lot of data of which I don't know their meaning. Maybe more knowledgable people want to step in.
Anyways, if I wanna crop very precisely, I load a screenshot in an image editor. Using rectangular selection tool and zoom function, it's easy to determine the black bar sizes with one-pixel-precision.
kolak
28th July 2022, 13:45
As far as I know Dolby processing should be always applied to active area only, so in case of aspect ratios different to UHD frame (so anything like 2.35 etc.) always require specifying crop/active area or whatever is needed by given tool to work on active area only.
Same applies to mastering when you create Dolby masters with XML metadata.
ShortKatz
19th October 2022, 22:39
For Dolby Vision, same principle: https://github.com/quietvoid/dovi_tool#extract-rpu
Feed to x265 with: https://x265.readthedocs.io/en/master/cli.html#cmdoption-dolby-vision-rpu
Also have to specify the profile.
May I ask a question to this. I now extracted the RPU using
ffmpeg -i input.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool extract-rpu - -o RPU.bin
This worked nicely and gave me a 90MB file.
But how do I get the RPU into my encoded video?
First, I have tried it in HandBrake directly (which would be the perfect way). I've added
vbv-bufsize=160000:vbv-maxrate=160000:dolby-vision-profile=8.1:dolby-vision-rpu=/Filepath/RPU.bin
as additional options. But this did not work because of:
encx265: unknown option 'dolby-vision-rpu'
Then I've tried to first encode the video with HandBrake and then inject the RPU back into the final video with:
ffmpeg -i video.m4v -c:v copy -c:a copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool inject-rpu -i - --rpu-in /Filepath/RPU.bin -o final.mp4
But this did not work because of:
Error: RpuInjector: Must be a raw HEVC bitstream file
quietvoid
20th October 2022, 01:00
May I ask a question to this. I now extracted the RPU using
ffmpeg -i input.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool extract-rpu - -o RPU.bin
This worked nicely and gave me a 90MB file.
But how do I get the RPU into my encoded video?
First, I have tried it in HandBrake directly (which would be the perfect way). I've added
vbv-bufsize=160000:vbv-maxrate=160000:dolby-vision-profile=8.1:dolby-vision-rpu=/Filepath/RPU.bin
as additional options. But this did not work because of:
encx265: unknown option 'dolby-vision-rpu'
Then I've tried to first encode the video with HandBrake and then inject the RPU back into the final video with:
ffmpeg -i video.m4v -c:v copy -c:a copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool inject-rpu -i - --rpu-in /Filepath/RPU.bin -o final.mp4
But this did not work because of:
Error: RpuInjector: Must be a raw HEVC bitstream file
x265 supposedly only supports RPU files from CLI, so if Handbrake is using the library it might not be able to.
I think I've seen people use ffmpeg, but I'm not sure if it actually works.
For injecting, you need to be using the raw bitstream, it can't be piped.
So demux first, inject, remux. You also can't output in mp4, it'll just be HEVC with no container.
ShortKatz
20th October 2022, 20:04
Thanks. This turned out to be more complicated than I thought. I was hoping to get an mp4 at the end, that I can play on my AppleTV.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.