I’m in the process of ripping some boxsets of DVDs to Plex, and I thought I should probably document the process. The most obvious thing I’m not using here is Handbrake, which works really well for some people, but I am not one of them.

Physical to Digital

MakeMKV turns any DVD or Bluray I’ve thrown at it into an MKV file. The one thing it could do to make my life better would be custom tags on filenames, but the default {Directory}\{DVD Identifier}\title{nn}.mkv  is good enough. {DVD Identifier} is annoyingly unspecific most of the time, and sometimes within disks of the same box set (The thing I’m currently ripping has both WW_S4_T5_D3 and WESTWING_S4_D6 in it, as discs 1 and 6 respectively), so the next stage is to make those directory names consistent. It doesn’t matter what they are, so long as when I “ls” the directory, they are in the right order. Then, I run this:

Note: You’ll need to collapse that back into a single line without the comments for it to work:

This gives me a directory of well-named MKV files.

Digital to MP4

Plex is happier with mp4 encoded videos than with MKV files, though, plus they’re smaller without a noticable (to me) drop in quality, so when I’ve got a few series of these built up, I’ll run this overnight:

Where encode.sh looks like this:

Which is a standard ffmpeg encode line, the only real weirdness being the ${file%.*}.mp4 bashism, which basically turns the $file variable from “Foobar.mkv” into “Foobar.mp4” (It will also turn “Foo.bar.mkv” into “Foo.mp4” though, so be careful)

MP4 to Mediacentre

Once that’s finished, I’ll get rid of the mkv files, and send them into Plex. To ensure consistency of my filenames and also get any subtitle files I need, this is done using filebot, like this:

(Filebot, rename using the (included) automediacentre script. Output to directories below my media drive mount, log to amc.log, move (don’t copy) the files, if it already exists skip it. Don’t do strict checking, download music, search for subtitles, get series artwork, send TV shows to the “TV Boxsets” directory in {Series Name}/S{Series Number}/s{Series number}e{Episode Number} – {Episode Title} format. Anime should go somewhere else, Movies somewhere else, Music somewhere else, then notify plex on the local machine. Do this on the current directory)

Operating System Notes

None of this is OS specific. Filebot, FFMPEG Plex & MakeMKV are available – and work identically – on Windows, Mac & Linux. The various bash scripts could be adapted to powershell, but I’d instead recommend Babun, which is a repackaging of cygwin with a far nicer interface and package management system that’ll give you the basic *nix commandline tools on your windows machine (all of the above up to MP4 to Mediacentre runs on my beast-sized windows gaming rig, to avoid making the puny media centre CPU cry too much)