R3S3t9999 / DoVi_Scripts

User-friendly / drag & drop scripts to process any HDR / Dolby Vision files and more...
136 stars 6 forks source link

MP4 Workflow 5 not keeping language tags form source MKV #13

Closed matheousse closed 8 months ago

matheousse commented 8 months ago

Hi, I've been using your scripts for some days, but I've noticed that the MP4 mux is not transferring the MKV language tags/track names in the output (despite 1.9.8.4 changelog saying it does). Is there something I'm doing wrong (or a setting I missed)? Below are both the source and output MediaInfos, as well as the settings set in the MP4 script itself. Thanks.

Source

Complete name                            : M:\Dolby_Vision_Tool_v0.61.4\Thor Love and Thunder (2022) Hybrid MULTi VFF 2160p 10bit 4KLight DV HDR BluRay DDP 7.1 x265-QTZ_NEW.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 4.45 GiB
Duration                                 : 1 h 58 min
Overall bit rate                         : 5 361 kb/s
Frame rate                               : 23.976 FPS
Movie name                               : Thor Love and Thunder (2022) Hybrid MULTi VFF 2160p 10bit 4KLight DV HDR BluRay DDP 7.1 x265-QTZ
Encoded date                             : 2023-12-20 13:01:45 UTC
Writing application                      : mkvmerge v81.0 ('Milliontown') 64-bit
Writing library                          : libebml v1.4.4 + libmatroska v1.7.1 / Lavf60.17.100

Video
ID                                       : 1
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+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 1 h 58 min
Bit rate                                 : 3 822 kb/s
Width                                    : 3 840 pixels
Height                                   : 1 608 pixels
Display aspect ratio                     : 2.39:1
Frame rate mode                          : Constant
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.026
Stream size                              : 3.17 GiB (71%)
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0050 cd/m2, max: 1000 cd/m2

Audio #1
ID                                       : 2
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Format profile                           : Blu-ray Disc
Format settings                          : Dolby Surround EX
Codec ID                                 : A_EAC3
Duration                                 : 1 h 58 min
Bit rate mode                            : Constant
Bit rate                                 : 768 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                              : 652 MiB (14%)
Title                                    : FR VFF : DDP 7.1
Language                                 : French
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Format profile                           : Blu-ray Disc
Format settings                          : Dolby Surround EX
Codec ID                                 : A_EAC3
Duration                                 : 1 h 58 min
Bit rate mode                            : Constant
Bit rate                                 : 768 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                              : 652 MiB (14%)
Title                                    : ENG VO : DDP 7.1
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

Output

Complete name                            : M:\Dolby_Vision_Tool_v0.61.4\Thor Love and Thunder (2022) Hybrid MULTi VFF 2160p 10bit 4KLight DV HDR BluRay DDP 7.1 x265-QTZ_NEW_DV_P8_DoVi.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (mp42/dby1/isom)
File size                                : 4.45 GiB
Duration                                 : 1 h 58 min
Overall bit rate                         : 5 361 kb/s
Frame rate                               : 23.976 FPS
Encoded date                             : 2023-12-21 09:45:33 UTC
Tagged date                              : 2023-12-21 09:45:33 UTC

Video
ID                                       : 1
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+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : dvhe
Codec ID/Info                            : High Efficiency Video Coding with Dolby Vision
Duration                                 : 1 h 58 min
Bit rate                                 : 3 822 kb/s
Width                                    : 3 840 pixels
Height                                   : 1 608 pixels
Display aspect ratio                     : 2.39:1
Frame rate mode                          : Constant
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.026
Stream size                              : 3.17 GiB (71%)
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : 2023-12-21 09:45:33 UTC
Tagged date                              : 2023-12-21 09:45:33 UTC
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0050 cd/m2, max: 1000 cd/m2
Codec configuration box                  : hvcC+dvcC

Audio #1
ID                                       : 2
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Format profile                           : Blu-ray Disc
Format settings                          : Dolby Surround EX
Codec ID                                 : ac-3
Duration                                 : 1 h 58 min
Bit rate mode                            : Constant
Bit rate                                 : 768 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                              : 652 MiB (14%)
Service kind                             : Complete Main
Default                                  : Yes
Alternate group                          : 2
Encoded date                             : 2023-12-21 09:45:33 UTC
Tagged date                              : 2023-12-21 09:45:33 UTC

Audio #2
ID                                       : 3
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Format profile                           : Blu-ray Disc
Format settings                          : Dolby Surround EX
Codec ID                                 : ac-3
Duration                                 : 1 h 58 min
Bit rate mode                            : Constant
Bit rate                                 : 768 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                              : 652 MiB (14%)
Service kind                             : Complete Main
Default                                  : No
Alternate group                          : 2
Encoded date                             : 2023-12-21 09:45:33 UTC
Tagged date                              : 2023-12-21 09:45:33 UTC

Settings

::##################################################################################################################################################################################################
::###################################################################### Scripts SETTINGS ##########################################################################################################
::##################################################################################################################################################################################################

::Choose prefered container. ("TS" or "MKV" or "MP4" or %script.container%) Default= This setting is controled by the script bat filename EG. DoVi_Scripts_1.9.3_MKV.bat sets the container to MKV
set container=%script.container%
::choose if you want to mux at the end of the workflows.  ("YES" or "NO" default = "YES") this wont work if "set container=none". mp4 version not affected by this setting
set MUX=YES
:: choose the mp4muxer version for (1-1)(2-1)(3-1)(4-2) (OLD or NEW default = OLD) OLD works on (2018/2017) LG TVS but Itunes P8 hybrid wont work if you dont fix the bitstream framerate first.
set mp4_version=OLD
::choose if you want to force the mp4muxer. Some EC3 track wont work in mp4box. Valid only for the mp4muxer workflows (default=NO)
set force.mp4muxer=NO
:: choose if you want to force the latest mp4box when mp4_version is set to NEW. Otherwise if input has no srt/lossless audio, the latest mp4_muxer is used which doesnt work on ATV (default=NO)
set forcemp4box2=NO
::choose if you want to mux all the audio from the input or just the main audio track. This is valid only if "set MUX=YES" and TS version  (YES or NO default = YES )mp4 version not affected by this setting
set mux_all_audio=YES
::choose if you want to mux all the subtitles(up to 30) from the input or just forced/full. This is valid only if "set MUX=YES" and TS/MKV. mp4 version not affected by this setting (YES or NO default = YES )
set mux_all_sub=YES
:: you can completely disable ddp encoding for the all the workflows (YES or NO default = YES).mp4 workflows not affected by this setting
set encode_DDP=YES
:: you can disable 7.1 ddp encoding here. This set to "NO" will downscale 7.1 to 5.1... (YES or NO default = YES) The point of this setting is that you get higher bitrate and faster processing with 5.1 encoding (1536 vs 1024).mp4 workflows not affected by this setting
set encode_7.1=YES
:: choose if you want to encode 7.1/5.1 audio to LPCM-7.1/5.1. Choices are NO or LPCM or FLAC (YES or NO default = NO). ***FLAC not supported in TSMuxer
set encode_LL=NO
:: choose if you want to also mux the lossless audio when you convert to DD+. This is only valid if set MUX=YES (YES or NO default = YES).
set keep_lossless=YES
:: choose if you want to get a copy of the converted RPU for the p5 to p8 workflows (YES or NO default = YES).
set keep_rpu=YES
:: choose if you want to keep a copy of the EL for the P7 to P8 workflows (YES or NO default = NO).
set keep_EL=NO
:: choose if you want to extract the subtitles (YES or NO default = NO).
set export.subs=NO
::choose if  you want to remove HDR10plus when injecting DV(YES or NO default= NO)
set drop.HDR10plus=NO
::choose if you want to auto crop RPU (set L5 to 0) when cropped input is detected (valid for 1-1) (default= YES)
set auto.crop=YES
::Choose if you want to remove the 100 L2 trim pass. (only valid for 1-1xml and  3-1) (require the dolby metafier) (default=NO)
set remove_100=NO
::Choose if you want to remove the 600 L2 trim pass.(only valid for 1-1xml and  3-1) (require the dolby metafier)(default=YES)
set remove_600=YES
::Choose if you want to remove the 1000 L2 trim pass.(only valid for 1-1xml and  3-1) (require the dolby metafier) (default=YES)
set remove_1000=YES
::Choose if you want to validate/test the metadata with Dolby Metafier at the end of the workflows (default=YES)
set validate_metadata=YES
:: choose if  you want to remove cmv4.0 in (1-1xml) and (3-1) (default = NO)
set rem_cmv4=NO
:: choose the scene detection algo to use in 7-4 choices: detect-content (change in HSV color space) / detect-adaptive (better fast movement detection) / detect-threshold (intensity/brightness)
set scene_detect_type=detect-adaptive
:: choose the L1 analysis tuning... Choices are: old legacy mode=0 - Most Highlight Detail/Most Mapping=1(default) - More Highlight Detail/More Mapping=2 - Balanced=3 - Less Highlight Detail/Less Mapping=4 - Least Highlight Detail/Least Mapping=5
set L1_Tuning=1
:: force cpu for the CM_analyze (3-1)(8-6-1)  YES or NO (default=NO)
set CM_CPU=NO
:: choose if you want to force frame by frame analysis in 3-1 (default = NO)
set force.FBF=NO
::choose if you want to upscale to 4k or export screenshot as encoded. (7-2)  if both of your input are 1080p, the script wont upscale regardless of this setting  (default= YES)
set upscale=YES
::choose the upscaling algo to use in 7-2 (default = Spline36) choices are: Spline64 / Spline36 / Lanczos4 / Lanczos / Bicubic / Bilinear
set upscale_algo=Spline36
::choose if you want 8-6 to downscale to 1080p (default = NO)
set downscale=NO
:: you may have to set this to YES for some bluray with positve delay. Only valid for 4-1 and this option will not work for input with negative delay. Default = NO 
set input.delay=NO
:: choose if you want 6-4 to plot the 100nits L2/L8 trims (default = NO)
set plot_100=NO
:: choose if  you want to auto-scale the L2 graph 6-3 6-4 (default = NO)
set auto_scale_plot=NO
:: choose the timestamp for the sample maker workflow (8-5) (default=5m)
set timestamp=00:00:00-00:05:00
:: choose the amount of frames to export in 7 (default=50)
set frame_number=50
:: choose the prores encoding quality/size for 3-1 (default = 4) higher values means faster encoding(depending on your cpu) and smaller filesize.
set qscale=4
:: choose if you want to keep the prores encode for 3-1 and 8-6-1 (default = NO)
set keep_prores=NO
:: choose if you want to tonemap HDR/DV to SDR or HDR in 7-2 7-1  SDR=0 HDR=1  ( default = 1 ) 
set tonemap=1
:: choose if you want to use dynamic peak detection in 7-2 true or false (default= true) *** 'true' can be misleading if you compare two HDR sources in SDR.
set peak_detect=true
:: choose the SDR tone mapping function for 7-2 (default = 0) choices are: auto=0 / clip=1 / st2094-40=2 / st2094-10=3 / bt.2390=4 / bt.2446a=5 / spline=6 / reinhard=7 / mobius=8 / hable=9 / gamma=10 / linear=11
set tone_function=0
:: choose the SDR tone mapping mode for 7-2 (default = 1). choices are: auto=0 rgb=1 max=2 hybrid=3 luma=4  
set tone_mode=1
:: choose if you want to compare SDR in a HDR container for workflow 7-2. (default= NO)
set compare.SDR.in.HDR=YES
::choose if you want to force ffms2 in 7-1 dovi baker for those who dont have an Nvidia GPU.  default = NO
set force_ffms2=NO
:: set the number of thread to use in 7-1 dovibaker (default = 8) http://avisynth.nl/index.php/SetFilterMTMode
set Prefetch=Prefetch(8)
::choose if you want to index your input before the prores encoding in 3-1 default=NO (YES not recommended)
set disable_indexing=NO
:: choose if you want 7-1 FEL workflow to also export heatmap and gamut. YES or NO Default = NO
set FEL.heat.gamut=NO
:: choose the brightness percentage for 2-9 pgs tonemapping (default=60)
set percentage=60
:: choose if you want to make a max_pq graph in 6-2 YES or no (default = NO)
set max.pq.plot=NO
:: choose the frame number to check when the dovi_tool -info RPU (default=100)
set frame.to.read_path=100

::##################################################################################################################################################################################################
::###################################################################### Language SETTINGS #########################################################################################################
::##################################################################################################################################################################################################

:: set desired audio language (YES or NO default = english) If all set to no, it will get you the first best audio regardless of the language. (otherwise the audio selected is prefered by default). MUX_all_audio override theses options.
set english=YES
set french=YES
set spanish=NO
set german=NO
set italian=NO
set chinese=NO
set dutch=NO
set finish=NO
set russian=NO
set polish=NO
set japenese=NO
set portuguese=NO
R3S3t9999 commented 8 months ago

If your input has no subtitles nor lossless audio, then only the mp4muxer is used and you cannot set a track name with it. I guess I could add an option to force mp4box.

matheousse commented 8 months ago

Oh, I wasn't aware of this quirk I was relying on external SRTs since I had issues with the Timed Text conversion previously. But I just tested with internal SRTs and the language tags/track names seem to work now (same for the SRT -> Timed Text conversion).

R3S3t9999 commented 8 months ago

yes, the script was designed like that because with the old mp4muxer workflow, you can't mux directly with mp4box. You have to mux to mp4 first with the mp4muxer and then you mux again with mp4box for subs/audio/names which makes the process a lot slower for nothing if the input doesn't have subs or lossless audio.