Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Strip Audio Tracks From an MKV with MKVToolNix

When watching an MKV video, the audio may default to a track we don't want, and are never going to use. Here, we will learn how to quickly strip an audio track from an MKV movie, without having to re-encode the video. Thus it takes very little time, and we do not reduce the video quality.


You will need to install the mkvtoolnix package. On Ubuntu, this can be done with the following command.

sudo apt-get install mkvtoolnix -y

Stripping Audio

One can find information about a video with the following command:

mkvmerge -i input.mkv

Look at the output to find out which ID(s) we want to keep and plug them into the following command:

mkvmerge \
  --atracks $AUDIO_TRACK_ID \

For example. To only keep track 2, we would use:

mkvmerge \
  -o output.mkv \
  --atracks 2 \

But to keep audio tracks 1 and 2, we would use

mkvmerge \
  -o output.mkv \
  --atracks 1,2 \

That's it! You should now have the video without the annoying default soundtrack, and you can now delete the original file.


Last updated: 24th February 2021
First published: 16th August 2018