From 16b9e2cfbb15d5f580799e0cfe3b2d2786f8fd96 Mon Sep 17 00:00:00 2001 From: MilesTEG Date: Wed, 3 Nov 2021 08:24:55 +0100 Subject: [PATCH] =?UTF-8?q?Ajoute=20de=20petites=20modifications=20pour=20?= =?UTF-8?q?simplifier=20la=20gestion=20des=20modifications=20de=20sous-tit?= =?UTF-8?q?res,=20et=20langues=20(en=20pr=C3=A9vision=20d'une=20automatisa?= =?UTF-8?q?tion=20plus=20pouss=C3=A9e=20de=20la=20commande=20de=20merge)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e one MKV Audio with another video MKV.ps1 | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/Scripts-Divers/Batch Merge one MKV Audio with another video MKV.ps1 b/Scripts-Divers/Batch Merge one MKV Audio with another video MKV.ps1 index 3977e64..fee589e 100644 --- a/Scripts-Divers/Batch Merge one MKV Audio with another video MKV.ps1 +++ b/Scripts-Divers/Batch Merge one MKV Audio with another video MKV.ps1 @@ -61,9 +61,8 @@ $AudioTrackName_1 = "1:English - DTS-HD MA" $AudioLang_1 = "1:en" $AudioTrack_1_default = "1:yes" #$file_1_options = "--no-video" - - - +# Define track order +$track_order = "1:0,0:1" ########################################## #### FILE 2 - MKV - Keeping only the video #### $file_2_options = "--no-audio --no-track-tags --no-global-tags" @@ -80,6 +79,8 @@ if ( $NB_External_SUB -ne 0 ) { $ExtSubTrackLang_1 = "0:eng" $ExtSubTrack_1_default = "0:yes" $ExtSub_charset_1 = "0:UTF-8" + # Define track order + $track_order += ",2:0" #### #### FILE 4 - SRT - Keeping all but the video (audio + chapters tags) # ================== SUBTITLES ================== @@ -89,14 +90,9 @@ if ( $NB_External_SUB -ne 0 ) { $ExtSubTrackLang_2 = "0:fr" $ExtSubTrack_2_default = "0:no" $ExtSub_charset_2 = "0:UTF-8" - #### - # ================== OTHER SETTINGS ================== # Define track order - if ( $NB_External_SUB -eq 1 ) { - $track_order = "1:0,0:1,2:0" - } - elseif ( $NB_External_SUB -eq 2 ) { - $track_order = "1:0,0:1,2:0,3:0" + if ( $NB_External_SUB -eq 2 ) { + $track_order += ",3:0" } } else { @@ -107,6 +103,9 @@ else { # $SubTrackLang_1 = "2:en" # $SubTrack_1_default = "2:yes" # $sub_charset_1 = "2:UTF-8" + # Define track order + $track_order += ",0:2" + $subtitle_tracks = "2" # Track 3 = Sub n°2 to keep # Name and language of Subtitle Track n°1 + Sync Value @@ -114,11 +113,10 @@ else { $SubTrackLang_1 = "3:eng" $SubTrack_1_default = "3:yes" $sub_charset_1 = "3:UTF-8" + # # Define track order + # $track_order += ",0:3" + # $subtitle_tracks = "3" #### - # ================== OTHER SETTINGS ================== - # Define track order - $track_order = "1:0,0:1,0:3" - $subtitle_tracks = "3" } ##============================================================================================== @@ -217,6 +215,9 @@ Foreach ($MKV_1 in $MKV_1_List) { $SRT_2_Name = $MKV_1_name + ".$SubExtension_2" $SRT_2 = $sourceDirectory_1 + "\" + $SRT_2_name } + # Title for the video track and for the destination file + #$VideoTrackName = $MKV_1_name -replace '(.*).S(\d*)E(\d*).(.*)H.264(.*)', '$1 - S$2E$3 - $4x265-10bits$5--Reencoded' + $VideoTrackName = $MKV_1_name -replace $chain_to_search, $chain__to_replace ######################################################### # Exceptions for some files with other than 2 SRT inside @@ -280,9 +281,7 @@ Foreach ($MKV_1 in $MKV_1_List) { ######################################################### - # Title for the video track and for the destination file - #$VideoTrackName = $MKV_1_name -replace '(.*).S(\d*)E(\d*).(.*)H.264(.*)', '$1 - S$2E$3 - $4x265-10bits$5--Reencoded' - $VideoTrackName = $MKV_1_name -replace $chain_to_search, $chain__to_replace + #Set Output File Name #$Output = $Name + '___MERGED' + '.mkv' -- 2.45.2