splitting/merging mkv files

I’ve been ripping my DVD collection via handbrake to put into PLEX. I just came across my first DVD which was split between the two sides of the DVD.

So, half the movie is on Side A, and the other half is on Side B. I figured it’d be pretty easy to merge them together, but I am running into some issues.

  1. The first file that I’ve ripped has about 4 seconds of black screen I’d like to get rid of.
    -I can’t get MKVToolNix to split the file right where I want it because it apparently only splits at key frames. This makes it a few seconds wrong on either side of where I want to split it.

  2. At some point, I decided to just give up, and not worry about cutting a scene a second or two short. (Getting rid of the black still) So I decided to try and merge the first half of the movie and the second half together using MKVToolNix. I’ve followed some tutorials (but it seems like it’s pretty straight forward anyway) and when I click “remux” I am only greeted with errors. It never successfully merges them.

  3. I tried using VirtualDub, but that only works with AVI. I downloaded some plugins that allow me to open MKV’s, but it seems I can still only save AVI’s. (And when I tried to do that, it gave me an error anyway)

  4. I feel like this could be done with VirtualDub and AVI’s instead, but I’m worried about losing quality by changing over to AVI, doing the edits, then changing back to MKV. I also haven’t found reliable software that can convert for me. (Unless maybe handbrake can do it? I haven’t looked into that yet)

Anyway, I’m just curious if any of you have some great wisdom on how to do this seemingly simple task. Take a few seconds off the end of file 1, then merge the result with file 2.

Thanks for any help you can offer!

Use MakeMKV to rip the movie off the discs. This will rip the full DVD so if you want to exclude any tracks do it before the rip. Be sure you rip the same tracks from side1 and side2. You can/should be able to merge the two files with MKVToolNix.
You can then encode/cut the sections you don’t want OR cut the sections you don’t want then encode. I use SolveigMM Video Splitter to cut out and/or split movies/shows. It works really well and can cut by Key frames/time(seconds or whatnot)/frame-by-frame.

You will have better luck IF you merge the two ripped files before you cut the scenes. The reason is if you cut both file separately you may end with 2 files with slightly different encode parameters which will make the merge harder.

You can also just name the two files correctly and Plex will play them back:

https://support.plex.tv/articles/200264966-naming-multi-file-movies/

@ChrisAWallace said:
You can also just name the two files correctly and Plex will play them back:

https://support.plex.tv/articles/200264966-naming-multi-file-movies/

Poorly… and only if the client supports stacked files.

To expand on @NewPlaza 's sage advice…:
if the two files you’re trying to merge aren’t pretty much EXACTLY ALIKE - the merge will fail. At the VERY best a merge is the Hand Grenade approach to video editing… forget about frame accuracy.

If the two source files are MPEG-2 video streams frame accurate editing is possible, but what you need isn’t free. VideoReDo TV Suite 5 (for instance) will perform frame accurate editing of MPEG-2 video streams and it’s a wonderful thing if you happen to have it (best $95 I EVER spent). Apart from that just get them merged and be happy with the result - what you get is likely as good as you’re going to get it. If it’s anywhere near the ball-park - settle for it and walk away.

Great! Thanks for the responses all!

@NewPlaza, I’ll give your suggestion a go, and report back on how it goes.

@JuiceWSA, makes sense about the merge. Bummer that you can’t do frame accurate cuts, but C’est la vie! I suppose whatever I do, will ultimately be better than having a ‘mandatory intermission’ while watching my DVD…getting up from the couch, opening the DVD player, flipping it, and pressing play again. So what if I have one scene that is cut 2 seconds short. (It’s just an establishing shot too…so not like it’s all that important anyway)

I guess this is just the perfectionist in me coming out.

@trevzilla said:
I guess this is just the perfectionist in me coming out.

I know the feeling. Sucks sometimes. But have fun with SolveigMM Video Splitter. You will find the program very useful in deleting unwanted scenes from a movie or show.

So, for what it’s worth, I decided to try one more time before I actually purchased SolveigMM Video Splitter. And I think I got it to work!

I used MakeMKV to rip the DVD, and merged the two parts successfully. But since I didn’t have SolveigMM, I couldn’t remove that black screen from the middle of the merged file. So I decided to try one last time with MKVToolNix to edit the individual parts first, and then merge them. The only difference being that I hadn’t encoded yet. Well, it worked perfectly! MKVToolnix was able to cut the black screen off at exactly the right time. (I didn’t have a program that would tell me the time code of the exact frame I needed, but I did get it to the nearest 1/2 second. Probably could’ve kept gettting it better, 1/4 or even 1/8 second…but 1/2 second seems close enough)

After I trimmed the files with MKVToolNix to my satisfaction, I merged them successfully again with MKVToolNix. From there I used handbrake to encode, and viola, I’ve got myself a pretty good cut/merge!

Thanks all for the suggestions. I think the biggest one is make sure you do all the cuts/merges BEFORE you encode. That’s what I hadn’t been doing in the first place.

@trevzilla said:
I think the biggest one is make sure you do all the cuts/merges BEFORE you encode. That’s what I hadn’t been doing in the first place.

Yes indeed. Always try to keep the source files the same if you want to merge them. Encoding will change them.