Mkvmerge Complex Command

Feb. 2, 2023

It’s common to find video material (wink wink) with a large list of embeded subtitle and / or audio tracks, which on occasion are a pain in the behind for my TV set. To help it work better with these, I remove the audio or subtitle tracks that are not required. And for automate the process (for example, if there are a considerable amount of, ejem, chapters), I use some variants of the following command:

$ mkvmerge --output ${OUTPUT_FILE}.mkv --audio-tracks 1,2 --subtitle-tracks 9,14 --language 0:und \
           --aspect-ratio 0:16/9 --default-duration 0:24000/1001p --language 1:en --language 2:es \
           --sub-charset 9:UTF-8 --language 9:en --sub-charset 14:UTF-8 --language 14:es \
           '(' ${INPUT_FILE} ')' --track-order 0:0,0:1,0:2,0:9,0:14

And a quick explanationo of the options:

By the way, this command was built with the help of the mkvtoolnix-gui tool.