Dolby Vision now possible through MP4 Mux.

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

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

quietvoid wrote: Sun Aug 20, 2023 4:40 pm Does Resolve not do automatic scene cut detection?
Do you have an example file?
Ok, strangely I can only reproduce with a full movie.
Original resolve json throws an error but if I inject and then extract it, no more error. The hdr10plus_tool json filesize is also much smaller.

files: https://drive.google.com/drive/u/1/fold ... LhERrp1rL0

Image
Sorry for my English.
G5 / AM6B+ / Denon 7.2.4
DoVi_Scripts
DoVi Playback Devices
thirdmoon
Posts: 35
Joined: Mon Jul 03, 2023 6:17 am

Re: Dolby Vision now possible through MP4 Mux.

Post by thirdmoon »

@thirdmoon which Resolve version do you use?
@RESET_9999 I used 18.5 for HDR10+
I tried generating DV by letting it run for a few min, but DaVinci wouldn't let me export it and gave some error. I ended up generating DV for the entire movie and then used it in 3-1 which worked fine.

But I don't think I can use 3-1 as it takes way too long. I couldn't even finish the full process as it kept getting slower and slower. It was already 4+ hours.
While it takes 30mins in DaVinci.

Comparison of 4K DV vs 1080p + cubic scaling - https://slow.pics/c/kjdYIsBI

I'm pretty happy with the 1080p + cubic scaling result and will stick to it for time being.
Draco1544
Posts: 7
Joined: Sun Dec 18, 2022 12:32 am

Re: Dolby Vision now possible through MP4 Mux.

Post by Draco1544 »

Hi, how I can bake the FEL into the BL. This is included in the @RESET_9999 script ?
chronomac
Posts: 26
Joined: Mon Dec 20, 2021 8:42 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by chronomac »

With option 6-2-7, to create heatmaps and gamut visualizations, is there anyway to have the script read a directory full of screenshots instead of dragging and dropping one at a time?
RESET_9999
Posts: 2421
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

chronomac wrote: Mon Aug 21, 2023 6:32 pm With option 6-2-7, to create heatmaps and gamut visualizations, is there anyway to have the script read a directory full of screenshots instead of dragging and dropping one at a time?
Workflow 6-8-4. Input a mkv file and the script will automatically export heatmaps and gamut png for 50 frames. You can change the number of frames to export at line 76 in the latest beta.
set frame_number=50
Draco1544 wrote: Mon Aug 21, 2023 5:35 pm Hi, how I can bake the FEL into the BL. This is included in the @RESET_9999 script ?
6-9-2 in the latest beta
Sorry for my English.
G5 / AM6B+ / Denon 7.2.4
DoVi_Scripts
DoVi Playback Devices
chronomac
Posts: 26
Joined: Mon Dec 20, 2021 8:42 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by chronomac »

RESET_9999 wrote: Mon Aug 21, 2023 6:36 pmWorkflow 6-8-4. Input a mkv file and the script will automatically export heatmaps and gamut png for 50 frames. You can change the number of frames to export at line 76 in the latest beta.
set frame_number=50
What's the maximum number you can use?
RESET_9999
Posts: 2421
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

chronomac wrote: Mon Aug 21, 2023 10:07 pm What's the maximum number you can use?
the script exports a screenshot every 2000 frames starting at frame 1000. (1000-3000-5000-7000-9000-11000 etc..)
So it depends on your input length.

you could remove a 0 in %%i000 around line 11495 and that would allow a lot more screenshots to be extracted.

Code: Select all

for /L %%i in (1,2,%frame_number%) do (
  echo LoadPlugin("%ffms2%"^) > "%TEMP%%%i.avs"
  echo FFVideoSource("%filepath%%filename%%fileext%", cachefile="%TEMP%1.ffindex"^) >> "%TEMP%%%i.avs" 
  echo scriptClip(""^"  >> "%TEMP%%%i.avs" 
  echo     subtitle("%filename%", size=14, align=7, 4, 25, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Resolution: " + string(width^) + " x " + string(height^) + " @ " + string(framerate^), size=14, align=7, 4, 40, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Frame: %%i000", size=14, align=7, 4, 55, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Picture type: " + Chr(FFPICT_TYPE^), size=14, align=7, 4, 70, text_color=$606060^) >> "%TEMP%%%i.avs"
  echo ""^"^) >> "%TEMP%%%i.avs"
  echo trim(%%i000,%%i000^) >> "%TEMP%%%i.avs"
)
change it to

Code: Select all

for /L %%i in (1,2,%frame_number%) do (
  echo LoadPlugin("%ffms2%"^) > "%TEMP%%%i.avs"
  echo FFVideoSource("%filepath%%filename%%fileext%", cachefile="%TEMP%1.ffindex"^) >> "%TEMP%%%i.avs" 
  echo scriptClip(""^"  >> "%TEMP%%%i.avs" 
  echo     subtitle("%filename%", size=14, align=7, 4, 25, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Resolution: " + string(width^) + " x " + string(height^) + " @ " + string(framerate^), size=14, align=7, 4, 40, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Frame: %%i00", size=14, align=7, 4, 55, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Picture type: " + Chr(FFPICT_TYPE^), size=14, align=7, 4, 70, text_color=$606060^) >> "%TEMP%%%i.avs"
  echo ""^"^) >> "%TEMP%%%i.avs"
  echo trim(%%i00,%%i00^) >> "%TEMP%%%i.avs"
)
Also line 11528 and 11626:
echo noms_images = ['%filename%_Frame_%%i00.tiff'] >> "%TEMP%gamut_map.py"

echo noms_images = ['%filename%_Frame_%%i00.tiff'] >> "%TEMP%heat_map.py"
Sorry for my English.
G5 / AM6B+ / Denon 7.2.4
DoVi_Scripts
DoVi Playback Devices
Draco1544
Posts: 7
Joined: Sun Dec 18, 2022 12:32 am

Re: Dolby Vision now possible through MP4 Mux.

Post by Draco1544 »

How I can check if my mkv is a FEL dual layer or single layer ?
RESET_9999
Posts: 2421
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

Draco1544 wrote: Tue Aug 22, 2023 6:40 am How I can check if my mkv is a FEL dual layer or single layer ?
workflow (2-3)

FYI, there's a small explanation of all the workflows in the TOOLS_READ_ME.txt
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: Sat Aug 19, 2023 12:31 pm It seems, for some reason, the dovi_tool can't generate a rpu from a Resolve hdr10plus json directly but if you just inject the resolve json to an hevc file and then extract it to a new json file, it works.
Resolve generates HDR10+ metadata with SceneFirstFrameIndex starting at 86400, while it's currently expected to start at 0.
I guess maybe a solution is to offset the list of the first frame indices by whatever is the first frame index.

Should be fixed in next version, which is very much due.
Maybe by this weekend.
thirdmoon
Posts: 35
Joined: Mon Jul 03, 2023 6:17 am

Re: Dolby Vision now possible through MP4 Mux.

Post by thirdmoon »

@RESET_9999
How do I create screenshot comparison between HDR.mkv and HDR-DVinjected.mkv to see the difference between HDR and DV.
Thank you.
RESET_9999
Posts: 2421
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

quietvoid wrote: Wed Aug 23, 2023 1:59 am Resolve generates HDR10+ metadata with SceneFirstFrameIndex starting at 86400, while it's currently expected to start at 0.
I guess maybe a solution is to offset the list of the first frame indices by whatever is the first frame index.

Should be fixed in next version, which is very much due.
Maybe by this weekend.
thank you
thirdmoon wrote: Wed Aug 23, 2023 6:49 am @RESET_9999
How do I create screenshot comparison between HDR.mkv and HDR-DVinjected.mkv to see the difference between HDR and DV.
Thank you.
AFAIK, you can't.

The way I did the HDR/DV comparisons below is by capturing the LLDV signal of my bluray player using an HDMI capture card. And different EDIDs will produce different outcomes.
https://mega.nz/folder/1C1gFLYD#lKYXNitCf0Tzg_nf5vhN9g
Sorry for my English.
G5 / AM6B+ / Denon 7.2.4
DoVi_Scripts
DoVi Playback Devices
chronomac
Posts: 26
Joined: Mon Dec 20, 2021 8:42 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by chronomac »

RESET_9999 wrote: Mon Aug 21, 2023 10:26 pm
chronomac wrote: Mon Aug 21, 2023 10:07 pm What's the maximum number you can use?
the script exports a screenshot every 2000 frames starting at frame 1000. (1000-3000-5000-7000-9000-11000 etc..)
So it depends on your input length.

you could remove a 0 in %%i000 around line 11495 and that would allow a lot more screenshots to be extracted.

Code: Select all

for /L %%i in (1,2,%frame_number%) do (
  echo LoadPlugin("%ffms2%"^) > "%TEMP%%%i.avs"
  echo FFVideoSource("%filepath%%filename%%fileext%", cachefile="%TEMP%1.ffindex"^) >> "%TEMP%%%i.avs" 
  echo scriptClip(""^"  >> "%TEMP%%%i.avs" 
  echo     subtitle("%filename%", size=14, align=7, 4, 25, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Resolution: " + string(width^) + " x " + string(height^) + " @ " + string(framerate^), size=14, align=7, 4, 40, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Frame: %%i000", size=14, align=7, 4, 55, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Picture type: " + Chr(FFPICT_TYPE^), size=14, align=7, 4, 70, text_color=$606060^) >> "%TEMP%%%i.avs"
  echo ""^"^) >> "%TEMP%%%i.avs"
  echo trim(%%i000,%%i000^) >> "%TEMP%%%i.avs"
)
change it to

Code: Select all

for /L %%i in (1,2,%frame_number%) do (
  echo LoadPlugin("%ffms2%"^) > "%TEMP%%%i.avs"
  echo FFVideoSource("%filepath%%filename%%fileext%", cachefile="%TEMP%1.ffindex"^) >> "%TEMP%%%i.avs" 
  echo scriptClip(""^"  >> "%TEMP%%%i.avs" 
  echo     subtitle("%filename%", size=14, align=7, 4, 25, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Resolution: " + string(width^) + " x " + string(height^) + " @ " + string(framerate^), size=14, align=7, 4, 40, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Frame: %%i00", size=14, align=7, 4, 55, text_color=$606060^) >> "%TEMP%%%i.avs" 
  echo     subtitle("Picture type: " + Chr(FFPICT_TYPE^), size=14, align=7, 4, 70, text_color=$606060^) >> "%TEMP%%%i.avs"
  echo ""^"^) >> "%TEMP%%%i.avs"
  echo trim(%%i00,%%i00^) >> "%TEMP%%%i.avs"
)
Also line 11528 and 11626:
echo noms_images = ['%filename%_Frame_%%i00.tiff'] >> "%TEMP%gamut_map.py"

echo noms_images = ['%filename%_Frame_%%i00.tiff'] >> "%TEMP%heat_map.py"
Thanks so much for this info.

Another question, unrelated: theoretically, would it be possible to calculate the number of pixels in a frame that extend into P3 and Rec.2020? If so, could you do that for a whole movie? The gamut visualizations are helpful for seeing extensions past Rec. 709 but it would be great to get a more objective, definable number for a movie (ie. 10% of the movie is in the WCG).
RESET_9999
Posts: 2421
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

chronomac wrote: Thu Aug 24, 2023 4:14 pm
Thanks so much for this info.

Another question, unrelated: theoretically, would it be possible to calculate the number of pixels in a frame that extend into P3 and Rec.2020? If so, could you do that for a whole movie? The gamut visualizations are helpful for seeing extensions past Rec. 709 but it would be great to get a more objective, definable number for a movie (ie. 10% of the movie is in the WCG).
yes, it's probably possible but I didn't do that Python script so I don't know. You could ask the author @dorian in this thread:

https://forum.blu-ray.com/showthread.ph ... 42&page=35
Sorry for my English.
G5 / AM6B+ / Denon 7.2.4
DoVi_Scripts
DoVi Playback Devices
chronomac
Posts: 26
Joined: Mon Dec 20, 2021 8:42 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by chronomac »

RESET_9999 wrote: Thu Aug 24, 2023 7:13 pm
chronomac wrote: Thu Aug 24, 2023 4:14 pm
Thanks so much for this info.

Another question, unrelated: theoretically, would it be possible to calculate the number of pixels in a frame that extend into P3 and Rec.2020? If so, could you do that for a whole movie? The gamut visualizations are helpful for seeing extensions past Rec. 709 but it would be great to get a more objective, definable number for a movie (ie. 10% of the movie is in the WCG).
yes, it's probably possible but I didn't do that Python script so I don't know. You could ask the author @dorian in this thread:

https://forum.blu-ray.com/showthread.ph ... 42&page=35
I'll reach out over there.

Another unrelated question, if you don't mind: I recently updated the script and now whenever I use the 4-2 path, to convert a profile 7 DV MKV to profile 8, the output is just a .hevc file. Is that normal? It used to be a fully fledged MKV. To be clear, I muxed that .hevc with the audio, chapters and subtitles of the original MKV without an issue. Plays back fine, as far as I can tell. I just didn't know if the process had changed or if I'm missing a tool for that last step.
Post Reply