Log in

View Full Version : MKVMerge Batch by language


activoice
18th October 2018, 16:06
This must have been asked before but I cannot find a thread for it.

When I encounter an mkv file that has more than just English Audio and Subtitles I use the MKVbatch -i command to list out the video, audio and subtitle tracks then I use the command shown below to create a new set of files using MKVMerge to merge the Audio and Subtitle track number that I need.

IE if a video file has Track 1 as English Audio, and Track 4 is English Subtitles I use this command to take the files from the source folder c:\temp and output to c:\temp2

FOR %%f IN (c:\temp\*.mkv) DO (
C:\PROGRA~1\MKVToolNix\mkvmerge -o c:\temp2\%%~nf-new.mkv --atracks 1 --stracks 4 %%~nf.mkv
)


Instead is there a way to do this where I would specify in the command that I want the English Audio and Subtitle tracks, and MKVMerge will look at the language itself, instead of me having to look up the track numbers beforehand?

sneaker_ger
18th October 2018, 21:08
Yes.

FOR %%f IN (c:\temp\*.mkv) DO "C:\PROGRA~1\MKVToolNix\mkvmerge" -o "c:\temp2\%%~nf-new.mkv" --audio-tracks eng --subtitle-tracks eng "%%~nf.mkv"

https://mkvtoolnix.download/doc/mkvmerge.html#d4e1822

activoice
19th October 2018, 04:42
Wow thanks so much