Merge two overlapping MKV files

Added by polini - over 7 years ago


I have the following problem. The movie I recorded was postponed for 10 minutes. Tvheadend recorded two MKV files. Both don't contain the complete movie (#1 missed the last 5min, #2 started somewhere in the middle), but together the full movie is recorded. Is there a way to merge both files without having the overlapping part twice?

I could try to find the point in #1 where #2 starts and cut the rest off #1. Is there an easy way to do this? Afterward I could append #2 to #1.

Replies (2)

RE: Merge two overlapping MKV files - Added by Prof Yaffle over 7 years ago

Have a look at mkvmerge - specifically, the GUI.

Now, your chances for success depend a lot on the format. If it's high profile H.264, cutting is at best an inexact art because you should only chop on I-frames, and they're few and far between in a heavily-compressed file. Conversely, if it's MPEG-2, then chopping is much easier (and avidemux does a very good job here).

You'll need to play the file to find the right point(s), then split the file accordingly. You can then use either tool to append your new second part to the original first part, throwing away the bit in the middle (which is the overlap).

All this assumes that the files are the same format, though. You'll end up in no end of trouble if the image dimensions or sound track format changes at all.

RE: Merge two overlapping MKV files - Added by Eudora Johnson about 5 years ago

In a word, what you need to do is firstly cut MKV videos and then join MKV files.

You may prefer to view Faasoft How-to page and seach How to Cut Video and How to Join MKV Files in "*Hot Powerful Features*" part.

You will find the answer.