Merge multiple video files

This walk-through explains how to merge multiple video files. Simple merging the ripped files with MKVToolNix will result in black section of several seconds at the location where part 1 and part 2 are joined, to avoid this we have to add several steps to the merging process. The steps are similar for 3D and 2D movies, below is the example for Avatar: The Way of Water 3D. For a 2D movie, replace steps 1-3 with a transcode with HandbrakeCLI.

  1. Rip the 2 discs with MakeMKV
  2. Use MD3D2MK3D to create “side by side” or “top & bottom” movie files
  3. Use SMPlayer to find the end frame of movie part 1 and the start frame of movie part 2
  4. Modify movie part 1:
    1. Use the “–default-duration” value from file __MUX_3D_OPTIONS.json in folder MKV3D and multiply with this value. For the Avatar 3D movie these values are as follows:
      • Duration of ripped movie: 1h51m14.459s
      • New duration (position of end frame): 1h51m13.417s, duration 6673.417 seconds
      • Amount of frames: 6673.417 * 24000 / 1001 = 160,002 frames
    2. Modify the frames in the following 2 files, from 160,027 to 160,002
    3. Run again

      to generate the file without the black frames at the end

    4. Use tsMuxerGUI to trim the length of the DTS or AC3 audio track to 1h51m13.417s length
    5. Merge the mkv file (step 4c) with the trimmed audio (step 4d) in MKVToolNix
  5. Modify movie part 2:
    1. Load the 3D mkv file into MKVToolNix and set the delay for all tracks to -1960ms, then Start multiplexing
  6. Merge the 2 newly generated files
    • Part 1 (step 4e)
    • Part 2 (step 5a)