Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
mulucy
Posts: 145
Joined: Tue Jan 07, 2020 7:08 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by mulucy »

I am not sure what the deal is. But my Apple TV 4K ( the previous Gen ) plays P7 MEL and P8 with Plex. What's interesting is, Plex plays P5 files with messed-up green or purple colors lol. Infuse Pro falls back to HDR10 with all profiles, but P5. Anybody knows what's happening, is it Plex magic or has Apple added more support via software update?
RESET_9999
Posts: 2383
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

shawnc22 wrote:
Thu Jul 22, 2021 12:12 am
Maybe a better comparison would be taking the profile 5 RPU from one of the Disney+ Marvel or Star Wars films
I just did myself a DV version of the Star Wars New Hope UHD bluray and it looks great!! Very noticeable upgrade in quality(even on the camera comparison) and the luminance /color looks the same as the original profile 5.
https://screenshotcomparison.com/comparison/16048

for those who want to do the same, you have to remove 39 frames from the beginning and add 39 frames at the end. Then the lossless Atmos needs a negative 1627MS delay.
It plays flawlessly on the x700, the shield, and the C8 internal app. I only watched a couple of minutes though but I plan to watch the whole movie this weekend.
The first scene with all the bright white walls is great to expose the shield red push as well, I noticed it right away. The original P5 is clean.

amazing work @Quietvoid

Code: Select all

Video
ID                                       : 4117 (0x1015)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 2 h 4 min
Bit rate                                 : 51.3 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.258
Stream size                              : 44.6 GiB (91%)
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2

Audio #1
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : MLP FBA AC-3 16-ch
Format/Info                              : Meridian Lossless Packing FBA with 16-channel presentation
Commercial name                          : Dolby TrueHD with Dolby Atmos
Muxing mode                              : Stream extension
Codec ID                                 : 131
Duration                                 : 2 h 4 min
Bit rate mode                            : Variable
Bit rate                                 : 640 kb/s
Maximum bit rate                         : 3 705 kb/s
Channel(s)                               : 8 channels
Channel layout                           : L R C LFE Ls Rs Lb Rb
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossless
Stream size                              : 571 MiB (1%)
Language                                 : English
Service kind                             : Complete Main
Number of dynamic objects                : 13
Bed channel count                        : 1 channel
Bed channel configuration                : LFE
Last edited by RESET_9999 on Fri Jul 23, 2021 2:17 am, edited 1 time in total.
Sorry for my English.
G5 / AM6B+ / Denon 7.2.4
DoVi_Scripts
DoVi Playback Devices
mulucy
Posts: 145
Joined: Tue Jan 07, 2020 7:08 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by mulucy »

RESET_9999 wrote:
Fri Jul 23, 2021 2:14 am
shawnc22 wrote:
Thu Jul 22, 2021 12:12 am
Maybe a better comparison would be taking the profile 5 RPU from one of the Disney+ Marvel or Star Wars films
I just did myself a DV version of the Star Wars New Hope UHD bluray and it looks great!! Very noticeable upgrade in quality(even on the camera comparison) and the luminance /color looks the same as the original profile 5.
https://screenshotcomparison.com/comparison/16048

for those who want to do the same, you have to remove 39 frames from the beginning and add 39 frames at the end. Then the lossless Atmos needs a negative 1627MS delay.
It plays flawlessly on the x700, the shield, and the C8 internal app. I only watched a couple of minutes though but I plan to watch the whole movie this weekend.
The first scene with all the bright white walls is great to expose the shield red push as well, I noticed it right away. The original P5 is clean.

amazing work @Quietvoid
Thank you! I read the manual for the tool, but I am confused. Would you mind writing very short examples of combining P5 RPU with HDR10 UHD Disk in the form of script, please?

edit:
Seeing this development makes me so much happier. It's the biggest blow in Disney's face for omitting DV from UHD disks. Fking greedy aholes! Thank you, @Quietvoid!
Last edited by mulucy on Fri Jul 23, 2021 2:25 am, edited 1 time in total.
RESET_9999
Posts: 2383
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

mulucy wrote:
Fri Jul 23, 2021 2:17 am

Thank you! I read the manual for the tool, but I am confused. Would you mind writing very short examples of combining P5 RPU with HDR10 UHD Disk in the form of script, please?
sorry I'm really not the best at explaining things but the cmd-line I used are:

convert p5 to p8:

Code: Select all

dovi_tool.exe -m 3 extract-rpu X:\DV.hevc
inject p8 into HDR10 BL:

Code: Select all

dovi_tool.exe inject-rpu -i X:\HDR10.hevc --rpu_in X:\RPU.bin
Sorry for my English.
G5 / AM6B+ / Denon 7.2.4
DoVi_Scripts
DoVi Playback Devices
mulucy
Posts: 145
Joined: Tue Jan 07, 2020 7:08 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by mulucy »

RESET_9999 wrote:
Fri Jul 23, 2021 2:24 am
mulucy wrote:
Fri Jul 23, 2021 2:17 am

Thank you! I read the manual for the tool, but I am confused. Would you mind writing very short examples of combining P5 RPU with HDR10 UHD Disk in the form of script, please?
sorry I'm really not the best at explaining things but the cmd-line I used are:

convert p5 to p8:

Code: Select all

dovi_tool.exe -m 3 extract-rpu X:\DV.hevc
inject p8 into HDR10 BL:

Code: Select all

dovi_tool.exe inject-rpu -i X:\HDR10.hevc --rpu_in X:\RPU.bin
This explains a lot. Thank you! Another question as X700 owner, what container did you choose for your converted Star Wars movie? AFAIK, X700 does not support MKV. And for creating a container, did you use TSmuxer or another MKV tool? I noticed you mentioned skipping and adding 39 frames, plus delaying the ATMOS track.
Last edited by mulucy on Fri Jul 23, 2021 2:29 am, edited 1 time in total.
RESET_9999
Posts: 2383
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

mulucy wrote:
Fri Jul 23, 2021 2:27 am
This explains a lot. Thank you! Another question as X700 owner, what container did you choose for your converted Star Wars movie? AFAIK, X700 does not support MKV. And for creating a container, did you use TSmuxer or another MKV tool? I noticed you mentioned skipping and adding 30 frames, plus delating the ATMOS track.
TSmuxer
Sorry for my English.
G5 / AM6B+ / Denon 7.2.4
DoVi_Scripts
DoVi Playback Devices
glc650
Posts: 52
Joined: Sun Aug 02, 2020 3:25 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by glc650 »

RESET_9999 wrote:
Fri Jul 23, 2021 2:14 am
I just did myself a DV version of the Star Wars New Hope UHD bluray and it looks great!! Very noticeable upgrade in quality(even on the camera comparison) and the luminance /color looks the same as the original profile 5.
So you are taking a streaming/web-dl version of a movie that has an HDR10 base layer plus RPU and just extracting the RPU and applying that to the HDR10 only (non-DV) blu-ray version of the same movie? Am I understanding this correctly?
mulucy
Posts: 145
Joined: Tue Jan 07, 2020 7:08 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by mulucy »

glc650 wrote:
Fri Jul 23, 2021 3:47 am
RESET_9999 wrote:
Fri Jul 23, 2021 2:14 am
I just did myself a DV version of the Star Wars New Hope UHD bluray and it looks great!! Very noticeable upgrade in quality(even on the camera comparison) and the luminance /color looks the same as the original profile 5.
So you are taking a streaming/web-dl version of a movie that has an HDR10 base layer plus RPU and just extracting the RPU and applying that to the HDR10 only (non-DV) blu-ray version of the same movie? Am I understanding this correctly?
Streaming Web-DL Profile 5 lacks the HDR10. That's why you need to convert it to Profile 8, which is HDR10 backwards compatible. Then use the RPU from Profile 8 and inject it to HDR10 base layer from the UHD Disk. This will retain the same color and luminance, but it will increase the bitrate since the base layer is from UHD Disk.
Lapihin_A
Posts: 12
Joined: Fri Jul 23, 2021 8:44 am

Re: Dolby Vision now possible through MP4 Mux.

Post by Lapihin_A »

RESET_9999 wrote:
Fri Jul 23, 2021 2:14 am
shawnc22 wrote:
Thu Jul 22, 2021 12:12 am
Maybe a better comparison would be taking the profile 5 RPU from one of the Disney+ Marvel or Star Wars films
I just did myself a DV version of the Star Wars New Hope UHD bluray and it looks great!! Very noticeable upgrade in quality(even on the camera comparison) and the luminance /color looks the same as the original profile 5.
https://screenshotcomparison.com/comparison/16048

for those who want to do the same, you have to remove 39 frames from the beginning and add 39 frames at the end. Then the lossless Atmos needs a negative 1627MS delay.
It plays flawlessly on the x700, the shield, and the C8 internal app. I only watched a couple of minutes though but I plan to watch the whole movie this weekend.
The first scene with all the bright white walls is great to expose the shield red push as well, I noticed it right away. The original P5 is clean.

amazing work @Quietvoid

Code: Select all

Video
ID                                       : 4117 (0x1015)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 2 h 4 min
Bit rate                                 : 51.3 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.258
Stream size                              : 44.6 GiB (91%)
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2

Audio #1
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : MLP FBA AC-3 16-ch
Format/Info                              : Meridian Lossless Packing FBA with 16-channel presentation
Commercial name                          : Dolby TrueHD with Dolby Atmos
Muxing mode                              : Stream extension
Codec ID                                 : 131
Duration                                 : 2 h 4 min
Bit rate mode                            : Variable
Bit rate                                 : 640 kb/s
Maximum bit rate                         : 3 705 kb/s
Channel(s)                               : 8 channels
Channel layout                           : L R C LFE Ls Rs Lb Rb
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossless
Stream size                              : 571 MiB (1%)
Language                                 : English
Service kind                             : Complete Main
Number of dynamic objects                : 13
Bed channel count                        : 1 channel
Bed channel configuration                : LFE
RESET_9999 please tell me where did you get Star Wars New Hope WEB-DL DV?
ragico
Posts: 264
Joined: Fri Feb 15, 2019 1:09 am

Re: Dolby Vision now possible through MP4 Mux.

Post by ragico »

RESET_9999 wrote:
Fri Jul 23, 2021 2:14 am
shawnc22 wrote:
Thu Jul 22, 2021 12:12 am
Maybe a better comparison would be taking the profile 5 RPU from one of the Disney+ Marvel or Star Wars films
I just did myself a DV version of the Star Wars New Hope UHD bluray and it looks great!! Very noticeable upgrade in quality(even on the camera comparison) and the luminance /color looks the same as the original profile 5.
https://screenshotcomparison.com/comparison/16048

for those who want to do the same, you have to remove 39 frames from the beginning and add 39 frames at the end. Then the lossless Atmos needs a negative 1627MS delay.
It plays flawlessly on the x700, the shield, and the C8 internal app. I only watched a couple of minutes though but I plan to watch the whole movie this weekend.
The first scene with all the bright white walls is great to expose the shield red push as well, I noticed it right away. The original P5 is clean.

amazing work @Quietvoid

Code: Select all

Video
ID                                       : 4117 (0x1015)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 2 h 4 min
Bit rate                                 : 51.3 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.258
Stream size                              : 44.6 GiB (91%)
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2

Audio #1
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : MLP FBA AC-3 16-ch
Format/Info                              : Meridian Lossless Packing FBA with 16-channel presentation
Commercial name                          : Dolby TrueHD with Dolby Atmos
Muxing mode                              : Stream extension
Codec ID                                 : 131
Duration                                 : 2 h 4 min
Bit rate mode                            : Variable
Bit rate                                 : 640 kb/s
Maximum bit rate                         : 3 705 kb/s
Channel(s)                               : 8 channels
Channel layout                           : L R C LFE Ls Rs Lb Rb
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossless
Stream size                              : 571 MiB (1%)
Language                                 : English
Service kind                             : Complete Main
Number of dynamic objects                : 13
Bed channel count                        : 1 channel
Bed channel configuration                : LFE
As always I am behind with technicals.
I want to try this, Can you explain in easy words how to add 39 frames and remove 39 frames? And these frames add/remove should be done on HDR 10 track? Which program you need to add/remove frames?
And also how do you know that you had to remove/add 39 frames? Is this for this particular film or it applies to all films?
Thanks
RESET_9999
Posts: 2383
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

ragico wrote:
Fri Jul 23, 2021 9:31 am

As always I am behind with technicals.
I want to try this, Can you explain in easy words how to add 39 frames and remove 39 frames? And these frames add/remove should be done on HDR 10 track? Which program you need to add/remove frames?
And also how do you know that you had to remove/add 39 frames? Is this for this particular film or it applies to all films?
Thanks
yeah, this is the complicated part and I'm not sure my English is good enough to write a step-by-step procedure and maybe there's an easier way. If so please someone share the method. Perhaps it would be easier just to screen-capture myself doing it ? I'll do that if you don't understand what I'm trying to explain here.
anyway, AFAIK, you can only split a video stream at keyframes and the chances that frame #39 is a keyframe are low.

So roughly:
First, you find out if there's a frame difference between the disc and the web-dl. I use MPC-BE and control left/right arrow and control-G for that.
Then you have to split the first few seconds and re-encode it which allows you to remove as much frame as you want(i use staxrip/x265 for that).


for some movies , you will have to add frames, in some other movies it will be the same. For the encoding part I tried to use bluray compliant settings (based on AVC bluray specs):

Code: Select all

--crf 15 --preset slower --output-depth 10 --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,0)" --max-cll "0,0" --hdr10 --colorprim bt2020 --colormatrix bt2020nc --transfer smpte2084 --max-luma 1023 --hdr10-opt --no-info --chromaloc 2 --keyint 24 --min-keyint 1 --profile main10 --level-idc 51 --high-tier --aud --sar 1 --hrd --repeat-headers --no-open-gop --ref 5 --rc-lookahead 24 --aq-mode 1 --vbv-maxrate 98000 --vbv-bufsize 98000
if you have to create black frames(25 in this example), here's the vapoursynth staxrip script: (you could also just cut some random black frames in the movie itself)

Code: Select all

clip2 = core.ffms2.Source(r"%source_file%", cachefile = r"%source_temp_file%.ffindex")
clip1 = core.std.BlankClip(clip2,length=25)
clip = clip1+clip2
Sorry for my English.
G5 / AM6B+ / Denon 7.2.4
DoVi_Scripts
DoVi Playback Devices
quietvoid
Posts: 377
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by quietvoid »

RESET_9999 wrote:
Fri Jul 23, 2021 2:14 am
I just did myself a DV version of the Star Wars New Hope UHD bluray and it looks great!! Very noticeable upgrade in quality(even on the camera comparison) and the luminance /color looks the same as the original profile 5.
https://screenshotcomparison.com/comparison/16048
Thanks for this.
To me there seems to be a slight tint change (so maybe whitebalance difference).
Would be pretty complicated to tell if it's just because the HDR10 version was encoded differently.

Also, you shouldn't be reencoding anything at all!
The dovi_tool editor can be used to remove and duplicate metadata so that it matches your second video.

For your example:
you have to remove 39 frames from the beginning and add 39 frames at the end
This can be done with an edit JSON like this:

Code: Select all

{
    "remove": [
        "0-38"
    ],
    "duplicate": [
        {
            "source": last_frame - 1,
            "offset": last_frame - 1,
            "length": 40
        }
    ]
}
For duplicating, the source is a frame number to use the metadata from.
Offset is where the metadata is added back (inclusive) and length is the number of times the same metadata is added.

You can play with the edit until the RPU length matches the video file you're injecting into.
RESET_9999
Posts: 2383
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

damn I wish I knew that last night lol
thank you so much.
Sorry for my English.
G5 / AM6B+ / Denon 7.2.4
DoVi_Scripts
DoVi Playback Devices
manuelrn
Posts: 12
Joined: Fri May 22, 2020 10:39 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by manuelrn »

quietvoid wrote:
Fri Jul 23, 2021 12:45 pm
RESET_9999 wrote:
Fri Jul 23, 2021 2:14 am
I just did myself a DV version of the Star Wars New Hope UHD bluray and it looks great!! Very noticeable upgrade in quality(even on the camera comparison) and the luminance /color looks the same as the original profile 5.
https://screenshotcomparison.com/comparison/16048
Thanks for this.
To me there seems to be a slight tint change (so maybe whitebalance difference).
Would be pretty complicated to tell if it's just because the HDR10 version was encoded differently.

Also, you shouldn't be reencoding anything at all!
The dovi_tool editor can be used to remove and duplicate metadata so that it matches your second video.

For your example:
you have to remove 39 frames from the beginning and add 39 frames at the end
This can be done with an edit JSON like this:

Code: Select all

{
    "remove": [
        "0-38"
    ],
    "duplicate": [
        {
            "source": last_frame - 1,
            "offset": last_frame - 1,
            "length": 40
        }
    ]
}
For duplicating, the source is a frame number to use the metadata from.
Offset is where the metadata is added back (inclusive) and length is the number of times the same metadata is added.

You can play with the edit until the RPU length matches the video file you're injecting into.
Shouldn't the "length" value be 39 instead of 40?

Or is it necessary to apply +1 to the "length" value because the "offset" frame is removed (it is replaced by the new generated frames)?


And another question:
Why are the new frames added before the last frame (and the last frame remains intact) instead of being added at the end of the RPU? (In other words, why last_frame - 1 instead of just last_frame)

Thank you so much for everything!
quietvoid
Posts: 377
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by quietvoid »

manuelrn wrote:
Fri Jul 23, 2021 1:37 pm
Shouldn't the "length" value be 39 instead of 40?

Or is it necessary to apply +1 to the "length" value because the "offset" frame is removed (it is replaced by the new generated frames)?
I just wrote a quick example so it might not be totally correct.

The length is 40 because the offset frame is included and replaced by the source index's metadata.
Maybe that's weird? I don't really expect people to add totally different metadata in the middle of a scene, so replacing shouldn't be an issue.

Edit: I'm not quite sure the above is correct :mrgreen:
I think the metadata is still appended, without replacing anything. This should be simple to test..
Really need to start documenting the editor.

manuelrn wrote:
Fri Jul 23, 2021 1:37 pm
And another question:
Why are the new frames added before the last frame (and the last frame remains intact) instead of being added at the end of the RPU? (In other words, why last_frame - 1 instead of just last_frame)
Since the indices start at 0, the last frame is usually frame count - 1.
Otherwise you would get an error when trying to edit.

I should probably have worded the last_frame as frame_count instead.
Last edited by quietvoid on Fri Jul 23, 2021 1:59 pm, edited 2 times in total.
Post Reply