V1x0r's MKV Rebuild Utility
MKV's With Posters
HDR+ Screenshot Example

This guide and my utility will assist you in cleaning up your media library AND save LOADS of space without losing any noticeable quality!  This is my personal utility that I built to help with my own media file handling.  My goal is to continue advancing this tool into a program that can make media management even easier!

Presently this Supports HDR10 AND HDR10+

I began this project when I was in the military as deployed members usually share movies for entertainment in the field.  Many formats weren’t natively playable on phones or computers and you required special software.  I wanted to uniform the ability to play the movies on all devices as well as have posters so you knew what movie you were watching.  MPAA ratings (G,PG,R, etc) and dates to help members know if it was the movie they wanted to watch or not.  It has since evolved to help drastically reduce bandwidth when streaming from a computer/server either in your home (via Kodi/XBMC, etc) or out to friends and family (Plex).

I’ve decided to make this project public so as to help others easily manage their media without having to stress or spend hours hopefully configuring each movie or episode or personal video files via handbrake or other utilities.  These utilities also will often make changes to the audio codecs and I didn’t want to reduce audio quality any lower than it may already be.  I also wanted to have a “Set it…and Forget it” mindset when it came to conversion.  I had issues OFTEN with several programs that would randomly fail without error and I would have to start the manual process of tagging and queuing each individual file again.  This was BORING!!!

Currently the “application” is an SFX Archive (created with WinRar) that executes a VB Script.  It is rather ghetto in that fashion but it works.  The script will use a few files included in the executable.  FFMPEG.exe (Which I personally compile regularly with SEVERAL additions added to it so as to make it far more capable), MediaInfo.exe and mediainfo.dll (Which i do not compile), and MP4Box.exe (which I do compile alongside FFMPEG.exe).  FFMPEG is what I use for converting whatever video codec that is in the media file into h265.  (H265 is 1/3-2/3 the file size of h264 at the same quality).  I use crf 21 (which is overkill and honestly creates slightly larger files)…but I wanted to maintain as much of the original quality as I could.  I use ffmpeg to also convert incompatible audio codecs into compatible codecs.

I will provide instructions below for HOW to use utility.  currently it has specific requirements that must be met.  I will be creating a GUI at some point, which will obviously make this MUCH easier for configuring things yourself.

Requirements
Applications
Movies

A poster must be provided (Currently)
The poster must have the exact Movie File Name with “-poster” at the end of it.

Example:
.\Folder\Movie1.mkv
.\Folder\Movie1-poster.jpg
.\Folder\Movie2.mp4
.\Folder\Movie2-poster.jpg

Sample:
.\Guardians of the Galaxy (2014 PG-13).mkv
.\Guardians of the Galaxy (2014 PG-13)-poster.jpg

TV Shows

TV show folders MUST be named and ordered correctly
With the Season Folder containing a Space between Season and Season Number

Example:
.\ShowName\Season 01\S01E01EpisodeName.mkv
.\ShowName\Season 02\S02E01EpisodeName.mp4
.\ShowName\Season01-poster.jpg
.\ShowName\Season02-poster.jpg

Sample:
.\Archer\Season 01\S01E01.Mole Hunt.mkv
.\Archer\season01-poster.jpg

Getting Cover Art and Media info Using Kodi
  • Install Kodi and point Kodi to your “to be converted” TV Shows and your Movies directories
  • View all the Seasons for TV Shows so as to force download the images. (go into the TV Show so as to see Season 01, 02, 03, etc)
  • Select the Options icon (the gear if stock theme)
  • Select “Media Settings”
  • Select the gear icon on the bottom left (likely says Standard), Click this until it says “Advanced” or “Expert”
  • In this settings area Hover over “Library”
  • If you remove media select “Clean Library” before exporting..so you don’t get files for media you already moved/converted
  • Select “Export library” > Separate > Yes (to export thumbnails and fanart) > No to Actor Thumbs > Yes/No (for “Overwrite old files?”)
  • Depending on how large your library is this may take a minute…just wait.
  • Now all covers should be exported nicely for converting!
Fixing File Names (TV Shows and Movies)

This is rather straight forward…but it does require that Kodi has exported the TV Series Episode information as well as the Film information in the .nfo format.

You should see something like

  • TV Series
    • Season Number
      • Episode Name.mkv
      • Episode name.nfo
  • Film Folder
    • Film Name.mkv
    • Film Name.nfo

With the above naming convention matched then the Renaming utility should “just work”

CRITICAL:

to Rename Films simply place the EXE in the same folder as the films.

To rename TV Series the EXE needs to be placed in the PARENT folder for the TV Series (NOT sub season folders) (This is faster anyway).

Converting! (The easiest part!)
Movies
  • Copy “!HEVC_Rebuild_MKV_###.exe” to the Movie Folder where your movies and cover art is located

Sample:
.\Movies\!HEVC_Rebuild_MKV_###.exe
.\Movies\Guardians of the Galaxy (2014 PG-13).mkv
.\Movies\Guardians of the Galaxy (2014 PG-13)-poster.jpg

  • Execute the program…either with a Double Click or select it and press enter.
    (If only Administrator has rights to the directory..then run as admin)
  • Wait until it completes. This can take a LONG time depending on your computer and the movie file.
    (I’ve had some films take sever days on my server)
TV Shows
  • Copy “!HEVC_Rebuild_MKV_###.exe” to the root of the TV Series you wish to Convert/compress

Sample:
.\Archer\Season 01\S01E01.Mole Hunt.mkv
.\Archer\Season 02\S02E01.Swiss Miss.mp4
.\Archer\!HEVC_Rebuild_MKV_###.exe
.\Archer\season01-poster.jpg

  • Execute the program…either with a Double Click or select it and press enter.
    (If only Administrator has rights to the directory..then run as admin)
  • Wait until it completes. This can take a LONG time depending on your computer and the movie file.
    (I’ve had some TV Series take a couple weeks on my server)
Important Notes
  • Existing media files will be renamed to old_Filename
  • TV Shows with Two episodes will need to manually modify the .nfo file created by Kodi to remove the second stack of episode information.
  • Accent Characters may not properly Rebuild/Cover
  • I have not worked in Audio Delay yet….I need a file with this to experiment with.
  • Bulk Rename Utility can be VERY helpful with incorrectly named tv series that aren’t working with theRenamer
    URL: http://www.bulkrenameutility.co.uk/Main_Intro.php
  • If you have an issue then please provide as MUCH information as you can about the file and potentially the file itself.
  • Check back for here for updates
    (I will have to add an update function at some point)
  • If you edit my code or have suggestions for it, please feel free to share with me.
    (I know it currently is messy…some parts are notes.)
  • I build ffmpeg with NON Free components…this is for personal use ONLY!

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment