Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
shawnc22
Posts: 637
Joined: Tue Jan 21, 2020 7:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by shawnc22 »

Just tried First Man and looks like everything went well. DV and Atmos triggered in plex and here's the mediainfo from the resulting TS:

Code: Select all

General
ID                                       : 1 (0x1)
Complete name                            : Z:\TS\First Man\First Man.ts
Format                                   : MPEG-TS
File size                                : 68.4 GiB
Duration                                 : 2 h 20 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 69.4 Mb/s
Maximum Overall bit rate                 : 35.5 Mb/s

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+EL+RPU / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 2 h 20 min
Bit rate                                 : 65.6 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.330
Stream size                              : 64.6 GiB (94%)
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 1000 cd/m2
Maximum Frame-Average Light Level        : 285 cd/m2

Audio
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3 MLP FBA 16-ch
Format/Info                              : Audio Coding 3 + 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 20 min
Bit rate mode                            : Variable
Bit rate                                 : 448 kb/s
Maximum bit rate                         : 4 533 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                         : Lossy
Stream size                              : 452 MiB (1%)
Language                                 : English
Service kind                             : Complete Main
Number of dynamic objects                : 11
Bed channel count                        : 1 channel
Bed channel configuration                : LFE
Arbigator
Posts: 32
Joined: Fri Feb 28, 2020 9:16 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Arbigator »

shawnc22 wrote:
Wed Mar 11, 2020 4:31 am
Just tried First Man and looks like everything went well. DV and Atmos triggered in plex and here's the mediainfo from the resulting TS:

Code: Select all

General
ID                                       : 1 (0x1)
Complete name                            : Z:\TS\First Man\First Man.ts
Format                                   : MPEG-TS
File size                                : 68.4 GiB
Duration                                 : 2 h 20 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 69.4 Mb/s
Maximum Overall bit rate                 : 35.5 Mb/s

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+EL+RPU / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 2 h 20 min
Bit rate                                 : 65.6 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.330
Stream size                              : 64.6 GiB (94%)
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 1000 cd/m2
Maximum Frame-Average Light Level        : 285 cd/m2

Audio
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3 MLP FBA 16-ch
Format/Info                              : Audio Coding 3 + 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 20 min
Bit rate mode                            : Variable
Bit rate                                 : 448 kb/s
Maximum bit rate                         : 4 533 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                         : Lossy
Stream size                              : 452 MiB (1%)
Language                                 : English
Service kind                             : Complete Main
Number of dynamic objects                : 11
Bed channel count                        : 1 channel
Bed channel configuration                : LFE
Thanks for trying that. I tried it again, but still no luck. Are you demuxing the m2ts using tsMuxer?
shawnc22
Posts: 637
Joined: Tue Jan 21, 2020 7:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by shawnc22 »

yeah, same tsmuxer version that does the initial demuxing and the remuxing at the end.
kws53
Posts: 49
Joined: Sun May 04, 2014 9:09 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by kws53 »

With Plex client on HTPC, should I use the TS dual layer or single layer method? Dual layer being easiest...
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

I agree on everything except on these statements:
mike admin wrote:
Tue Mar 10, 2020 8:16 pm
DV streams may have different profiles and configurations.
Single layer: Video + RPU stream
Double layer: Video (base) layer + Video (extension) layer (difference between 12bit and 10bit picture) + RPU stream.

Profile 7 is always double-layer and may be authored in FEL (full EL) or MEL configuration (minimal EL). In MEL configuration the video extension layer contains all zero pictures (no 12-bit data) and could be safely discarded.
I believe that it is not possible to discard anything.
Regardless of the type of EL (fEL or mEL), in the case of a dvhe.04 or dvhe.07 profile, the Dolby Vision Composer accepts synchronized decoded BL and EL video frames and metadata information and uses metadata to reconstruct 12bit Dolby Vision video.

In support of this hypothesis, I took a look at the data in the header of a NAL RPU:

Code: Select all

############### MEL RPU ###############

forbidden_zero_bit: 0
nal_unit_type: 62
nuh_layer_id: 0
nuh_temporal_id_plus1: 1
rpu_type: 2
rpu_format: 18
vdr_rpu_profile: 1
vdr_rpu_level: 0
vdr_seq_info_present_flag: 1
chroma_resampling_explicit_filter_flag: 0
coefficient_data_type: 0
coefficient_log2_denom: 23
vdr_rpu_normalized_idc: 1
BL_video_full_range_flag: 0
BL_bit_depth_minus8: 2
EL_bit_depth_minus8: 2
vdr_bit_depth_minus_8: 4
spatial_resampling_filter_flag: 0
reserved_zero_3bits: 0
el_spatial_resampling_filter_flag: 1
disable_residual_flag: 0
vdr_dm_metadata_present_flag: 1
use_prev_vdr_rpu_flag: 0
vdr_rpu_id: 0
mapping_color_space: 0
mapping_chroma_format_idc: 0
num_pivots_minus_2: [0, 0, 0]
pred_pivot_value: [[0, 1023], [0, 1023], [0, 1023]]
nlq_method_idc: 0
num_x_partitions_minus1: 2046
num_y_partitions_minus1: 0



############### FEL RPU ###############

forbidden_zero_bit: 0
nal_unit_type: 62
nuh_layer_id: 0
nuh_temporal_id_plus1: 1
rpu_type: 2
rpu_format: 18
vdr_rpu_profile: 1
vdr_rpu_level: 0
vdr_seq_info_present_flag: 1
chroma_resampling_explicit_filter_flag: 0
coefficient_data_type: 0
coefficient_log2_denom: 23
vdr_rpu_normalized_idc: 1
BL_video_full_range_flag: 0
BL_bit_depth_minus8: 2
EL_bit_depth_minus8: 2
vdr_bit_depth_minus_8: 4
spatial_resampling_filter_flag: 0
reserved_zero_3bits: 0
el_spatial_resampling_filter_flag: 1
disable_residual_flag: 0
vdr_dm_metadata_present_flag: 1
use_prev_vdr_rpu_flag: 0
vdr_rpu_id: 0
mapping_color_space: 0
mapping_chroma_format_idc: 0
num_pivots_minus_2: [7, 0, 0]
pred_pivot_value: [[0, 128, 128, 128, 128, 128, 128, 128, 127], [0, 1023], [0, 1023]]
nlq_method_idc: 0
num_x_partitions_minus1: 2046
num_y_partitions_minus1: 0
The vdr_bit_depth parameter specifies the bit depth of the reconstructed Dolby Vision video signal.
This is derived by vdr_bit_depth = vdr_bit_depth_minus8 + 8
vdr_bit_depth_minus8 is equal to 4 in both fEL and mEL stream (so vdr_bit_depth = 12)
I leave you the code to analyze the header of an RPU (HERE)

mike admin wrote:
Tue Mar 10, 2020 8:16 pm
Also, can anyone find a good sample for FEL stream of roughly the same duration - 23 seconds, about 100 MB? Please PM/email me if you have M2TS and I'll produce MKV out of it.
I made two Terminator clips (fEL). I had difficulty cutting the movie so, for safety, I made two clips one of 20sec and one of 40 sec. Find everything HERE
I have not converted the raw HEVC stream to m2ts because I have not followed the events related to tsMuxeR (I have not yet understood why a BL + EL + RPU stream is flagged as dvhe.08).
If someone wants to take care of it, find everything you need at the previous link.

mike admin wrote:
Tue Mar 10, 2020 8:16 pm
Please try both samples and post the results...
At the moment I can't test anything because I don't have any device that supports Dolby Vision.
My Dolby Vision are a series of hexadecimal codes that scroll across the screen :lol:
shawnc22
Posts: 637
Joined: Tue Jan 21, 2020 7:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by shawnc22 »

yusesope wrote:
Wed Mar 11, 2020 3:33 pm
I have not converted the raw HEVC stream to m2ts because I have not followed the events related to tsMuxeR (I have not yet understood why a BL + EL + RPU stream is flagged as dvhe.08).
Is it possible that because it's being flagged as dvhe.08, the EL is being ignored on playback even though the DV flag is triggered? This could explain why somebody previously reported that the credit scene in power rangers did not look like it was in DV even though DV was on. Unfortunately can't do any eye comparison tests on my own as I don't have a DV-capable UHD player either
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

shawnc22 wrote:
Wed Mar 11, 2020 3:55 pm
Is it possible that because it's being flagged as dvhe.08, the EL is being ignored on playback even though the DV flag is triggered? This could explain why somebody previously reported that the credit scene in power rangers did not look like it was in DV even though DV was on.
Could be.
The only profiles that support BL + EL + RPU are 4 and 7 (6 is no longer in use).
mp4muxer should be used for testing purposes.
Image
jkatchy2
Posts: 16
Joined: Tue Mar 10, 2020 2:13 am

Re: Dolby Vision now possible through MP4 Mux.

Post by jkatchy2 »

yusesope wrote:
Wed Mar 11, 2020 4:08 pm
Could be.
The only profiles that support BL + EL + RPU are 4 and 7 (6 is no longer in use).
mp4muxer should be used for testing purposes.
Image
I am trying to use your tool to create BL + EL + RPU, i have extracted BL & EL hevc streams from my mkv using ffmpeg but the tool always exists out at
BL ANALYSYS: 100.0% EL ANALYSYS 0.0% BL_EL_RPU WRITING 89.8%
i tried demuxing with tsMuxer same result .With eac3to it worked , but the playback after muxing with mp4muxer is very dark and colors are washed out .
Using HDD via USB on B9
mattmarsden
Posts: 88
Joined: Mon Sep 03, 2018 10:36 am

Re: Dolby Vision now possible through MP4 Mux.

Post by mattmarsden »

Arbigator wrote:
Wed Mar 11, 2020 12:07 am
shawnc22 wrote:
Tue Mar 10, 2020 11:40 pm
RESET_9999 wrote:
Tue Mar 10, 2020 11:14 pm


yep, I think Doctor Sleep EL is not processed. It gives me an error with V1 tool and with V2 tool , EL analyzing stays at 0%.
Image
I was going to give that a try, too, when I got home, but I can try First Man also. I'm wondering if it might be because the Doctor Sleep disc is also in HDR10+. The EL might be a little different in that case?
That's interesting, I didn't realize it's in HDR10+, though that explains the descriptor in mediainfo. The file did not give any errors in the tool, and it did finish to 100%.
Same with Power Rangers
thetoad
Posts: 251
Joined: Thu Jul 28, 2016 4:18 am

Re: Dolby Vision now possible through MP4 Mux.

Post by thetoad »

the mkv files mike posted when played on my oppo to my sony x940e, they only comes up as hdr10, not dolby vision.

when I play the dolby vision ts files on LG's website (https://4kmedia.org/lg-amaze-dolby-vision-uhd-4k-demo/) they come up as dolby vision
mike admin
Posts: 4107
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Dolby Vision now possible through MP4 Mux.

Post by mike admin »

yusesope wrote:
Wed Mar 11, 2020 3:33 pm
I believe that it is not possible to discard anything.
Regardless of the type of EL (fEL or mEL), in the case of a dvhe.04 or dvhe.07 profile, the Dolby Vision Composer accepts synchronized decoded BL and EL video frames and metadata information and uses metadata to reconstruct 12bit Dolby Vision video.
Ok, I'm reading the Dolby "profiles and levels" spec:

Code: Select all

2.1.1 Notes to profiles
For profile 4:
A new Dolby Vision certified device is able to decode a profile 4 MEL bitstream without instantiating a secondary HEVC decoder for the enhancement layer.

For profile 7:
The MEL can be used for profile 7 to minimize the processing requirements for the enhancement layer and therefore ensure broader use among UltraHD Blu-ray SoCs.

6.2 Annex II: Differentiating MEL and non-MEL bitstreams
Pictures contained in a Dolby Vision bitstream can be encoded as either MEL or non-MEL, not both.

If a Dolby Vision playback device supports Dolby Vision profile 4 and chooses not to instantiate a second HEVC decoder, then it must check for these values in the
reference processing unit of a Dolby Vision bitstream.

If a Dolby Vision playback device supports Dolby Vision profile 7, it can check for these values in the reference processing unit of a Dolby Vision bitstream.
So the rules are indeed different for profile 4 and profile 7.
Profile 4 - the doc explicitly states that the whole secondary decoder may be not instantiated at all (EL data discarded).
Profile 7 - the vague note that knowing about MEL can "minimize the processing requirements for the enhancement layer". I assume the same - no need to instantiate a second HEVC decoder, just generate same gray pictures as in profile 4.

And the fact that "dvdfab method" (BL+MEL RPU only, EL discarded) works, kind of proves that. Am I wrong?
yusesope wrote:
Wed Mar 11, 2020 3:33 pm
vdr_bit_depth_minus8 is equal to 4 in both fEL and mEL stream (so vdr_bit_depth = 12)
Of course, EL is always 12 bit on blu-ray. The question is what exactly is in these 2 extra bits. My hypothesis - in MEL stream all pictures in EL are filled with the same value (zeroes). This is easy to verify though - one just has to decode entire EL from any MEL disc (Joker) and confirm that ALL frames in EL are indeed dark zero pictures. From the sizes of slice NALU it looks that way.
mike admin
Posts: 4107
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Dolby Vision now possible through MP4 Mux.

Post by mike admin »

thetoad wrote:
Wed Mar 11, 2020 5:30 pm
the mkv files mike posted when played on my oppo to my sony x940e, they only comes up as hdr10, not dolby vision.
when I play the dolby vision ts files on LG's website (https://4kmedia.org/lg-amaze-dolby-vision-uhd-4k-demo/) they come up as dolby vision
This could be an explicit container check. Can you please try converting MKV file to TS and see if it changes anything at all.

Code: Select all

ffmpeg -i Joker_BL_EL_RPU.mkv -c copy Joker_BL_EL_RPU.ts
Arbigator
Posts: 32
Joined: Fri Feb 28, 2020 9:16 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Arbigator »

mike admin wrote:
Wed Mar 11, 2020 6:26 pm
thetoad wrote:
Wed Mar 11, 2020 5:30 pm
the mkv files mike posted when played on my oppo to my sony x940e, they only comes up as hdr10, not dolby vision.
when I play the dolby vision ts files on LG's website (https://4kmedia.org/lg-amaze-dolby-vision-uhd-4k-demo/) they come up as dolby vision
This could be an explicit container check. Can you please try converting MKV file to TS and see if it changes anything at all.

Code: Select all

ffmpeg -i Joker_BL_EL_RPU.mkv -c copy Joker_BL_EL_RPU.ts
I converted the mkv files you posted to ts with tsMuxer, and they both playback correctly triggering Dolby Vision on the 2019 Shield.
ragico
Posts: 265
Joined: Fri Feb 15, 2019 1:09 am

Re: Dolby Vision now possible through MP4 Mux.

Post by ragico »

mike admin wrote:
Wed Mar 11, 2020 6:26 pm
thetoad wrote:
Wed Mar 11, 2020 5:30 pm
the mkv files mike posted when played on my oppo to my sony x940e, they only comes up as hdr10, not dolby vision.
when I play the dolby vision ts files on LG's website (https://4kmedia.org/lg-amaze-dolby-vision-uhd-4k-demo/) they come up as dolby vision
This could be an explicit container check. Can you please try converting MKV file to TS and see if it changes anything at all.

Code: Select all

ffmpeg -i Joker_BL_EL_RPU.mkv -c copy Joker_BL_EL_RPU.ts
I too converted your files with tsmuxer. In firestick 4k both files trigger Dolby Vision via Plex app (beta)
In emby app they trigger hdr
mike admin
Posts: 4107
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Dolby Vision now possible through MP4 Mux.

Post by mike admin »

Arbigator wrote:
Wed Mar 11, 2020 9:41 pm
I converted the mkv files you posted to ts with tsMuxer, and they both playback correctly triggering Dolby Vision on the 2019 Shield.
So this IS just a container check, and hardware can use this encoding method. We're good!

ragico wrote:
Wed Mar 11, 2020 10:50 pm
I too converted your files with tsmuxer. In firestick 4k both files trigger Dolby Vision via Plex app (beta). In emby app they trigger hdr
Guys, please make sure to use the very latest tsmuxer from doom9 (the one that supports EL NALUs) or any version of ffmpeg with "-c copy", in order to preserve all data during container conversion.

Code: Select all

ffmpeg -i Joker_BL_EL_RPU.mkv -c copy Joker_BL_EL_RPU.ts
Post Reply