Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
DolbyVisionFTW
Posts: 19
Joined: Tue Feb 02, 2021 2:49 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by DolbyVisionFTW »

WaynosDaBoss wrote:
Sun Jan 02, 2022 9:53 pm
Hi! I am new here as just doing some research on playing DV mkv files via my LG C9 OLED and as there are 396 odd pages to read through I thought I would post as hopefully someone might be able to help me get the answer I am looking for!

I was trying to play some recently aquired DV content over the Plex app on the C9 OLED and noticed the picture was all green / purple and after a quick google discovered this was because the DV format is not being processed / played back correctly. I have done some more digging and found out the source file in question is H.265 DV Profile 5 with EAC3 Atmos which I know the TV supports when using the Netflix, Disney+ apps etc so the native player of the TV should be ok with this format. I then tried taking Plex out of the equasion and played the mkv file back directly from a USB stick and got the same result. I also read somewhere that it wouldnt work when DV is combined with Atmos so I converted the audio from eac3 to standard ac3, remuxed the file but again got the same result.

From what I have read so far it would appear dual layer files which use profile 7 are able to fall back to standard HRD10 and ignore the metadata but as this file is profile 5 single layer this is not possible.

Does anyone know if this file type should be supported or not or if I should just forget about the DV content and try to play standard HDR10 files instead or do I just have a bit of an oddball file here?
From my limited reading of this thread:

Profile 5 does not support HDR10 fallback.

P5 (always single layer) = none-tonemapped DV base layer(green and purple colours) + dynamic metadata in RPU.
RESET_9999
Posts: 2082
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

WaynosDaBoss wrote:
Sun Jan 02, 2022 9:53 pm
playing DV mkv files via my LG C9 OLED
change the container to TS:

https://github.com/justdan96/tsMuxer/releases
nekno
Posts: 56
Joined: Tue Jun 23, 2020 4:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by nekno »

DolbyVisionFTW wrote:
Mon Jan 03, 2022 1:55 am
WaynosDaBoss wrote:
Sun Jan 02, 2022 9:53 pm
From what I have read so far it would appear dual layer files which use profile 7 are able to fall back to standard HRD10 and ignore the metadata but as this file is profile 5 single layer this is not possible.

Does anyone know if this file type should be supported or not or if I should just forget about the DV content and try to play standard HDR10 files instead or do I just have a bit of an oddball file here?
P5 (always single layer) = none-tonemapped DV base layer(green and purple colours) + dynamic metadata in RPU.
Correct, P5 uses BL+RPU with a different color space than HDR10 (IPT), hence the colors are off and there's no HDR10 fallback.
https://web.archive.org/web/20200929014 ... _09_16.pdf

Within the Dolby Vision context, a profile 5 bitstream must use perceptual quantization with reshaping for EOTF; uses Dolby Vision proprietary IPT color space for color primaries and color matrix; uses full range for range; and uses center-left siting for chroma sample location.

Dolby Vision proprietary IPT color space is similar to BT.2100 ICtCp, where I is similar to I, P similar to Cp, and T similar to Ct.
nekno
Posts: 56
Joined: Tue Jun 23, 2020 4:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by nekno »

Is it possible for a single MKV file to contain both P7 and P8.1 RPU data?

That would give a single MKV file that could stream the P8.1 BL+RPU to a streamer and still allow remuxing the MKV to a BDMV folder later, to watch the P7 BL and FEL+RPU on a BD player, e.g., the Sony X700.

Would it work to convert and remux a P7 BL+EL+RPU track in an MKV into two tracks, one BL+RPU P8.1 track and one P7 EL+RPU track?

At least in my playback scenarios, the EL+RPU is never being used from P7 MKV files, I'm just getting HDR10 fallback. So if I could convert the first video track to P8.1 BL+RPU and then remux it with a second video track with P7 EL+RPU, that would give me a single container that could be streamed using P8.1 or remuxed into BDMV for P7.
  1. Using MakeMKV, back up UHD BD to MKV with dvhe.07.06 BL+EL+RPU
  2. Using ffmpeg and dovi_tool, demux BL_EL_RPU.mkv with --el-only to get EL_RPU.hevc
  3. Using ffmpeg and dovi_tool, convert the BL_EL_RPU.mkv RPU to P8.1 with mode 2, with --discard to get BL_RPU.hevc
  4. Using mkvtoolnix, remux BL_RPU.hevc with EL_RPU.hevc and the non-video tracks from BL_EL_RPU.mkv into BL_RPU_EL_RPU.mkv. Use BL_RPU_EL_RPU.mkv for streaming and discard BL_EL_RPU.mkv.
To reverse:
  1. Using ffmpeg and dovi_tool, demux BL_RPU_EL_RPU.mkv to BL.hevc, discarding the EL/RPU
  2. Using tsMuxer, remux BL.hevc with the EL+RPU video track and other tracks from BL_RPU_EL_RPU.mkv into a BDMV folder
Might step 1 even be unnecessary, since a BD player playing P7 should use the EL+RPU track and disregard the RPU in the BL+RPU track?
WaynosDaBoss
Posts: 3
Joined: Sun Jan 02, 2022 9:35 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by WaynosDaBoss »

RESET_9999 wrote:
Mon Jan 03, 2022 2:24 am
WaynosDaBoss wrote:
Sun Jan 02, 2022 9:53 pm
playing DV mkv files via my LG C9 OLED
change the container to TS:

https://github.com/justdan96/tsMuxer/releases
Cool, I will give that a try.

I actually just found this as well and can confirm extracting the hevc video and eac3 from the mkv file and recreating as an mp4 did the trick. I assume thats essentially the same thing as changing to a TS container as well?

https://www.reddit.com/r/ffmpeg/comment ... fmpeg_and/
chros
Posts: 102
Joined: Sun Sep 20, 2020 8:36 am

Re: Dolby Vision now possible through MP4 Mux.

Post by chros »

RESET_9999 wrote:
Wed Dec 29, 2021 4:17 pm
@all
I was testing some hdr10 patterns converted to DV and look what happen on the Shield/X700/C8 with this P8 pattern : https://slow.pics/c/tnFWN04T (there's definitely something wrong with P8/P7 DV on the shield)

Re-did the FEL test files as well, hopefully, they work better on different devices...
https://drive.google.com/drive/u/1/fold ... V0E3VVkhiC
It indeed looks like crap :) Which file is that exactly? EDIT: I guess the "multi pattern DV P8.mp4"
(I wouldn't hold my breath that they fix anything, I came across exactly with this bug that was raised more than 2 years ago, I ended up bending up the 13th (CEC) pin as well :) )

EDIT2: here near the bottom of the page you can find the same clip in different formats (and bitrates, I think the 16 Mbps is enough): DoVi P5 and HDR10 as well (along with SDR), so P5 RPU can be converted to P8 for the HDR10 sample. In that way they (nvidia) can't say that the samples are not valid.
And there's a similar pattern at the beginning of the clip.
WaynosDaBoss
Posts: 3
Joined: Sun Jan 02, 2022 9:35 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by WaynosDaBoss »

RESET_9999 wrote:
Mon Jan 03, 2022 2:24 am
WaynosDaBoss wrote:
Sun Jan 02, 2022 9:53 pm
playing DV mkv files via my LG C9 OLED
change the container to TS:

https://github.com/justdan96/tsMuxer/releases
Awesome! This worked perfectly and is super easy to just quickly remux into a TS file without extracting anything! Quick question, is it preferable to use TS over M2TS?
Pixels
Posts: 2
Joined: Sat Sep 11, 2021 3:00 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Pixels »

I have a laptop that only supports P5 DV in mp4, so I've managed to convert P8 input file into P5, this in turn triggered DV but the video is stuttering. PS: I've tried mp4muxer & Tsmuxer, problem seems the only video player that could trigger DV in my laptop
Can someone help through this..
nekno
Posts: 56
Joined: Tue Jun 23, 2020 4:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by nekno »

Pixels wrote:
Mon Jan 03, 2022 6:06 pm
I have a laptop that only supports P5 DV in mp4, so I've managed to convert P8 input file into P5, this in turn triggered DV but the video is stuttering. PS: I've tried mp4muxer & Tsmuxer, problem seems the only video player that could trigger DV in my laptop
Can someone help through this..
Don't think you can do that.

P5 uses IPT color and isn't compatible with HDR10 or HLG.

P8 uses BT.2020 color and P8.1 uses HDR10 and P8.4 uses HLG.

So there's no path from P8 -> P5.

dovi_tool only supports converting the RPU from P5 -> P8 and then you would presumably extract and apply that RPU to a different video file from a different encoding with an HDR10 BL.

Like if a film is only released on UHD BD in HDR10 and is released on streaming services in DV, which use P5. If you could obtain both encodings, you could theoretically take the P5 RPU, convert it to P8 and apply it to the HDR10 BL to get a P8.1 file, if the encodings otherwise line up. I'm not sure how often or if people are finding that the frames actually line up.
andyy
Posts: 12
Joined: Tue Jan 14, 2020 11:05 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by andyy »

I'm seeing more and more WEB-DL releases with the original P5 RPU converted to P8, I'm guessing for maximum compatibility plus no need to release HDR separately. Is there anything lost in the P5 > P8 conversion?
staknhalo
Posts: 161
Joined: Sun Oct 11, 2020 12:05 am

Re: Dolby Vision now possible through MP4 Mux.

Post by staknhalo »

andyy wrote:
Tue Jan 04, 2022 10:33 am
I'm seeing more and more WEB-DL releases with the original P5 RPU converted to P8, I'm guessing for maximum compatibility plus no need to release HDR separately. Is there anything lost in the P5 > P8 conversion?
From my understanding (someone let me know if wrong) you're only losing the color enhancements + efficiency of the Dolby proprietary color space from p5 - this would mainly be seen on future displays capable of 12bit but possibly could be more banding (technically, not meant obviously or egregiously) or artifacts like that sort when using HDR10 base video vs native p5 one on displays now?

I try to convert all my p5 to p8 for the reasons you listed above.
nekno wrote:
Tue Jan 04, 2022 12:13 am
Im not sure how often or if people are finding that the frames actually line up.
If the DV and HDR10 files are from the same release time and group you're often good to go

Disney disc + web titles can line up no editing needed from time to time

Other than that you'll most likely have to do some editing/trimming, how much and is it worth it up to you - If it requires more than easily trimming a few seconds off at start and/or end with tsmuxer I don't bother and just keep a p5 + HDR10

After watching first 5 mins or so you'll notice RPU out of sync or not - I don't see bright flashes like when FEL is misaligned, just RPU dimming or brightening or something half a second too early or late
dolce
Posts: 1
Joined: Mon Jan 10, 2022 6:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by dolce »

I am an absolute noob at this and wanted some help converting a MKV DV REMUX to MP4 DV.

HDR Format from mediainfo- "Dolby Vision, Version 1.0, dvhe.07.06, BL+EL+RPU, Blu-ray compatible / SMPTE ST 2086, HDR10 compatible"

Audio title- DTS-HD Master Audio / 5.1 / 48 kHz / 3206 kbps / 24-bit

Can someone please provide step by step instructions on how to do this?

I have tried for hours to get my LG OLED to play some files I converted using mp4muxer and dovi_tools but cant figure it out.
darex
Posts: 2
Joined: Thu Jan 13, 2022 8:46 am

Re: Dolby Vision now possible through MP4 Mux.

Post by darex »

I'm having issues with mp4muxer that started recently.
All of a sudden it will not create a valid output file.
It is always 0kB and exits in 10-20 seconds.
I can see that it is using the disk and CPU for that time but then it just stops.
There is no error message and the files used as input have previously worked.
Anyone run into this before?
staknhalo
Posts: 161
Joined: Sun Oct 11, 2020 12:05 am

Re: Dolby Vision now possible through MP4 Mux.

Post by staknhalo »

darex wrote:
Thu Jan 13, 2022 8:49 am
I'm having issues with mp4muxer that started recently.
All of a sudden it will not create a valid output file.
It is always 0kB and exits in 10-20 seconds.
I can see that it is using the disk and CPU for that time but then it just stops.
There is no error message and the files used as input have previously worked.
Anyone run into this before?
That only ever happened to me when trying to make base layer encoded FEL p7 file, it meant stuff is messed up/input was bad.
RESET_9999
Posts: 2082
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

Hi guys, here are some tutorial videos. You just have to edit the bat files with notepad and change the output path and tools path to yours. (no space in path\filename)

tools and script

All you have to do is, download all the tools and folders, edit the paths highlighted in the picture 1 time with notepad, save the bat and then just click on it and chose the desired workflow. I learned how to write scripts just 1 month ago, so forgive my codes, still a lot to learn but i think most of the workflows work but i didnt test them all.... :P

How to make DoVi hybrid bluray remux with Profile 5 DoVi web-dl:
https://www.youtube.com/watch?v=Y394xLUYFKM
* in this example, the p5 dv video is cropped so the rpu needs an L5 active area edit. If your p5 video is not cropped you don't have to edit L5 because the original RPU is already correct.
* in this example I had to duplicate 24 frames. (inclusive. to remove 24 enter 23)
* in case you have to remove 24 frames select the ''removes frames'' workflow and enter 24
* unless the source has invalid L6 metadata, i recommend not editing L6 static metadata.
* if the video to be injected is cropped, select a workflow that says CROP and set L5 top bottom to 0, otherwise, do like in the video

How to convert HDR10plus to DoVi:
https://www.youtube.com/watch?v=z21v9ru_DVw
* if the video is cropped, select a workflow that says CROP and set L5 top bottom to 0, otherwise, do like in the video


How to generate DoVi from madVR measurements:

https://www.youtube.com/watch?v=XG5La55Lf00
* same as hdr10plus, if the video is cropped, select a workflow that says CROP and set L5 top bottom to 0, otherwise, do like in the video
* you have to install lav filters and madvr (double click on the install bat(madvr folder))


Image
Last edited by RESET_9999 on Sat Mar 12, 2022 5:06 am, edited 9 times in total.
Post Reply