Concatenating ranges from Two files?

Hi I asked this before in the forum, and I’m still confused in the answer. Suppose I have two files X.mkv and Y.mkv

I want 00:02:00-00-04:00 from X and 00:00:30-00:01:30 from Y

to yield a file Z.mkv which is 3 minutes long with two minutes extracted from X concatenated with 1 minute from Y.

What single command will achieve that?

All split point timestamps refer to the total output duration. For example, if you append a 1min file & a 3min file you’ll end up with a total of 4min of output content. Within those 4min you can have your splitting timestamps.

For example, using the timestamps split mode you could use the split point 01:30 in order to create two files. The first one would contain the whole 1min of the first source file & the first 30sec of the second source file. At that point the split point of 01:30 would be reached, and the second output file would be created, containing the rest of the content of the second source file (00:30-03:00 of that file).

Switching to parts mode: if you wanted to cut two slices of that content out from the combined source content, you’d have to consider the appended timeline.

For example, if you want to keep 00:15-00:45 from the first source file & 02:00-02:30 from the second one, then you’d have to think about where timestamp '02:00from the second source file would end up in the combined (appended) timeline. This is obviously at "duration of all previous source material = duration of first source file in your case +02:00`".

In other words, the two ranges would be:

  • 00:15-00:45 (as there’s no prior content in the appended timeline before the content from source file 1)
  • 03:00-03:30 (as this is from the second source file, we have to add the first source file’s total duration of 01:00 to the intended start/end point within the second source file, 02:00 & 02:30)

As you can see your question cannot be answered without knowing the total duration of your first source file, X.

All that being said: MKVToolNix is simply not a video editor. Yes, it can do certain tasks that somewhat overlap with a video editor functionality, but that doesn’t mean that it’s really good at these things, and appending videos, cutting out different parts, basically the whole editing process, is simply not its focus, nor its strength.