Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
RESET_9999
Posts: 2105
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

yes, it's by design but I can remove that restriction in the next version.
for workflow 4-3-1, remove at lines 7331-7343: if not "%encode_LL%"=="YES"

replace:

Code: Select all

for /L %%i in (1,1,%count%) do ( 
     if "%encode_LL%"=="YES" if exist "%TEMP%audio_%%i_!T%%i.Lang!.thd" "%ffmpeg_path%" -i "%TEMP%audio_%%i_!T%%i.Lang!.thd" -map 0:0 -c %llcodec% "%TEMP%pcm%%i.%mcont%"& set AL%%i=-add "%TEMP%pcm%%i.%mcont%"#audio:lang=!T%%i.Lang!:name=%mname%!FORCED%%i!
)
for /L %%i in (1,1,%count%) do (
     if exist "%TEMP%audio_%%i_!T%%i.Lang!.thd"	if "%keep_lossless%"=="YES" if not "%encode_LL%"=="YES" "%ffmpeg_path%" -y -i "%TEMP%audio_%%i_!T%%i.Lang!.thd" -map 0:0 -c copy -strict -2 "%TEMP%lossless%%i.mp4" & set AL%%i=-add "%TEMP%lossless%%i.mp4"#audio:lang=!T%%i.Lang!:name=THD!FORCED%%i!
)

for /L %%i in (1,1,%count%) do ( 
     if "%encode_LL%"=="YES" if exist "%TEMP%audio_%%i_!T%%i.Lang!.dts" "%ffmpeg_path%" -i "%TEMP%audio_%%i_!T%%i.Lang!.dts" -map 0:0 -c %llcodec% "%TEMP%pcm%%i.%mcont%"& set AL%%i=-add "%TEMP%pcm%%i.%mcont%"#audio:lang=!T%%i.Lang!:name=%mname%!FORCED%%i!
)
for /L %%i in (1,1,%count%) do (
     if exist "%TEMP%audio_%%i_!T%%i.Lang!.dts"	if "%keep_lossless%"=="YES" if not "%encode_LL%"=="YES" "%ffmpeg_path%" -y -i "%TEMP%audio_%%i_!T%%i.Lang!.dts" -map 0:0 -c copy "%TEMP%lossless%%i.mp4" & set AL%%i=-add "%TEMP%lossless%%i.mp4"#audio:lang=!T%%i.Lang!:name=DTS!FORCED%%i!
)
ans40
Posts: 12
Joined: Thu Sep 07, 2023 7:54 am

Re: Dolby Vision now possible through MP4 Mux.

Post by ans40 »

For injecting both HDR10+ and DV into the same BL, does it matter which you do first?
powdeau
Posts: 45
Joined: Sat Jan 12, 2019 1:01 am

Re: Dolby Vision now possible through MP4 Mux.

Post by powdeau »

@RESET_9999 Do i need to change something in your DaVinci preset for DV generation in 18.6 or is everything the same?
Now I have these settings:
Image
Thanks!
RESET_9999
Posts: 2105
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

ans40 wrote:
Mon Nov 13, 2023 9:12 am
For injecting both HDR10+ and DV into the same BL, does it matter which you do first?
no
powdeau wrote:
Mon Nov 13, 2023 6:21 pm
is everything the same?
yes
DjObama
Posts: 10
Joined: Fri Oct 27, 2023 4:48 pm

FLAC/LPCM lower volume FIX

Post by DjObama »

Hi,
I did some more testing with Flac audio. For some movies after converting trueHD/dts-hd to Flac (i think it applies to lpcm too) the resulting audio track is significantly lower volume. Probably because dts contains metadata that instructs the receiver by how much it should boost the signal and flac/lpcm is just raw audio information. For example Gladiator is a movie for which flac/lpcm is 4,5 dB lower than it could be.
I found a good way to safely increase the signal with ffmpeg. First you have to find by how many dB you can losslessly increase volume with this command:

Code: Select all

ffmpeg -i video.avi -af "volumedetect" -vn -sn -dn -f null /dev/null
This outputs information about how much dB you can increse the volume without going into clipping. For example:

[Parsed_volumedetect_0 @ 0x7f8ba1c121a0] mean_volume: -16.0 dB
[Parsed_volumedetect_0 @ 0x7f8ba1c121a0] max_volume: -5.0 dB
[Parsed_volumedetect_0 @ 0x7f8ba1c121a0] histogram_0db: 87861

Important is only the max_volume
Then use the command to increase the volume by max_volume amount:

Code: Select all

  ffmpeg -i input.wav -af "volume=5dB" output.wav
This command only boosts the overall signal, there is no normalization happening, so it's still a lossless process.

Is it possible to incorporate this process into dovi_scripts @RESET_9999
You can find more information about it under this link (Option 3)
https://superuser.com/questions/323119/ ... ing-ffmpeg
PhantomIceman
Posts: 3
Joined: Sat Jun 20, 2020 12:22 am

Re: Dolby Vision now possible through MP4 Mux.

Post by PhantomIceman »

This may have been answered somewhere within this thread but since makemkv is able to rip the dolby vision layer is it possible to create a dolby vision playable mkv file through mkv or do you have use scripts?
Gatorman
Posts: 79
Joined: Thu Feb 10, 2022 3:47 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Gatorman »

PhantomIceman wrote:
Tue Nov 14, 2023 5:09 pm
This may have been answered somewhere within this thread but since makemkv is able to rip the dolby vision layer is it possible to create a dolby vision playable mkv file through mkv or do you have use scripts?
This really depends on the player you plan on viewing your media on. Checkout the signature under RESET_9999.
More reasons to collect physical media. 2019 Shield TV Pro.
RESET_9999
Posts: 2105
Joined: Mon Aug 05, 2019 7:12 pm

Re: FLAC/LPCM lower volume FIX

Post by RESET_9999 »

DjObama wrote:
Tue Nov 14, 2023 3:45 pm
Hi,
I did some more testing with Flac audio. For some movies after converting trueHD/dts-hd to Flac (i think it applies to lpcm too) the resulting audio track is significantly lower volume.
I'll check it out but I'm pretty sure LPCM is fine.

EDIT: did some tests and the original THD/DTS, flac or lpcm all sound at the same level on my PC.
Anyway, I added -drc_scale 0 in the cli, maybe that will help?
DjObama
Posts: 10
Joined: Fri Oct 27, 2023 4:48 pm

Re: FLAC/LPCM lower volume FIX

Post by DjObama »

RESET_9999 wrote:
Tue Nov 14, 2023 11:29 pm
DjObama wrote:
Tue Nov 14, 2023 3:45 pm
Hi,
I did some more testing with Flac audio. For some movies after converting trueHD/dts-hd to Flac (i think it applies to lpcm too) the resulting audio track is significantly lower volume.
I'll check it out but I'm pretty sure LPCM is fine.

EDIT: did some tests and the original THD/DTS, flac or lpcm all sound at the same level on my PC.
Anyway, I added -drc_scale 0 in the cli, maybe that will help?
Yes, I checked and on PC there is no problem. However on TV there is a significant diffrence. I just checked another movie - Hero (2002), not even a HDR movie, but Flac plays very quiet compared to dts. Can somebody check the flac playback on their tvs/recievers compared to dts-hd tracks? I read about it a bit and seems that dts format boosts the volume while decoding, but it doesn't happen on pc.
skull88
Posts: 57
Joined: Mon Mar 27, 2023 3:08 pm

Re: FLAC/LPCM lower volume FIX

Post by skull88 »

DjObama wrote:
Wed Nov 15, 2023 4:43 pm
RESET_9999 wrote:
Tue Nov 14, 2023 11:29 pm
DjObama wrote:
Tue Nov 14, 2023 3:45 pm
Hi,
I did some more testing with Flac audio. For some movies after converting trueHD/dts-hd to Flac (i think it applies to lpcm too) the resulting audio track is significantly lower volume.
I'll check it out but I'm pretty sure LPCM is fine.

EDIT: did some tests and the original THD/DTS, flac or lpcm all sound at the same level on my PC.
Anyway, I added -drc_scale 0 in the cli, maybe that will help?
Yes, I checked and on PC there is no problem. However on TV there is a significant diffrence. I just checked another movie - Hero (2002), not even a HDR movie, but Flac plays very quiet compared to dts. Can somebody check the flac playback on their tvs/recievers compared to dts-hd tracks? I read about it a bit and seems that dts format boosts the volume while decoding, but it doesn't happen on pc.
Sounds like this is not an issue that should really be troubleshooted on this thread, but on a forum or subreddit relating to your TV or AVR? I recommend you try E-AC3 instead of FLAC, as it is 2nd best alternative if you aren't happy with FLAC playback or adjusting volume on the fly when you watch movies. ;)
ans40
Posts: 12
Joined: Thu Sep 07, 2023 7:54 am

Re: Dolby Vision now possible through MP4 Mux.

Post by ans40 »

RESET_9999 wrote:
Sat Oct 14, 2023 1:35 pm
Trees wrote:
Sat Oct 14, 2023 8:41 am
Quick question; when generating CMv4.0 content (3-1), how does one determine what Mastering Display to use? I assuming higher isn't necessarily better?
2 options:

1- just use the static metadata from your source HDR10
2- check the brightness first with madvr. If 95% of the movie is under 1000nits, use 1000nits MDL else, 4000.

Option 2 is better because some movies have a static MDL of 4000nits but the actual brightness is under 1000nits.
A 4000nits RPU is a lot darker than a 1000nits one regardless of the content's actual brightness and in my opinion, 4000nits MDL + low nits content is wrong without L2 trim passes because if you look at the generated(or original) trims with a 4000nits analysis, they brighten/compensate a lot for the darkness a 4000 rpu brings.

https://slow.pics/c/uVX5iFOD
Using Resolve to generate DV.

BL HDR10: https://ibb.co/fYWDhzp

Thoughts on using a 2000nit MDL? It has a decent amount of scenes over 1000 nits. 4000 seems excessive though, so I'm between 1000 and 2000nit MDL for Resolve DV analysis. TIA :)
skull88
Posts: 57
Joined: Mon Mar 27, 2023 3:08 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by skull88 »

ans40 wrote:
Wed Nov 15, 2023 11:51 pm
RESET_9999 wrote:
Sat Oct 14, 2023 1:35 pm
Trees wrote:
Sat Oct 14, 2023 8:41 am
Quick question; when generating CMv4.0 content (3-1), how does one determine what Mastering Display to use? I assuming higher isn't necessarily better?
2 options:

1- just use the static metadata from your source HDR10
2- check the brightness first with madvr. If 95% of the movie is under 1000nits, use 1000nits MDL else, 4000.

Option 2 is better because some movies have a static MDL of 4000nits but the actual brightness is under 1000nits.
A 4000nits RPU is a lot darker than a 1000nits one regardless of the content's actual brightness and in my opinion, 4000nits MDL + low nits content is wrong without L2 trim passes because if you look at the generated(or original) trims with a 4000nits analysis, they brighten/compensate a lot for the darkness a 4000 rpu brings.

https://slow.pics/c/uVX5iFOD
Using Resolve to generate DV.

BL HDR10: https://ibb.co/fYWDhzp

Thoughts on using a 2000nit MDL? It has a decent amount of scenes over 1000 nits. 4000 seems excessive though, so I'm between 1000 and 2000nit MDL for Resolve DV analysis. TIA :)
This is for Interstellar, and the way a movie is shot, not just plot peaks, should be taken into account when making the choice. A number of poorly lit scenes really demonstrate that 4K may not be ideal for them, but other scenes are much brighter. I marginally prefer a 1K MDL for generation on this one having watched with both 4K and 1K injected RPUs, but I guess you could try 2K as a compromise, it's honestly a toss-up and personal preference on this title in the end. Oh, and if doing yourself, make sure to correctly set L5/blanking on the IMAX shots vs. main timeline blanking. ;)
RESET_9999
Posts: 2105
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

ans40 wrote:
Wed Nov 15, 2023 11:51 pm
Thoughts on using a 2000nit MDL? It has a decent amount of scenes over 1000 nits. 4000 seems excessive though, so I'm between 1000 and 2000nit MDL for Resolve DV analysis. TIA :)
You should update your script, I added more information that makes the decision easier. My initial recommendation was if 95% is under 1000nits , choose 1000nits and for this movie only 2.4% is over 1k. I personally opted for the 1000nits MDL.
But as @skull88 said, we probably should consider the avg_pq too and I'm still thinking about the % (I'm gathering more information). Also, madvr definitely includes the black bars in its measurement so maxfall (without cropping) will always be lower than it is in reality. see: https://slow.pics/c/pV4NXJMB

BTW, here's my Resolve project for this movie, this will save you a lot of time ;)
https://drive.google.com/drive/u/0/fold ... rHG4XNSy8x

Image
Gatorman
Posts: 79
Joined: Thu Feb 10, 2022 3:47 pm

Re: (8-6) x265 HDR

Post by Gatorman »

I've noticed the default x265 HDR encoder settings batch file has a flag to set --max-luma to 1023. Should this be modified if the source file has a MaxCLL of 4000?
More reasons to collect physical media. 2019 Shield TV Pro.
RESET_9999
Posts: 2105
Joined: Mon Aug 05, 2019 7:12 pm

Re: (8-6) x265 HDR

Post by RESET_9999 »

Gatorman wrote:
Thu Nov 16, 2023 1:20 am
I've noticed the default x265 HDR encoder settings batch file has a flag to set --max-luma to 1023. Should this be modified if the source file has a MaxCLL of 4000?
No, the maximum brightness value in 10bits is 1023
in 12bits it's 4095
in 8bits it's 255
Post Reply