View Single Post
Old 16th January 2021, 18:31   #455  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,281
Quote:
Originally Posted by Pulp Catalyst View Post
for example i need to keep only ENG streams, and only keep DTS track ENG, the rest i want removed. mkvtoolnix wasn't really designed for this quick default process from what i can see.
Quite the opposite. It was designed to be automatable from other applications with very little effort. The basic three-step process is:
  1. Let mkvmerge analyze your source file and output what it finds as a JSON document. JSON was chosen as there are JSON parsers out there for every programming language under the sun. You don't have to create your own parser, just use one that's available. The command to do so is "mkvmerge --identification-format json --identify yourfile.ext" or its shortcut "mkvmerge -J yourfile.ext".
  2. Loop over the information found in the JSON document and pick the track IDs for tracks you want to keep. That's easy enough; for each track the JSON document contains its ID, its type (audio/video/subtitles), its codec, its language and a lot of other information.
  3. Construct a new command line (better: a JSON option file) based on the track IDs gathered in step 2 and run mkvmerge with it.

Remember that mkvmerge's default is to copy everything safe for stuff you tell it not to copy. If your process is to solely remove all audio tracks that aren't DTS in English, you'll only need to collect all track IDs for English DTS audio tracks, add "--atracks <theIDs>" and that's it.

Sure, mkvmerge doesn't contain command line options for all possible scenarios under the sun, but it contains something much more important: command line options for each and every facet of a Matroska file. You have a lot of fine-grained control. Bundled with standards-based file formats (JSON both for identification output and for option files) makes interfacing with it rather straight forward, from whatever platform you're running on.

Of course you're completely free to disagree with my opinion here, and you certainly don't have to use it the process described above is to… whatever for you.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote