How to strip audio streams from an MKV file?

If all you want to do is remove a stream, not re-encode, you probably want to do this with the MKVtoolnix package (see videohelp.com's page).

There are a couple of GUIs that may help you (check around on the videohelp link). I'm not sure what the exact mkvmerge commandline might be, but I think something like this would work:

# first, get audio track info so we know which one to keep
mkvmerge -i input.mkv
File 'input.mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_AAC)
Track ID 3: audio (A_AAC)        <----------- for example, let's keep this one
Track ID 4: audio (A_AAC)

mkvmerge -o output.mkv --audio-tracks 3 input.mkv

That should do the trick (I don't have a file handy for testing, sorry). The --audio-tracks option tells mkvmerge to copy only the listed audio tracks to the new file. If you wanted to keep 2 & 3 but not 4, you could use --audio-tracks 2,3.

mkvmerge has a lot of other options for setting titles, adding a delay to sync audio, etc, so check the manpage for details.

Tags:

Ffmpeg

Video