Skip to content

Instantly share code, notes, and snippets.

@thepwrtank18
Last active March 5, 2023 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thepwrtank18/9aac22bd24f91862b2e7ee77b5bce9fc to your computer and use it in GitHub Desktop.
Save thepwrtank18/9aac22bd24f91862b2e7ee77b5bce9fc to your computer and use it in GitHub Desktop.

Splitting files with ffmpeg and VLC

If you've ever used Jellyfin or Plex before, you know the pains of the "2 episodes per file" files. In this tutorial, I will show you how to split the episodes into 2 files.

  1. Install this addon for VLC: https://addons.videolan.org/p/1154013
  2. Play the original file, and make your way to the part where the first episode ends and the second one begins (usually marked by a black screen). Pause at that point.
  3. Go to View -> Jump to time (previous frame) v3. Set the time format to the point where it looks like "456,123", then click "Get time >>".
    image
  4. Copy that text, and save it somewhere.
  5. Run ffmpeg with the following arguments: ffmpeg -i "TV.Show.S01E01-02.mkv" -t [time text, replace "," with "."] -c:v copy -c:a copy -c:s copy "TV.Show.S01E01.mkv"
  6. Run ffmpeg again with the following arguments: ffmpeg -i "TV.Show.S01E01-02.mkv" -ss [time text, replace "," with "."] -c:v copy -c:a copy -c:s copy "TV.Show.S01E02.mkv"
  7. Tada! You have 2 seperate files. Do this for every file you have. (It gets repetitive, but it's worth it).

If you see part of the other episode in an episode, try pausing the video at a later/earlier time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment