How To: Full Processing with Subtitles!

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
Post Reply
SilentDis
Posts: 5
Joined: Fri Apr 30, 2010 6:33 pm

How To: Full Processing with Subtitles!

Post by SilentDis »

This quick How-To will show you how to create a manageable sized MKV file for your Blu-Ray rips, complete with subtitles that will work great in any player you throw them at.

Many Blu-Ray disks do not hard-code any subtitles (Avatar and Kill Bill Vol. 1 come to mind), rather they do very fancy subtitles built into the Blu-Ray format. While this is wonderful for watching on a Blu-Ray player, most file players have no idea how to deal with them.

This document is generated from a Linux perspective; if you use a Mac or Windows environment, you'll need to muddle through a few items to get them to work for you.

The basic process is:
1- Convert the Blu-Ray movie into a large MKV file.
2- Strip out the subtitles into separate files.
3- Convert the subtitles into an easier-to-use format.
4- Re-encode and mux in the subtitle files.
5- Watch!

Tools you'll need:
Make MKV - This will rip the Blu-Ray disk and give you an easy-to-work-with MKV file.
mkvtoolnix - This will allow you to extract, merge, and generally play around with the different streams in an MKV file. Many Linux distributions have this in their repositories; on Ubuntu/Debian 'sudo aptitude install mkvtoolnix' will take care of it for you. We'll use this to extract the subtitles as-is from the MKV file.
BDSup2Sub - This will convert the subtitles into a format usable by most players (such as VLC).
Handbrake - Handbrake is an easy-to-use program to re-encode and re-mux your video files into a manageable size. If you prefer to use something else, by all means, have at it :)
VLC - A very very good media player. It plays virtually everything you throw at it. Again, use whatever you wish.

Step 1 - Rip your Blu-Ray Movie
Using MakeMKV, rip your Blu-Ray movie as you normally would. Make sure to place a check for the subtitles before you perform the rip. This probably will take a while, given the size of the format, as well as the general speed of your Blu-Ray drive, your hard drive, etc.

Step 2 - Pull the Subtitles Out
Once your movie is ripped, use the mkvtoolnix suite of programs to identify, then extract the subtitle files to .sup files.

As example, I have a freshly-ripped copy of Robin Hood Unrated (2010) here. We'll use `mkvinfo` to see what tracks are where, first:

Code: Select all

:~/BD Rips$ mkvinfo title01.mkv
+ EBML head
|+ Doc type: matroska
|+ Doc type version: 2
|+ Doc type read version: 2
+ Segment, size 24953852948
|+ Seek head (subentries will be skipped)
|+ Segment information
| + Timecode scale: 1000000
| + Muxing application: libmakemkv v1.6.0 (0.7.7/0.8.1) x86_64-linux-gnu
| + Writing application: MakeMKV v1.6.1 linux(x64-release)
| + Duration: 9348.722s (02:35:48.722)
| + Segment UID: 0x58 0x61 0xf5 0xf2 0xef 0x1a 0x8d 0xb9 0x8c 0x64 0x58 0x8a 0x6b 0xc3 0xf2 0xed
| + Date: Thu Sep 23 02:57:16 2010 UTC
|+ Segment tracks
| + A track
|  + Track number: 1
|  + Track UID: 1
|  + Track type: video
|  + Enabled: 1
|  + Default flag: 1
|  + Forced flag: 0
|  + Lacing flag: 0
|  + MinCache: 0
|  + Timecode scale: 1
|  + Max BlockAddition ID: 0
|  + Codec ID: V_MPEG4/ISO/AVC
|  + Codec decode all: 1
|  + CodecPrivate, length 114
|  + Default duration: 41.708ms (23.976 fps for a video track)
|  + Video track
|   + Pixel width: 1920
|   + Pixel height: 1080
|   + Interlaced: 0
|   + Display height: 1080
|   + Display width: 1920
|   + Display unit: 0 (pixels)
| + A track
|  + Track number: 2
|  + Track UID: 2
|  + Track type: audio
|  + Enabled: 1
|  + Default flag: 1
|  + Forced flag: 0
|  + Lacing flag: 1
|  + MinCache: 0
|  + Timecode scale: 1
|  + Max BlockAddition ID: 0
|  + Codec ID: A_DTS
|  + Codec decode all: 1
|  + Language: eng
|  + Default duration: 10.667ms (93.750 fps for a video track)
|  + Name: 3/2+1
|  + Audio track
|   + Sampling frequency: 48000
|   + Channels: 6
| + A track
|  + Track number: 3
|  + Track UID: 3
|  + Track type: subtitles
|  + Enabled: 1
|  + Default flag: 1
|  + Forced flag: 0
|  + Lacing flag: 0
|  + MinCache: 0
|  + Timecode scale: 1
|  + Max BlockAddition ID: 0
|  + Codec ID: S_HDMV/PGS
|  + Codec decode all: 1
|  + Language: eng
| + EbmlVoid (size: 61)
|+ Chapters
....
The list goes on, showing all the chapter entries and such, but we've found the subtitle track, number 3, and it's a standard Blu-Ray PGS subtitle. Also of note, I pulled all the English subs on the original, so I know there's no 'forced' subtitles on this movie.

Let's pull that subtitle out to a seperate file:

Code: Select all

:~/BD Rips$ mkvextract tracks title01.mkv 3:robin-hood.sup
Extracting track 3 with the CodecID 'S_HDMV/PGS' to the file 'robin-hood.sup'. Container format: SUP
Progress: 100%
This process will take a while, as it's got to parse the entire file for all the subs, and write them to a single file.

Step 3 - Convert the Subtitles
Now, we've got the subtitles in a separate file, we need to convert them to a different format so everything can use them. This is where BDSup2Sub comes in.

Make sure java 6 is installed and working properly on your computer (usually a package in your distribution's repository), and launch it.

Code: Select all

:~/BD Rips$ java -jar BDSup2Sub.jar
A nice, easy to use GUI will come up. Open your .SUP file, leave the settings as they are, and export them. You'll end up with a SUB file and an IDX file, that can be played by virtually any player, including VLC.

Also, you can now delete that .SUP file you created.

Step 4 - Re-encode the Movie With Your New Subtitle File
Open Handbrake, and use the original gigantic MKV file as the source.
Perform your standard cropping, scaling, and video settings for H.264 here, as always. When you're done, go to the 'Subtitles' tab, and click '+ Import SRT'. You'll want to select the IDX file you just created. Choose to default it if need be (forced subtitles file).
Begin your conversion!

After an inordinate amount of time, your conversion will complete, and you're now free to watch the file in your player of choice.

No DRM encumbrance, no missing subtitles.

I've come to the point where I add in the directors commentaries, multiple subtitle files, etc. Since I tend not to care about the pretty menus and such, this basically makes it a 'Blu-Ray Disk In A File' for me.

If you have questions, please post below, I'll check back :)
skittle
Posts: 349
Joined: Thu Jan 14, 2010 4:23 am

Re: How To: Full Processing with Subtitles!

Post by skittle »

You can also OCR the bluray subtitles to make new text SRT subtitles
http://exar.ch/suprip/
Post Reply