This post describes my home media setup. Namely, how I rip and encode DVDs that I own using Handbrake, store them on a Raspberry Pi running Plex, and play them on my (Sharp) Roku TV. My encoding settings, media types, and subtitle formats are all chosen to avoid live Transcoding by Plex during playback, and allow reasonably high video quality.

I could never manage to convince my Chromecast to handle multiple audio and subtitle tracks correctly. Plex can handle these without issue, all while avoiding Transcoding if we set everything up correctly.

One aspect of this is subtitle type. It seems that keeping all subtitles as external .srt files is best, as this allows:

Plex to avoid "subtitle burn-in", which causes live Transcoding.

a better look to the subtitles while watching, since clients can freely manipulate text.

the ability to add new subtitles whenever we want, just by coping a file.

the ability to freely edit your own subtitles.

A note on opensubtitles.org: Yes it's possible to get loads of .srt files for free there. However, they're not guaranteed to have the exact timing that your particular DVD expects. So I personally think it's safest to use the subtitles supplied by the DVD itself.

"Lossless" Extraction of DVD Content

You'll need: makemkv and ccextractor . I use the makemkv tool. This pulls everything off of your DVD and wraps it in the .mkv container type. Nothing is reencoded, so you're getting the content as-is. The movie file itself will also be quite large, usually more than 5gb. It will also almost certainly not be in a Plex-friendly encoding, so once we've extracted the subtitles, we'll use Handbrake to reencode. We perform this step first instead of jumping straight to Handbrake in order to move past one bottleneck of our pipeline: the IO cost of getting the data off the DVD. The later Handbrake processes will be much faster this way. Steps: Open the makemkv GUI. If you have a DVD in a drive, it will be automatically detected.

GUI. If you have a DVD in a drive, it will be automatically detected. Before anything else, do which ccextractor in your terminal, and enter this full path in View -> Preferences -> Advanced . You'll only need to do this once.

in your terminal, and enter this full path in . You'll only need to do this once. Click the drive image to "open" the DVD. This will take a few minutes. After excluding tracks for trailers / bonus content, click Make MKV to save the DVD contents to your computer. This will take about 30 minutes.

Subtitle Extraction

You'll need: mkvinfo and mkvextract , both from the mkvtoolnix package. We're looking to create an .srt file from what's available in the DVD. If we're lucky, it will provide one for us. Otherwise we'll need to do some conversion. Extraction itself is easy. Let's first identify where the subtitles "are": mkvinfo the-movie.mvk SRT mkvinfo will spit out a lot of information, but let's look for Track type: subtitles . We're in luck if we see something like this: | + Track | + Track number: 9 (track ID for mkvmerge & mkvextract: 8) | + Track UID: 9 | + Track type: subtitles | + Default track flag: 0 | + Lacing flag: 0 | + Codec ID: S_TEXT/UTF8 | + Language: eng Notice the S_TEXT/UTF8 . This subtitle is already an .srt , so let's grab it: > mkvextract tracks the-movie.mkv 8:the-movie.en.srt Extracting track 8 with the CodecID 'S_TEXT/UTF8' to the file 'the-movie.en.srt'. Container format: SRT text subtitles We can then check the output to see if it's what we expect: > head the-movie.en.srt 1 00:00:27,044 --> 00:00:31,947 ♪ 2 00:02:57,227 --> 00:02:59,527 EXCUSE ME. 3 00:03:02,099 --> 00:03:05,167 Looks good. VOBSUB, then SRT If we found no S_TEXT/UTF8 entries, then we're stuck with VOBSUB, which is an image-based format. If used with Plex, it will force a Transcoding, so we'll convert it first. mkvinfo would show us something like: | + Track | + Track number: 6 (track ID for mkvmerge & mkvextract: 5) | + Track UID: 6 | + Track type: subtitles | + Default track flag: 0 | + Lacing flag: 0 | + Codec ID: S_VOBSUB | + Language: eng | + Codec's private data: size 511 > mkvextract tracks the-movie.mkv 5:the-movie.en.sub Extracting track 5 with the CodecID 'S_VOBSUB' to the file 'the-movie.en.sub'. Container format: VobSubs Writing the VobSub index file 'the-movie.en.idx'. Notice that it produces a .idx as well. Take both these files and visit subtitletools.com. Upload the files and wait for the conversion to complete. You now have your .srt ! Note that you may have to make minor corrections yourself, where the image-to-text translation software misread the words.

Reencoding via Handbrake