Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
Message
Author
MastaG
Posts: 91
Joined: Thu Aug 08, 2019 11:40 am

Re: Dolby Vision now possible through MP4 Mux.

#6721 Post by MastaG » Mon Jun 13, 2022 8:41 pm

I still have some friends with the older 6-series LG OLED models and it seems they only play DV from MP4.
TS/M2TS doesn't work for these models.
Also the same limitations like only lossy audio supported (e)ac3 and no PGS subs (if that's even supported for MP4 containers).
External .srt work.
Tested using both Plex and Emby.

So I guess if you're sharing your videos over internet with Plex or Emby (and they don't exceed bitrate of 100mbit), Profile 8 with MP4/eac3 and external subs is most compatible across all devices.
Also I've been comparing FEL with MEL (profile 8) and the difference aint that much for most titles.

It's only too bad mp4muxer is such a slow application compared to TSMuxer.
I hope in the future somebody could optimize it a bit (making use of multiple threads for example).

Mattl0
Posts: 37
Joined: Mon Apr 26, 2021 6:57 pm

Re: Dolby Vision now possible through MP4 Mux.

#6722 Post by Mattl0 » Mon Jun 13, 2022 10:37 pm

Ho do you know guys what level (l1-l2-l9 etc) the dolbyvision player or sink is able to decode and transmit/or play?

Here I have a lg c1…. With sony x800m2 .

I guess the sony may not be able to decode all the level?

I didn’t hear about those levels exept here 2 years ago or less

deadchip12
Posts: 285
Joined: Thu May 02, 2019 2:49 am

Re: Dolby Vision now possible through MP4 Mux.

#6723 Post by deadchip12 » Wed Jun 15, 2022 5:26 am

Today when I mux an mkv file that has DD+ track into ts file, the audio and video of that ts file is out of sync. Other similar mkv files with DD+ track don't have this problem, only this particular file. So weird. Does anyone know a fix?

realbabilu
Posts: 22
Joined: Sun May 15, 2022 4:23 am

Re: Dolby Vision now possible through MP4 Mux.

#6724 Post by realbabilu » Wed Jun 15, 2022 6:23 pm

MastaG wrote:
Mon Jun 13, 2022 8:41 pm
I still have some friends with the older 6-series LG OLED models and it seems they only play DV from MP4.
TS/M2TS doesn't work for these models.
Also the same limitations like only lossy audio supported (e)ac3 and no PGS subs (if that's even supported for MP4 containers).
External .srt work.
Tested using both Plex and Emby.

So I guess if you're sharing your videos over internet with Plex or Emby (and they don't exceed bitrate of 100mbit), Profile 8 with MP4/eac3 and external subs is most compatible across all devices.
Also I've been comparing FEL with MEL (profile 8) and the difference aint that much for most titles.

It's only too bad mp4muxer is such a slow application compared to TSMuxer.
I hope in the future somebody could optimize it a bit (making use of multiple threads for example).
Yup mp4 usually works better, sync with DD+ audio. DV works perfectly in my TV. TrueHD not supported also with direct usb play.
Sometimes external PGS subs can be work together but must be using simple name like Ambulance 2022.mp4 and the subs with PGS is Ambulance 2022.sup with default external SRT or ASS subtitle for several (ENG use SRT, LOCAL languange using ASS, etc).
Try other muxer using Subler for Mac, that Dolby Vision/Atmos mp4 m4v muxer compatible other than Dolby software, but only works at mac/hackintosh. Maybe faster...
All my test TS result for usb TV direct playing still have outsync problem. Don't know why.

dwalme
Posts: 28
Joined: Sat Dec 10, 2011 2:38 am

Re: Dolby Vision now possible through MP4 Mux.

#6725 Post by dwalme » Thu Jun 16, 2022 1:23 am

I found an error in the script.

Running MODE.H->MODE.1->Workflow.1

This generates a P8 file from an HDR10 movie using MadVR.

If I use an MKV as a source the script runs correctly.

If I use a .TS file as source the scripts has multiple errors. Looks like it may not be demuxing the HEVC track correctly or something. I get a 0 byte HEVC as output.

This is with both v1.3.6 and v1.3.7.

Code: Select all

                                      ****************************
                                      * DoVi_Scripts @RESET_9999 *
                                      ***************************
.
***************************************************************************************************************
 *The output folder by default is the "Dolby-Vision-Tools" Folder, you can change it by editing this bat file
 *Do not move the bat file out of the "Dolby-Vision-Tools" Folder. Make a shortcut instead.
 *Select a mode, a workflow. Drag and drop an input file and wait...
***************************************************************************************************************
.
                                           *****************
                                           * CHOOSE A MODE *
                                           *****************
.
Main Menu
1) MODE.XP= XML & RPU injector
2) MODE.P5= Profile 5 input to Profile 8 HYBRID MAKER
3) MODE.P7= Profile 7 input (BD/MKV/Convert/Mux/Demux/Inject)
4) MODE.H=  HDR10(madVR) and HDR10plus to DoVi maker
5) MODE.B=  Batch muxer: MKV to TS (DV/DD+/SUB)
6) MODE.M=  MIXED: Remover/Audio/Playlist/MPV/Measurer/HDR10plus_injector and more...
7) MODE.F=  RPU Fixer/Editor/Reader/Extractor/Sync-Inspect/
8) MODE.M4= MP4_muxer(P5/P7/P8)
9) Exit

Choice? [1,2,3,4,5,6,7,8,9]?4
                                           *****************
                                           * CHOOSE A MODE *
                                           *****************
ECHO is off.
.
1) MODE.1= HDR10(madVR) or HDR10plus to DoVi maker
2) MODE.2= Batch convert up to 13 HDR10plus videos to DoVi
3) MODE.3= Inject DV from existing measurement file
4) MODE.4= Batch measure a folder with mkv HDR10 files (credit to manni)
5) MODE.5= Back to main menu

Choice? [1,2,3,4,5]?1
                                         *********************
                                         * CHOOSE A WORKFLOW *
                                         *********************
.
1) Workflow.1= Convert 1 video + AUTO L5
2) Workflow.2= Convert 1 video + MANUAL L5
3) Workflow.3= Convert 1 video + MANUAL L5 + TrueHD_to_TrueHD.ac3 + DDP_1536kbps
4) Workflow.4= Convert 1 video + MANUAL L5 + TrueHD_to_TrueHD.ac3
5) Workflow.5= Convert 1 video + MANUAL L5 + DDP_1536kbps
6) Workflow.6= Convert 1 video + AUTO L5 + REMOVE HDR10plus (fire stick TV)
7) Workflow.7= Back to main menu

Choice? [1,2,3,4,5,6,7]?1
----------------------------------------------------------------------------------------------------
--This workflow will convert an HDR10 or HDR10plus video to DoVi and set L5 automatically
--The black bars detection may not be perfectly accurate. It's maybe better to measure them manually
----------------------------------------------------------------------------------------------------
Drag and drop your HDR10 or HDR10plus MKV/MP4/TS file and press enter..."C:\D\Dolby-Vision-Tools\A Few Good Men (1992).2160p.HDR10.h265.TrueHD-Atmos.8ch.ts"
Do you want to crop RPU... y or n ? (y when HDR10-BL is cropped) and/or press enter...n
Measuring the HDR10 video letterbox...
min: 0.0050 cd/m2, max: 4000 cd/m2
tsMuxeR version git-f4fa419. github.com/justdan96/tsMuxer
100.0% complete
Processed 0 video frames
100.0% complete
Flushing write buffer
Demux complete.
Demuxing time: 15 sec
SMPTE ST 2086
HDR10plus metadata not present. Generating DoVi from HDR10 with madVR...
Measuring video file "C:\D\Dolby-Vision-Tools\A Few Good Men (1992).2160p.HDR10.h265.TrueHD-Atmos.8ch.ts" using D3D11 (native)...
Metadata:
  Mastering display luminance: 0.005/4000, gamut: 0.68 0.32, 0.15 0.06, 0.265 0.69, 0.3127 0.329
  MaxCLL: 10000, MaxFALL: 424 nits
Measurements:
  Frames: 198552, MaxCLL 100%: 9500, 99.9%: 5486, MaxFALL: 419, AvgFALL: 23, AvgFMLL: 944 nits
Parsing madVR measurement file...
Error: The system cannot find the file specified. (os error 2)
Press any key to continue . . .
EditConfig {
    mode: 0,
    remove_cmv4: false,
    remove_mapping: false,
    active_area: Some(
        ActiveArea {
            crop: false,
            drop_l5: None,
            presets: Some(
                [
                    ActiveAreaOffsets {
                        id: 0,
                        left: 0,
                        right: 0,
                        top: 0,
                        bottom: 0,
                    },
                ],
            ),
            edits: Some(
                {
                    "all": 0,
                },
            ),
        },
    ),
    remove: None,
    duplicate: None,
    min_pq: None,
    max_pq: None,
    level6: None,
    level9: None,
    level11: None,
}
Parsing RPU file...
Error: The system cannot find the file specified. (os error 2)
EditConfig {
    mode: 0,
    remove_cmv4: false,
    remove_mapping: false,
    active_area: None,
    remove: None,
    duplicate: None,
    min_pq: None,
    max_pq: None,
    level6: Some(
        ExtMetadataBlockLevel6 {
            max_display_mastering_luminance: 4000,
            min_display_mastering_luminance: 50,
            max_content_light_level: 10000,
            max_frame_average_light_level: 424,
        },
    ),
    level9: None,
    level11: None,
}
Parsing RPU file...
Error: The system cannot find the file specified. (os error 2)
"left": 0
"right": 0
"top": 0
"bottom": 0
MDL.max: 4000
MDL.min: 50
Maxcll: 10000
Maxfall: 424
Display P3
Parsing RPU file...
Error: The system cannot find the file specified. (os error 2)
Parsing RPU file...
Error: The system cannot find the file specified. (os error 2)
"The script has completed."
Press any key to continue . . .

RESET_9999
Posts: 2082
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

#6726 Post by RESET_9999 » Thu Jun 16, 2022 3:18 am

dwalme wrote:
Thu Jun 16, 2022 1:23 am
I found an error in the script.
Running MODE.H->MODE.1->Workflow.1
This generates a P8 file from an HDR10 movie using MadVR.
try 1.3.8

dwalme
Posts: 28
Joined: Sat Dec 10, 2011 2:38 am

Re: Dolby Vision now possible through MP4 Mux.

#6727 Post by dwalme » Thu Jun 16, 2022 4:17 am

RESET_9999 wrote:
Thu Jun 16, 2022 3:18 am
dwalme wrote:
Thu Jun 16, 2022 1:23 am
I found an error in the script.
Running MODE.H->MODE.1->Workflow.1
This generates a P8 file from an HDR10 movie using MadVR.
try 1.3.8
Progress but still errors.

Code: Select all

                                      ****************************
                                      * DoVi_Scripts @RESET_9999 *
                                      ***************************
.
***************************************************************************************************************
 *The output folder by default is the "Dolby-Vision-Tools" Folder, you can change it by editing this bat file
 *Do not move the bat file out of the "Dolby-Vision-Tools" Folder. Make a shortcut instead.
 *Select a mode, a workflow. Drag and drop an input file and wait...
***************************************************************************************************************
.
                                           *****************
                                           * CHOOSE A MODE *
                                           *****************
.
Main Menu
1) MODE.XP= XML & RPU injector
2) MODE.P5= Profile 5 input to Profile 8 HYBRID MAKER
3) MODE.P7= Profile 7 input (BD/MKV/Convert/Mux/Demux/Inject)
4) MODE.H=  HDR10(madVR) and HDR10plus to DoVi maker
5) MODE.B=  Batch muxer: MKV to TS (DV/DD+/SUB)
6) MODE.M=  MIXED: Remover/Audio/Playlist/MPV/Measurer/HDR10plus_injector and more...
7) MODE.F=  RPU Fixer/Editor/Reader/Extractor/Sync-Inspect/
8) MODE.M4= MP4_muxer(P5/P7/P8)
9) Exit

Choice? [1,2,3,4,5,6,7,8,9]?4
                                           *****************
                                           * CHOOSE A MODE *
                                           *****************
ECHO is off.
.
1) MODE.1= HDR10(madVR) or HDR10plus to DoVi maker
2) MODE.2= Batch convert up to 13 HDR10plus videos to DoVi
3) MODE.3= Inject DV from existing measurement file
4) MODE.4= Batch measure a folder with mkv HDR10 files (credit to manni)
5) MODE.5= Back to main menu

Choice? [1,2,3,4,5]?1
                                         *********************
                                         * CHOOSE A WORKFLOW *
                                         *********************
.
1) Workflow.1= Convert 1 video + AUTO L5
2) Workflow.2= Convert 1 video + MANUAL L5
3) Workflow.3= Convert 1 video + MANUAL L5 + TrueHD_to_TrueHD.ac3 + DDP_1536kbps
4) Workflow.4= Convert 1 video + MANUAL L5 + TrueHD_to_TrueHD.ac3
5) Workflow.5= Convert 1 video + MANUAL L5 + DDP_1536kbps
6) Workflow.6= Convert 1 video + AUTO L5 + REMOVE HDR10plus (fire stick TV)
7) Workflow.7= Back to main menu

Choice? [1,2,3,4,5,6,7]?1
----------------------------------------------------------------------------------------------------
--This workflow will convert an HDR10 or HDR10plus video to DoVi and set L5 automatically
--The black bars detection may not be perfectly accurate. It's maybe better to measure them manually
----------------------------------------------------------------------------------------------------
Drag and drop your HDR10 or HDR10plus MKV/MP4/TS file and press enter...C:\D\Dolby-Vision-Tools\afgm-00001.ts
Do you want to crop RPU... y or n ? (y when HDR10-BL is cropped) and/or press enter...n
ffmpeg version 5.0.1-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
[mpegts @ 0000023bec450540] start time for stream 3 is not set in estimate_timings_from_pts
[mpegts @ 0000023bec450540] start time for stream 4 is not set in estimate_timings_from_pts
[mpegts @ 0000023bec450540] start time for stream 5 is not set in estimate_timings_from_pts
[mpegts @ 0000023bec450540] start time for stream 6 is not set in estimate_timings_from_pts
[mpegts @ 0000023bec450540] start time for stream 7 is not set in estimate_timings_from_pts
[mpegts @ 0000023bec450540] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[mpegts @ 0000023bec450540] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[mpegts @ 0000023bec450540] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[mpegts @ 0000023bec450540] Could not find codec parameters for stream 6 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[mpegts @ 0000023bec450540] Could not find codec parameters for stream 7 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpegts, from 'C:\D\Dolby-Vision-Tools\afgm-00001.ts':
  Duration: 02:18:01.28, start: 11.645667, bitrate: 54956 kb/s
  Program 1
  Stream #0:0[0x1011]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn
  Stream #0:1[0x1100](eng): Audio: truehd (AC-3 / 0x332D4341), 48000 Hz, 7.1, s32 (24 bit)
  Stream #0:2[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 640 kb/s
  Stream #0:3[0x12a0](eng): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
  Stream #0:4[0x12a1](eng): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
  Stream #0:5[0x12a2](eng): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
  Stream #0:6[0x12a3](eng): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
  Stream #0:7[0x12a4](eng): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
Output #0, matroska, to 'I:\TEMP\chunk.mkv':
  Metadata:
    encoder         : Lavf59.16.100
  Stream #0:0: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn
  Stream #0:1(eng): Audio: truehd ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, 7.1, s32 (24 bit)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 7175 fps=917 q=-1.0 Lsize= 2081513kB time=00:05:00.00 bitrate=56839.2kbits/s speed=38.3x
video:1908797kB audio:170105kB subtitle:0kB other streams:0kB global headers:1kB muxing overhead: 0.125547%
Measuring the HDR10 video letterbox...
min: 0.0050 cd/m2, max: 4000 cd/m2
tsMuxeR version git-f4fa419. github.com/justdan96/tsMuxer
100.0% complete
Processed 0 video frames
100.0% complete
Flushing write buffer
Demux complete.
Demuxing time: 14 sec
SMPTE ST 2086
HDR10plus metadata not present. Generating DoVi from HDR10 with madVR...
Measuring video file "C:\D\Dolby-Vision-Tools\afgm-00001.ts" using D3D11 (native)...
Metadata:
  Mastering display luminance: 0.005/4000, gamut: 0.68 0.32, 0.15 0.06, 0.265 0.69, 0.3127 0.329
  MaxCLL: 10000, MaxFALL: 424 nits
Measurements:
  Frames: 198552, MaxCLL 100%: 9500, 99.9%: 5486, MaxFALL: 419, AvgFALL: 23, AvgFMLL: 944 nits
Parsing madVR measurement file...
Generating metadata: Profile 8.1 (HDR10)...
Generated metadata for 198552 frames
Done.
EditConfig {
    mode: 0,
    remove_cmv4: false,
    remove_mapping: false,
    active_area: Some(
        ActiveArea {
            crop: false,
            drop_l5: None,
            presets: Some(
                [
                    ActiveAreaOffsets {
                        id: 0,
                        left: 0,
                        right: 0,
                        top: 280,
                        bottom: 280,
                    },
                ],
            ),
            edits: Some(
                {
                    "all": 0,
                },
            ),
        },
    ),
    remove: None,
    duplicate: None,
    min_pq: None,
    max_pq: None,
    level6: None,
    level9: None,
    level11: None,
}
Parsing RPU file...
Editing active area offsets...
Final metadata length: 198552
Writing RPU file...
EditConfig {
    mode: 0,
    remove_cmv4: false,
    remove_mapping: false,
    active_area: None,
    remove: None,
    duplicate: None,
    min_pq: None,
    max_pq: None,
    level6: Some(
        ExtMetadataBlockLevel6 {
            max_display_mastering_luminance: 4000,
            min_display_mastering_luminance: 50,
            max_content_light_level: 10000,
            max_frame_average_light_level: 424,
        },
    ),
    level9: None,
    level11: None,
}
Parsing RPU file...
Final metadata length: 198552
Writing RPU file...
"left": 0
"right": 0
"top": 280
"bottom": 280
MDL.max: 4000
MDL.min: 50
Maxcll: 10000
Maxfall: 424
Display P3
injecting RPU-L6-L5.bin ...
Parsing RPU file...
Processing input video for frame order info...

Warning: mismatched lengths. video 0, RPU 198552
Metadata will be skipped at the end to match video length

Rewriting file with interleaved RPU NALs..
Parsing RPU file...
{
  "dovi_profile": 8,
  "header": {
    "rpu_nal_prefix": 25,
    "rpu_type": 2,
    "rpu_format": 18,
    "vdr_rpu_profile": 1,
    "vdr_rpu_level": 0,
    "vdr_seq_info_present_flag": true,
    "chroma_resampling_explicit_filter_flag": false,
    "coefficient_data_type": 0,
    "coefficient_log2_denom": 23,
    "vdr_rpu_normalized_idc": 1,
    "bl_video_full_range_flag": false,
    "bl_bit_depth_minus8": 2,
    "el_bit_depth_minus8": 2,
    "vdr_bit_depth_minus_8": 4,
    "spatial_resampling_filter_flag": false,
    "reserved_zero_3bits": 0,
    "el_spatial_resampling_filter_flag": false,
    "disable_residual_flag": true,
    "vdr_dm_metadata_present_flag": true,
    "use_prev_vdr_rpu_flag": false,
    "prev_vdr_rpu_id": 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": null,
    "nlq_num_pivots_minus2": null,
    "nlq_pred_pivot_value": null,
    "num_x_partitions_minus1": 0,
    "num_y_partitions_minus1": 0
  },
  "rpu_data_mapping": {
    "mapping_idc": [
      [
        0
      ],
      [
        0
      ],
      [
        0
      ]
    ],
    "mapping_param_pred_flag": [
      [
        false
      ],
      [
        false
      ],
      [
        false
      ]
    ],
    "num_mapping_param_predictors": [
      [
        0
      ],
      [
        0
      ],
      [
        0
      ]
    ],
    "diff_pred_part_idx_mapping_minus1": [
      [],
      [],
      []
    ],
    "poly_order_minus1": [
      [
        0
      ],
      [
        0
      ],
      [
        0
      ]
    ],
    "linear_interp_flag": [
      [
        false
      ],
      [
        false
      ],
      [
        false
      ]
    ],
    "pred_linear_interp_value_int": [
      [],
      [],
      []
    ],
    "pred_linear_interp_value": [
      [],
      [],
      []
    ],
    "poly_coef_int": [
      [
        [
          0,
          1
        ]
      ],
      [
        [
          0,
          1
        ]
      ],
      [
        [
          0,
          1
        ]
      ]
    ],
    "poly_coef": [
      [
        [
          0,
          0
        ]
      ],
      [
        [
          0,
          0
        ]
      ],
      [
        [
          0,
          0
        ]
      ]
    ],
    "mmr_order_minus1": [
      [],
      [],
      []
    ],
    "mmr_constant_int": [
      [],
      [],
      []
    ],
    "mmr_constant": [
      [],
      [],
      []
    ],
    "mmr_coef_int": [
      [],
      [],
      []
    ],
    "mmr_coef": [
      [],
      [],
      []
    ]
  },
  "vdr_dm_data": {
    "compressed": false,
    "affected_dm_metadata_id": 0,
    "current_dm_metadata_id": 0,
    "scene_refresh_flag": 0,
    "ycc_to_rgb_coef0": 9574,
    "ycc_to_rgb_coef1": 0,
    "ycc_to_rgb_coef2": 13802,
    "ycc_to_rgb_coef3": 9574,
    "ycc_to_rgb_coef4": -1540,
    "ycc_to_rgb_coef5": -5348,
    "ycc_to_rgb_coef6": 9574,
    "ycc_to_rgb_coef7": 17610,
    "ycc_to_rgb_coef8": 0,
    "ycc_to_rgb_offset0": 16777216,
    "ycc_to_rgb_offset1": 134217728,
    "ycc_to_rgb_offset2": 134217728,
    "rgb_to_lms_coef0": 7222,
    "rgb_to_lms_coef1": 8771,
    "rgb_to_lms_coef2": 390,
    "rgb_to_lms_coef3": 2654,
    "rgb_to_lms_coef4": 12430,
    "rgb_to_lms_coef5": 1300,
    "rgb_to_lms_coef6": 0,
    "rgb_to_lms_coef7": 422,
    "rgb_to_lms_coef8": 15962,
    "signal_eotf": 65535,
    "signal_eotf_param0": 0,
    "signal_eotf_param1": 0,
    "signal_eotf_param2": 0,
    "signal_bit_depth": 12,
    "signal_color_space": 0,
    "signal_chroma_format": 0,
    "signal_full_range_flag": 1,
    "source_min_pq": 62,
    "source_max_pq": 3696,
    "source_diagonal": 42,
    "cmv29_metadata": {
      "num_ext_blocks": 3,
      "ext_metadata_blocks": [
        {
          "Level1": {
            "min_pq": 0,
            "max_pq": 2962,
            "avg_pq": 1447
          }
        },
        {
          "Level5": {
            "active_area_left_offset": 0,
            "active_area_right_offset": 0,
            "active_area_top_offset": 280,
            "active_area_bottom_offset": 280
          }
        },
        {
          "Level6": {
            "max_display_mastering_luminance": 4000,
            "min_display_mastering_luminance": 50,
            "max_content_light_level": 10000,
            "max_frame_average_light_level": 424
          }
        }
      ]
    },
    "cmv40_metadata": {
      "num_ext_blocks": 3,
      "ext_metadata_blocks": [
        {
          "Level9": {
            "length": 1,
            "source_primary_index": 0
          }
        },
        {
          "Level11": {
            "content_type": 1,
            "whitepoint": 0,
            "reference_mode_flag": true,
            "reserved_byte2": 0,
            "reserved_byte3": 0
          }
        },
        {
          "Level254": {
            "dm_mode": 0,
            "dm_version_index": 2
          }
        }
      ]
    }
  },
  "rpu_data_crc32": 1435246839
}
"The script has completed."
Press any key to continue . . .

RESET_9999
Posts: 2082
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

#6728 Post by RESET_9999 » Thu Jun 16, 2022 10:55 am

dwalme wrote:
Thu Jun 16, 2022 4:17 am
?
looks like everything went fine.

You can ignore the ffmpeg warnings in the beginning because, in the "auto L5" workflows, detectborder.exe(letterbox measurer) doesnt work with TS/M2TS input so I use ffmpeg to split and mux a 5 min MKV samples and I can see that your L5 was correctly measured.

ArArdin
Posts: 195
Joined: Fri Nov 20, 2020 1:40 pm

Re: Dolby Vision now possible through MP4 Mux.

#6729 Post by ArArdin » Thu Jun 16, 2022 12:15 pm

@RESET_9999

My apologies if this has been answered earlier. As for your tools folder, can you enlighten me as to what the "dovi_tool.fix.exe" file does?

RESET_9999
Posts: 2082
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

#6730 Post by RESET_9999 » Thu Jun 16, 2022 12:20 pm

ArArdin wrote:
Thu Jun 16, 2022 12:15 pm
@RESET_9999

My apologies if this has been answered earlier. As for your tools folder, can you enlighten me as to what the "dovi_tool.fix.exe" file does?
I use it to fix itunes web-dl with invalid L6 ( MDL > 10 000)

dwalme
Posts: 28
Joined: Sat Dec 10, 2011 2:38 am

Re: Dolby Vision now possible through MP4 Mux.

#6731 Post by dwalme » Thu Jun 16, 2022 12:54 pm

RESET_9999 wrote:
Thu Jun 16, 2022 10:55 am
dwalme wrote:
Thu Jun 16, 2022 4:17 am
?
looks like everything went fine.

You can ignore the ffmpeg warnings in the beginning because, in the "auto L5" workflows, detectborder.exe(letterbox measurer) doesnt work with TS/M2TS input so I use ffmpeg to split and mux a 5 min MKV samples and I can see that your L5 was correctly measured.
I end up with a 0 byte P8_DoVi.hevc file in the output directory.

I see this warning:

Code: Select all

Warning: mismatched lengths. video 0, RPU 198552
Metadata will be skipped at the end to match video length
I commented out the rmdir of the TEMP folder and I'm running it again to see if I can see something.


EDIT: Watching it run it seems the demux of the main HEVC track with tsMuxer is not happening correctly. I see a 0 byte *.track_4117_und.hevc in the TEMP dir. I think after tsMuxeR says 100% complete that this would be the full video HEVC.

Only takes 14 sec

Code: Select all

tsMuxeR version git-f4fa419. github.com/justdan96/tsMuxer
100.0% complete
Processed 0 video frames
100.0% complete
Flushing write buffer
Demux complete.
Demuxing time: 14 sec

RESET_9999
Posts: 2082
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

#6732 Post by RESET_9999 » Thu Jun 16, 2022 1:11 pm

I don't know, I can't reproduce with the sample i tried. Let me try a complete movie.

Code: Select all

----------------------------------------------------------------------------------------------------
--This workflow will convert an HDR10 or HDR10plus video to DoVi and set L5 automatically
--The black bars detection may not be perfectly accurate. It's maybe better to measure them manually
----------------------------------------------------------------------------------------------------
Drag and drop your HDR10 or HDR10plus MKV/MP4/TS file and press enter...D:\hdr10.ts
Do you want to crop RPU... y or n ? (y when HDR10-BL is cropped) and/or press enter...
ffmpeg version 5.0.1-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
Input #0, mpegts, from 'D:\hdr10.ts':
  Duration: 00:07:08.39, start: 4200.000000, bitrate: 39049 kb/s
  Program 1
  Stream #0:0[0x1015](und): Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160, 23.98 fps, 23.98 tbr, 90k tbn
    Side data:
      DOVI configuration record: version: 1.0, profile: 8, level: 6, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 1
Output #0, matroska, to 'D:\TEMP\chunk.mkv':
  Metadata:
    encoder         : Lavf59.16.100
  Stream #0:0(und): Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160, q=2-31, 23.98 fps, 23.98 tbr, 1k tbn
    Side data:
      DOVI configuration record: version: 1.0, profile: 8, level: 6, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 1
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 6946 fps=882 q=-1.0 Lsize= 1387475kB time=00:04:59.96 bitrate=37891.5kbits/s speed=38.1x
video:1387407kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.004931%
Measuring the HDR10 video letterbox...
min: 0.0001 cd/m2, max: 1000 cd/m2
tsMuxeR version git-f4fa419. github.com/justdan96/tsMuxer
HEVC muxing fps is not set. Get fps from stream. Value: 23.976
B-pyramid level 1 detected. Shift DTS to 2 frames
99.0% complete
Processed 10273 video frames
100.0% complete
Flushing write buffer
Demux complete.
Demuxing time: 4 sec
Dolby Vision / SMPTE ST 2086
HDR10plus metadata not present. Generating DoVi from HDR10 with madVR...
Measuring video file "D:\hdr10.ts" using D3D11 (native)...
Metadata:
  Mastering display luminance: 0.0001/1000, gamut: 0.68 0.32, 0.15 0.06, 0.265 0.69, 0.3127 0.329
  MaxCLL: 0, MaxFALL: 0 nits
Measurements:
  Frames: 10271, MaxCLL 100%: 623, 99.9%: 598, MaxFALL: 250, AvgFALL: 44, AvgFMLL: 416 nits
Parsing madVR measurement file...
Generating metadata: Profile 8.1 (HDR10)...
Generated metadata for 10271 frames
Done.
EditConfig {
    mode: 0,
    remove_cmv4: false,
    remove_mapping: false,
    active_area: Some(
        ActiveArea {
            crop: false,
            drop_l5: None,
            presets: Some(
                [
                    ActiveAreaOffsets {
                        id: 0,
                        left: 0,
                        right: 0,
                        top: 276,
                        bottom: 276,
                    },
                ],
            ),
            edits: Some(
                {
                    "all": 0,
                },
            ),
        },
    ),
    remove: None,
    duplicate: None,
    min_pq: None,
    max_pq: None,
    level6: None,
    level9: None,
    level11: None,
}
Parsing RPU file...
Editing active area offsets...
Final metadata length: 10271
Writing RPU file...
EditConfig {
    mode: 0,
    remove_cmv4: false,
    remove_mapping: false,
    active_area: None,
    remove: None,
    duplicate: None,
    min_pq: None,
    max_pq: None,
    level6: Some(
        ExtMetadataBlockLevel6 {
            max_display_mastering_luminance: 1000,
            min_display_mastering_luminance: 1,
            max_content_light_level: 0,
            max_frame_average_light_level: 0,
        },
    ),
    level9: None,
    level11: None,
}
Parsing RPU file...
Final metadata length: 10271
Writing RPU file...
"left": 0
"right": 0
"top": 276
"bottom": 276
MDL.max: 1000
MDL.min: 1
Maxcll: 0
Maxfall: 0
Display P3
injecting RPU-L6-L5.bin ...
Parsing RPU file...
Processing input video for frame order info...

Warning: Input file already has RPUs, they will be replaced.

Warning: mismatched lengths. video 10274, RPU 10271
Metadata will be duplicated at the end to match video length

Rewriting file with interleaved RPU NALs..
Parsing RPU file...
{
  "dovi_profile": 8,
  "header": {
    "rpu_nal_prefix": 25,
    "rpu_type": 2,
    "rpu_format": 18,
    "vdr_rpu_profile": 1,
    "vdr_rpu_level": 0,
    "vdr_seq_info_present_flag": true,
    "chroma_resampling_explicit_filter_flag": false,
    "coefficient_data_type": 0,
    "coefficient_log2_denom": 23,
    "vdr_rpu_normalized_idc": 1,
    "bl_video_full_range_flag": false,
    "bl_bit_depth_minus8": 2,
    "el_bit_depth_minus8": 2,
    "vdr_bit_depth_minus_8": 4,
    "spatial_resampling_filter_flag": false,
    "reserved_zero_3bits": 0,
    "el_spatial_resampling_filter_flag": false,
    "disable_residual_flag": true,
    "vdr_dm_metadata_present_flag": true,
    "use_prev_vdr_rpu_flag": false,
    "prev_vdr_rpu_id": 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": null,
    "nlq_num_pivots_minus2": null,
    "nlq_pred_pivot_value": null,
    "num_x_partitions_minus1": 0,
    "num_y_partitions_minus1": 0
  },
  "rpu_data_mapping": {
    "mapping_idc": [
      [
        0
      ],
      [
        0
      ],
      [
        0
      ]
    ],
    "mapping_param_pred_flag": [
      [
        false
      ],
      [
        false
      ],
      [
        false
      ]
    ],
    "num_mapping_param_predictors": [
      [
        0
      ],
      [
        0
      ],
      [
        0
      ]
    ],
    "diff_pred_part_idx_mapping_minus1": [
      [],
      [],
      []
    ],
    "poly_order_minus1": [
      [
        0
      ],
      [
        0
      ],
      [
        0
      ]
    ],
    "linear_interp_flag": [
      [
        false
      ],
      [
        false
      ],
      [
        false
      ]
    ],
    "pred_linear_interp_value_int": [
      [],
      [],
      []
    ],
    "pred_linear_interp_value": [
      [],
      [],
      []
    ],
    "poly_coef_int": [
      [
        [
          0,
          1
        ]
      ],
      [
        [
          0,
          1
        ]
      ],
      [
        [
          0,
          1
        ]
      ]
    ],
    "poly_coef": [
      [
        [
          0,
          0
        ]
      ],
      [
        [
          0,
          0
        ]
      ],
      [
        [
          0,
          0
        ]
      ]
    ],
    "mmr_order_minus1": [
      [],
      [],
      []
    ],
    "mmr_constant_int": [
      [],
      [],
      []
    ],
    "mmr_constant": [
      [],
      [],
      []
    ],
    "mmr_coef_int": [
      [],
      [],
      []
    ],
    "mmr_coef": [
      [],
      [],
      []
    ]
  },
  "vdr_dm_data": {
    "compressed": false,
    "affected_dm_metadata_id": 0,
    "current_dm_metadata_id": 0,
    "scene_refresh_flag": 0,
    "ycc_to_rgb_coef0": 9574,
    "ycc_to_rgb_coef1": 0,
    "ycc_to_rgb_coef2": 13802,
    "ycc_to_rgb_coef3": 9574,
    "ycc_to_rgb_coef4": -1540,
    "ycc_to_rgb_coef5": -5348,
    "ycc_to_rgb_coef6": 9574,
    "ycc_to_rgb_coef7": 17610,
    "ycc_to_rgb_coef8": 0,
    "ycc_to_rgb_offset0": 16777216,
    "ycc_to_rgb_offset1": 134217728,
    "ycc_to_rgb_offset2": 134217728,
    "rgb_to_lms_coef0": 7222,
    "rgb_to_lms_coef1": 8771,
    "rgb_to_lms_coef2": 390,
    "rgb_to_lms_coef3": 2654,
    "rgb_to_lms_coef4": 12430,
    "rgb_to_lms_coef5": 1300,
    "rgb_to_lms_coef6": 0,
    "rgb_to_lms_coef7": 422,
    "rgb_to_lms_coef8": 15962,
    "signal_eotf": 65535,
    "signal_eotf_param0": 0,
    "signal_eotf_param1": 0,
    "signal_eotf_param2": 0,
    "signal_bit_depth": 12,
    "signal_color_space": 0,
    "signal_chroma_format": 0,
    "signal_full_range_flag": 1,
    "source_min_pq": 7,
    "source_max_pq": 3079,
    "source_diagonal": 42,
    "cmv29_metadata": {
      "num_ext_blocks": 3,
      "ext_metadata_blocks": [
        {
          "Level1": {
            "min_pq": 0,
            "max_pq": 2708,
            "avg_pq": 1141
          }
        },
        {
          "Level5": {
            "active_area_left_offset": 0,
            "active_area_right_offset": 0,
            "active_area_top_offset": 276,
            "active_area_bottom_offset": 276
          }
        },
        {
          "Level6": {
            "max_display_mastering_luminance": 1000,
            "min_display_mastering_luminance": 1,
            "max_content_light_level": 0,
            "max_frame_average_light_level": 0
          }
        }
      ]
    },
    "cmv40_metadata": {
      "num_ext_blocks": 3,
      "ext_metadata_blocks": [
        {
          "Level9": {
            "length": 1,
            "source_primary_index": 0
          }
        },
        {
          "Level11": {
            "content_type": 1,
            "whitepoint": 0,
            "reference_mode_flag": true,
            "reserved_byte2": 0,
            "reserved_byte3": 0
          }
        },
        {
          "Level254": {
            "dm_mode": 0,
            "dm_version_index": 2
          }
        }
      ]
    }
  },
  "rpu_data_crc32": 867262424
}
"The script has completed."

RESET_9999
Posts: 2082
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

#6733 Post by RESET_9999 » Thu Jun 16, 2022 1:37 pm

Ha, I know why. It's related to tsmuxer track id 4117 vs 4113...
will upload a new version soon...

RESET_9999
Posts: 2082
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

#6734 Post by RESET_9999 » Thu Jun 16, 2022 2:24 pm

dwalme wrote:
Thu Jun 16, 2022 12:54 pm
please try 1.3.9

dwalme
Posts: 28
Joined: Sat Dec 10, 2011 2:38 am

Re: Dolby Vision now possible through MP4 Mux.

#6735 Post by dwalme » Thu Jun 16, 2022 3:07 pm

RESET_9999 wrote:
Thu Jun 16, 2022 2:24 pm
dwalme wrote:
Thu Jun 16, 2022 12:54 pm
please try 1.3.9
1.3.9 works now. Thank you.

Post Reply