2 Adding files vs. Appending files vs. adding as additional parts
Moritz Bunkus edited this page 2023-08-16 09:02:01 +00:00

Adding files vs. appending files vs. adding as additional parts

The question

What does "add" mean compared to "append"? And what is the difference between appending files and adding as additional parts? I don't know which option I should use.

The answer

Parallel or sequential layout

mkvmerge can lay out content either in parallel or sequentially:

  1. Parallel: when you have three files that are laid out in parallel, the content of all three files will be played simultaneously.
  2. Sequentially: when you have three files that are laid out sequentially, all of the content of file 1 is played first followed by all of the content of file 2 and finally followed by all the content of file 3.

Coming back to the GUI, when you "add files" their content will be laid out in parallel to the files/tracks that are part of the multiplexer job already. For example, when you have two separate source files, one with both audio & viedo tracks and a second file containing subtitles, you would use the "add files" action for both source files as you would like to have the audio, video & subtitle content play simultaneously.

mkvmerge syntax

The default for all file names given to mkvmerge is to lay them out in parallel. If you want to append a file to another file so that the two are laid out sequentially, you'll have to use the + operator before the second file name. For example:

mkvmerge -o parallel_layout.mkv input1.mkv input2.opus input3.srt

vs

mkvmerge -o sequential_layout.mkv input1.mp4 + input2.mp4 + input3.mp4

See the documentation for details.

"Appending files" vs "adding as additional parts"

Even though the second option is named "adding…", both options actually cause the content to be laid out sequentially after all of the content of the file they're appended/added to. Which mode you should use depends on the type of source file, though, and unfortunately this decision cannot be fully automated.

If you ever run across media files which have been split somewhere in the middle with a program like WinSplit (meaning they've been split at an arbitrary position), then the second part won't have a full set of headers. In such cases mkvmerge can treat those two parts as if they were only one file. This is what the »add as additional parts« option does.

DVDs use this method, for example. The VTS_01_1.VOB, VTS_01_2.VOB files are all logically part of one huge file. For DVD-like named files both mkvmerge and the GUI will already detect those files and treat them as additional parts automatically.

For most other cases in which you encounter movies split into multiple parts, the »append« functionality is what you want to use as all the files contain full sets of headers.

This explicitly applies to Blu-ray Discs as well, especially as Blu-ray .m2ts files can even have different internal stream/track IDs for the same logical video track. For Blu-ray Discs your best option is actually not to add the .m2ts files manually but to add one of the playlist files (the .mpls from the »PLAYLIST« sub-directory). Playlists contain the information which of the .m2ts to use, in which order, and even often which parts inside those .m2ts are to be used — not every .m2ts is copied in full. On top of all that, the .mpls files also contain chapter information.

Categories: merging