How to embed an audio and a subtitle file into a MKV file

6,101

If you have MKVToolnix installed, you can use the mkvmerge command to merge together the streams.

mkvmerge -o output.mkv -A input.mkv sound.ac3 subtitles.srt 

The -A switch makes sure no sound is taken from input.mkv. See the examples section for more.


For Windows, there exists the MKVToolnix GUI, which would make this a little easier:

In Ubuntu and similar distros, there should be the mkvtoolnix-gui package.

Share:
6,101

Related videos on Youtube

Greg Jennings
Author by

Greg Jennings

about.me/mehper Industrial Engineer M.Sc. One of the authors of Distribution Planning of Magazines: A Practical Approach. Author of Random Variate Generation If the Density Is Not Known: Basics, Methods, Implementations. Mostly dealing with the following topics: Food Logistics, Enterprise Resources Planning, Supply Chain Management, Materials Management, Healthcare Logistics, Executive Reporting, Data Analysis, System Development and Optimization. Programming Languages: VBA, SQL, R. XBox 360 fan.

Updated on September 18, 2022

Comments

  • Greg Jennings
    Greg Jennings over 1 year

    I have a MKV file in which I want to embed an AC3 audio file. I also want to embed a SRT subtitle file into it. How can I achieve that?

    Note: AC3 file is the same length of the original video.