If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

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

OttoKernerOttoKerner Posts: 26,360Members, Plex Pass, Plex Ninja Plex Ninja
edited January 2016 in Tips, Tricks & How-Tos

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

Help others too - by reporting back with your results!
Have you checked the Documentation before posting a question in the forums?
Use the SEARCH function before starting a new thread!
No PMs unless requested, please! Do not use 'verbose' logging
«1

Comments

  • OttoKernerOttoKerner Posts: 26,360Members, Plex Pass, Plex Ninja Plex Ninja
    edited October 2016

    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

    Help others too - by reporting back with your results!
    Have you checked the Documentation before posting a question in the forums?
    Use the SEARCH function before starting a new thread!
    No PMs unless requested, please! Do not use 'verbose' logging
  • adamskoogadamskoog Posts: 2,385Members, Plex Pass, Plex Ninja Plex Ninja

    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. :)

  • PlexhilaratedPlexhilarated Plexperimentalist Posts: 1,620Members, Plex Pass Plex Pass
    edited July 2015

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

    My Current Plexistence:
    Server: Intel i5, 14x3TB Internal Drives, Win-10, running PMS, PlexPy, PlexWeb, PHT, PMP, Plex for Windows 
    27" Samsung Monitor and Vivitek HD/3D Projector, 10' Diagonal Fixed Screen
    Dell Laptop: Win-10, running PlexWeb, PHT, PMP, and Plex for Windows
    Samsung 55" LED TV: Samsung Plex App
    Vizio 50" UHD TV: Vizio Plex App
    Samsung 40" LED TV: Samsung Plex App
    Tablet PC: Windows 8.1 Mobile App
    Motorola Droid: Android App
  • schindljschindlj Posts: 6Members, Plex Pass Plex Pass

    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

  • fishpatrolfishpatrol Posts: 29Members, Plex Pass Plex Pass

    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.

  • OttoKernerOttoKerner Posts: 26,360Members, Plex Pass, Plex Ninja Plex Ninja
    edited June 2016

    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.

    Help others too - by reporting back with your results!
    Have you checked the Documentation before posting a question in the forums?
    Use the SEARCH function before starting a new thread!
    No PMs unless requested, please! Do not use 'verbose' logging
  • fishpatrolfishpatrol Posts: 29Members, Plex Pass Plex Pass

    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.

  • TappistRTTappistRT Posts: 10Members, Plex Pass Plex Pass

    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.

  • seanfrisbeyseanfrisbey Posts: 113Members, Plex Pass Plex Pass
    via Email
    Make sure you're using "after specific timecodes" and your maximum number
    of files is set to 0.
  • TappistRTTappistRT Posts: 10Members, Plex Pass Plex Pass

    @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.

  • seanfrisbeyseanfrisbey Posts: 113Members, Plex Pass Plex Pass
    via Email
    Ha, sorry. I'm a dummy. Yes, unlimited is correct. Other than that...I
    don't know what could be wrong
  • OttoKernerOttoKerner Posts: 26,360Members, Plex Pass, Plex Ninja Plex Ninja

    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?

    Help others too - by reporting back with your results!
    Have you checked the Documentation before posting a question in the forums?
    Use the SEARCH function before starting a new thread!
    No PMs unless requested, please! Do not use 'verbose' logging
  • seanfrisbeyseanfrisbey Posts: 113Members, Plex Pass Plex Pass
    via Email
    Yeah, updating would be good...
  • TappistRTTappistRT Posts: 10Members, Plex Pass Plex Pass
    edited July 2016

    @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.

  • OttoKernerOttoKerner Posts: 26,360Members, Plex Pass, Plex Ninja Plex Ninja

    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.

    Help others too - by reporting back with your results!
    Have you checked the Documentation before posting a question in the forums?
    Use the SEARCH function before starting a new thread!
    No PMs unless requested, please! Do not use 'verbose' logging
  • TappistRTTappistRT Posts: 10Members, Plex Pass Plex Pass

    @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.

  • seanfrisbeyseanfrisbey Posts: 113Members, Plex Pass Plex Pass
    via Email
    Try remuxing it entirely anyway! Maybe that'll fix something.
  • TappistRTTappistRT Posts: 10Members, Plex Pass Plex Pass

    @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

  • OttoKernerOttoKerner Posts: 26,360Members, Plex Pass, Plex Ninja Plex Ninja

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

    Help others too - by reporting back with your results!
    Have you checked the Documentation before posting a question in the forums?
    Use the SEARCH function before starting a new thread!
    No PMs unless requested, please! Do not use 'verbose' logging
  • seanfrisbeyseanfrisbey Posts: 113Members, Plex Pass Plex Pass
    via Email
    Remuxing will not result in loss of quality. TRANSCODING will. Remuxing
    just pulls the MKV apart into it's individual parts, letting you relayer
    them as you choose, including adding or removing parts.
«1
Sign In or Register to comment.