Joining Two MKV files in Ubuntu?

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

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

mkvmerge -o newfile.mkv part1.mkv +part2.mkv

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