Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an opera that I'm ripping to my computer in MKV format with Handbrake. This opera is on two discs. Is there a way to join the resulting MKV's together? They will have the same bitrate, resolution, etc. If I do this, can I keep chapters from both MKV files organized? And, since I have subtitles in the file (not burnt in), will they still stay intact?

I'm not too sure if this question is off-topic or not. If it is, feel more than free to delete it. :)

share|improve this question
up vote 4 down vote accepted

If the resolution of the videos are same, then you can use avidemux to join them

share|improve this answer
This method was easier than aking1012's, so that's the only reason that I accepted this answer. – Ryan McClure Mar 24 '12 at 23:05

Recommended way is to use mkvtoolnix

sudo apt-get install mkvtoolnix mkvtoolnix-gui
  • Start mmg (graphical user interface for mkvmerge)
  • "Add" the first file
  • "Append" the second one, third, fourth, ...
  • Set output name in the textbox at the bottom
  • "Start muxing"

Subtitles are preserved and properly concatenated, so are audio and video. Chapters can be edited in the resulting file with mmg.

This procedure creates a properly muxed file. Any problems should be mentioned in the "log"-window in mmg. You can even set and name audio and subtitle tracks with the correct language codes and Annotations like "Forced" or "Directors Commentary".

If you plan to do this repeatedly on different files you better use the command line version mkvmerge ("mkvmerge --help")

mkvmerge -o output.mkv input1.mkv +input2.mkv
share|improve this answer

The easiest way to combine video is to use a container format that supports concatenation and re-indexing, like mpg. Then you can just cat file1 file2 > file3 and re-index with ffmpeg.

The steps in your case would be:
Convert from mkv to mpg
Change back to mkv if you like

If it's just audio, you could use a more easily editable file wav, mp3, or ogg until you've got your final output. Then you can use loads of tools to join audio. Sox or FFmpeg come to mind.

share|improve this answer
I'm in the process of ripping disc 2 now...whenever I finish, I'll give this a try...let's hope it works! :) – Ryan McClure Mar 24 '12 at 9:47

Use this command in terminal, to merge two separate '.mkv-files' into one.

mkvmerge -o newfile.mkv part1.mkv +part2.mkv
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.