[HowTo]: splitting multi-episode files with MKVtoolnix GUI


#1

The purpose of this HowTo is to split videofiles which contain more than one episode of a tv show into single-episode files. So they show up individually within plex, can be played individually and don’t produce any of the weird things that multi-episode files are plagued with.

The tool used is MKVtoolnixGUI
it is freely available for all major PC operating systems.

Therefore the container format of the output files will be MKV.
The input format can be a multitude of containers like AVI, MP4, MKV, MPEG, TS, DIVX and several more.
The quality of the files will remain the same, because mkvtoolnix only remuxes the files, it doesn’t re-encode them.

This HowTo will use the newer MKVToolnixGUI that is available from V8.0.0 of MKVtoolnix on.
(The older MKVmergeGUI has been deprecated and will be unavailable soon.)

right on:

  • start up MKVtoolnixGUI
    (depending on your operating system, this might look a little bit different)

  • drag the multi-episode file into the window marked by my crude arrow

  • the video, audio and subtitle tracks it contains will appear in the window underneath it

  • you may want to revise the language code that is assigned to the audio track(s) and the language and ‘forced’ attribute of subtitle tracks so the Plex interface informs you correctly about the languages available. Plex’s automatic audio and subtitle track selection feature relies also on these tags to work correctly.

  • change to the Output tab:

  • change ‘Split mode’ to ‘after specific timecodes’

  • input the timecode of the episode break into the field ‘timecodes’ (you can input several timecodes [separated by comma] if your source videofile contains more than two episodes) (I chose to split after 25 seconds, because my example file is only 59 seconds long)

  • revise the path and filename in ‘Output file’ to your needs

  • click Start muxing

You should find 2 or more MKV files in the destination path, their file names appended by a three figure number (‘DVD Introduction-scene-001.mkv’ and ‘DVD Introduction-scene-002.mkv’ for our example file in the screenshots)

Now rename the split episode files according to the Plex naming guide for tv show episodes and add them into your library.

Done.

Guide for joining video files with MKVtoolnixGUI


Naming tv show with multiple seasons in single file
Separating English and Japanese versions of the same show
Plex is detecting couple different episodes of Adventure Time as copies (I think)
How do you manage your media's (naming convention and metadata)?
#2

please feel free to add other guides and software to split episode files into other target file formats. But please add whether the method employs pure remuxing (quality of the file stays the same) or re-encoding (quality is diminished)

this software supports splitting losslessly too, if setup correctly (it is a ffmpeg GUI):
https://forums.plex.tv/discussion/118791/dmmediaconverter#top


#3

Nice writeup, this is likely to help a lot of people out. It would be good to mention also that this is a great tool for doing the reverse (joining 2 files together) as well. :)


#4

You are the man.
Perfect subject.
Many people need this.


#5

This is wonderful thank you! I still dont understand why cartoon stuff (where 2 "episodes" air together in 1 time block always ) are listed separately like this. Officially they only have 22-24 episode seasons and this makes each season have double the episodes


#6

I've used MPEG Streamclip to split episodes for years. You trade being able to visually select where an episode ends for being able to split it in one action, I guess. It's also easy to make cuts on keyframes, which I'm used to do after editing lots of EyeTV TS files. Does MKVtoolnix handle this differently, or is this not an issue with H.264 files? It is annoying to not be able to split a file exactly where you'd like to.


#7

Cutting at exact keyframes would require the h.264 videostream (at least partially) to be decoded and then cut and re-encoded again.
mkvtoolnix does not do this. It cuts at the nearest I-frame.
But I don't consider that an issue, since most double-episode files have at least one or 2 seconds of black between them.

My method is about preserving the quality and making no change to the data streams whatsoever.
If you need exact cutting, use a different means.
VideoReDo would be such a program which can cut quite exactly.


#8

Thanks. I'm so used to streams breaking without cutting at keyframes, I just assumed. I gave it a quick try and it worked fine. It's splitsville for you, Curious George.


#9

First, thanks for writing this tutorial. I've tried multiple different methods to get MKVToolNix to do what I want, but I don't seem to have any luck.

I have some multi-episode mkv files that are 3-5 episodes each. I tried using the comma method to separate timecodes according to the format provided, but MKVToolNix only outputs one file at the specified timecode for the first file and ignores the rest.

For example, my Timecodes box reads:
00:24:34.25,0:48:58.25,1:13:21.25

MKVToolNix only muxes one file at 00:24:34.25

Can anyone advise on how to get it to behave properly?

Thanks.


#10

Make sure you're using "after specific timecodes" and your maximum number
of files is set to 0.


#11

@seanfrisbey said:
Make sure you're using "after specific timecodes" and your maximum number
of files is set to 0.

"after specific timecodes" is checked

max number of files is/was set to "unlimited." 0 isn't an option.


#12

Ha, sorry. I'm a dummy. Yes, unlimited is correct. Other than that...I
don't know what could be wrong


#13

Just tested it and it worked here.
Have you tried to 'pad' your timecodes with leading zeros?
00:24:34.25,00:48:58.25,01:13:21.25

Hace you updated mkvtoolnix?


#14

Yeah, updating would be good...


#15

@OttoKerner said:
Just tested it and it worked here.
Have you tried to 'pad' your timecodes with leading zeros?
00:24:34.25,00:48:58.25,01:13:21.25

Hace you updated mkvtoolnix?

Yes and yes. I can post my output log if anyone's interested. It doesn't show any errors.


#16

If your source file is not a MKV yet, try to mux it into a MKV first, so the file has proper timestamps.
Then repeat the 'split' attempt.


#17

@OttoKerner said:
If your source file is not a MKV yet, try to mux it into a MKV first, so the file has proper timestamps.
Then repeat the 'split' attempt.

They are mkv files.


#18

Try remuxing it entirely anyway! Maybe that'll fix something.


#19

@seanfrisbey said:
Try remuxing it entirely anyway! Maybe that'll fix something.

That seems to be the problem. I tried a different MKV file for comparison, and it worked fine.

Is this a good walkthrough to follow so I can remux without any loss in quality?
https://support.plex.tv/hc/en-us/articles/201097958-Remuxing-Files-to-MKV


#20

if the source is a MKV, all you need to do is to drag it into MKVtoolnixGUI and hit 'Start muxing'