Doing this manually, even using the mkvmerge job queue, is mind numbing and can take hours. Here's a relatively quick way of automatizing this.
Old situation
New situation
Prerequisite
Download and install MKVToolNix.Part 1
- Load the first mkv file and the srt file into mkvmerge GUI.
- Set the options as desired.
- Click Muxing.
- Click Show the command line.
- Modify the $mkvmergecommand variable in the PowerShell script below to math the parameters in the Current command line.
This is the command line you need to run in bulk with slightly different parameters, being the input and output files.
Part 2
- Modify the variables at the top of the script to reflect your situation.
- Run the script.
$directory = "M:\Downloads\Prison Break"
$mkvmergecommand =
[String]"""""C:\Program
Files\MKVToolNix\mkvmerge.exe"" -o
""%outputfile%""
""--forced-track"" ""0:no""
""-s"" ""0"" ""-D""
""-A"" ""-T""
""--no-global-tags"" ""--no-chapters""
""("" ""%srtinputfile%""
"")"" ""--language""
""0:eng"" ""--default-track""
""0:yes"" ""--forced-track"" ""0:no""
""--display-dimensions"" ""0:1280x720""
""--language"" ""1:eng""
""--default-track"" ""1:yes""
""--forced-track"" ""1:no""
""-a"" ""1"" ""-d""
""0"" ""-S"" ""-T""
""--no-global-tags"" ""--no-chapters""
""("" ""%mkvinputfile%""
"")"" ""--track-order""
""0:0,1:0,1:1"""""
$files =
Get-ChildItem $directory
-Filter "*.mkv"
| Sort Name
Foreach ($file
in $files)
{
$mkvinputfile = ($directory
-replace "\\", "\\")
+ "\\"
+ ($file.Name)
$srtinputfile = ($directory
-replace "\\", "\\")
+ "\\"
+($file.Name -replace
".mkv",
".srt")
$outputfile = ($directory -replace
"\\",
"\\") +
"\\" +($file.Name -replace ".mkv", "Merged.mkv")
$mergecommand = (($mkvmergecommand
-replace "%outputfile%", $outputfile)
-replace "%mkvinputfile%", $mkvinputfile)
-replace "%srtinputfile%", $srtinputfile
cmd
/c $mergecommand
}
Download MergeMKVSRT.ps1.