Handbrake, Subtitles, and subler.

Discussion in 'Apple TV and Home Theater' started by iOrbit, Sep 22, 2012.

  1. iOrbit macrumors 6502a

    Joined:
    Mar 8, 2012
    #1
    i need some help, i have some MKV's, and i can't get the sutitles to show with handbrake (i'v tried going ot the subtitles tab in the app and selected the foreign search but none of my movies have subtitles in the encoded result)

    can someone please explain to me how i get the subtitles from the mkv file, onto the encoded mp4 with subler?

    thanks in advance to anyone who can help or point me in the right direction to the information that can.
     
  2. Menneisyys2, Sep 22, 2012
    Last edited: Sep 22, 2012

    Menneisyys2 macrumors 603

    Joined:
    Jun 7, 2011
    #2
    EDIT 2: misread the OP and posted a tutorial on how MKV files should be created out of MP4's with retaining the subs. Will post an updated reply soon.

    EDIT 3: do you see any subs in the next MKV's:

    http://www.auby.no/files/video_tests/h264_1080p_hp_4.1_10mbps_dts_unstyled_subs_monsters.mkv (standardized Monsters test video, txt sub)

    https://dl.dropbox.com/u/13100693/html/042012RetinaHDVideoPlayers/lupaus-ads-orig.mkv (direct DVD rip of the Finnish movie "Lupaus" with original, VobSub subs)

    You should.

    It's only original BD subs (aka S_HDMV/PGS) that HB doesn't see; for example, the ones in https://dl.dropbox.com/u/81986513/082012/sublerSubs/IronSkyMAIN-rip.mkv . I'm pretty sure you have direct BD rips with the original subs. They need to be converted to VobSubs. If you need to know how it's done, I'll paste my entire tutorial I've written on this subject here. (It's pretty lengthy.)
     
  3. iOrbit thread starter macrumors 6502a

    Joined:
    Mar 8, 2012
    #3
    can you post it here?

    i can see the subs in those files.
     
  4. Menneisyys2 macrumors 603

    Joined:
    Jun 7, 2011
    #4
    Here it is:

    Blu-ray subs

    Unfortunately, as opposed to DVD subs, Subler doesn't support S_HDMV/PGS subtracks – the native sub format of Blu-ray dics. If you try to passthru them, Subler won't create a usable file; if you set Action to “3GPP Text” during opening the MKV file, no subtracks will be written to the target file.

    Basically, you'll need to extract these subtracks, convert them to the Subler-friendly DVD-based IDX / SUB-format and re-add them to the MKV. Then, you'll already be able to add them, both in their original (bitmap) and OCR'ed form, to the target MP4's.

    Let's start with subtraction. Unfortunately, my long-time favorite, iMkvExtract, doesn't support extracting these subtracks – it just doesn't export anything if you select one or more S_HDMV/PGS subtracks.

    For this tutorial, I've selected a part of the Blu-ray version of the excellent Iron Sky movie where German is spoken so that I can provide you with a test video you can play with with three subtitle languages as there are no English subtitles for English speech – and the Behind the Scenes section of the disc only contains Finnish subs, not English / Swedish ones (the Blu-ray is only sold in Finland; this is why there are not even Swedish subs here). The video chunk is HERE – feel free to download it and play with its subtracks.

    1, get and install MKVtoolnix (fortunately, it's a simple DMG file). Start it.

    2, click Add (annotated below) and load the MKV file:

    [​IMG]

    3, in the “Tracks, chapters and tags” list, look for entries starting with “S_HDMV/PGS”. Immediately following this type, in the parentheses, there will be some (track) ID's: in the above screenshot (also annotated), these are 5, 6 and 7.

    4, for the next part, you'll need to switch to the Terminal to access the command-line interface of the mkvextract program directly. Fortunately, it's part of MKVtoolnix so you don't need to install it separately.

    If you've dragged MKVtoolnix to Applications/Video, just issue the following command in Terminal (assuming you're in the same directory as your source MKV file; if you aren't, use the absolute / relative path to the MKV file):

    /Applications/Video/Mkvtoolnix.app/Contents/MacOS/mkvextract tracks MKVfilename trackID1:eek:utputSUPfilename1 [trackID2:eek:utputSUPfilename2 [trackIDN:eek:utputSUPfilenameN]].

    For example, in our case with three subtracks with ID's 5, 6, 7 and with a source MKV file named “IronSkyMAIN-rip.mkv”, the command will look as follows:

    /Applications/Video/Mkvtoolnix.app/Contents/MacOS/mkvextract tracks IronSkyMAIN-rip.mkv 5:sup1.sup 6:sup2.sup 7:sup3.sup

    An example screenshot with the results:

    [​IMG]

    Now, you'll need to convert these BD-specific sup files to traditional IDX / SUB pairs. Unfortunately, most of the traditional tools like SubtitleCreator 2.3rc1 (which I used in a previous article for DVB TS SUP -> IDX + SUB conversion) doesn't recognize the format; neither does SubMagic (which doesn't handle DVB TS SUP's either, BTW). The tool I recommend is, fortunately, fully OS X-compliant as it's written in Java: BDSup2Sub (dedicated thread). Just download BDSup2Sub.jar (the current, stable 4.0.1 version will be just fine) and double-click it.

    When the GUI is displayed, select File > Load and load the SUP files, one by one. Just click OK on the first two dialogs to dismiss them; after that, select File > Save/Export and, there, after setting the export language, Save:

    [​IMG]


    Now, to add the new, converted subtracks back to the MKV file, go back to MKVtoolnix and click the same Add button as above. Add the IDX files (only – no need to manually add the .sub files). You can mass-add them if you use the Cmd key while clicking for multiple selection. After adding the three of them, MKVtoolnix will show the following:

    [​IMG]

    Now, just click “Start Muxing” at the bottom left. The MKV file will be muxed; now, with the DVD-format VobSub track, also compatible with Subler.

    Now, what you will need to do is straightforward.

    1, Open the MKV file in Subler. Don't touch anything in the open dialog: do NOT try enabling the “S_HDMV/PGS” subtracks!

    [​IMG]

    2, Click Add and, then, you can save your video right away (Cmd + S): it'll have the OCR'ed audio tracks.

    If you also want to save in the same target MP4 file both the DVD-compliant VobSub bitmap subtracks in addition to the just-created OCR'ed version of them, you'll need to do exactly the same as was the case with DVD's. While still having the just-remuxed (target) MP4 file in Subler, click + in the upper left corner, select the MKV file (again) and set every single VobSub track action to Passthru from the default 3GPP Text; also, don't forget to disable all the non-VobSub-subtitle-tracks (all audio/ video etc. tracks) so that they aren't duplicated in the target file:

    [​IMG]

    To avoid the bitmap subtitles being shown with extra large, blown-up characters, you'll also want to decrease their size after(!!!) saving (Cmd + S). (Changes made before exporting VobSub tracks won't be visible.) To do this, click each of the just-added VobSub subtitle tracks (not the older textual ones!) and enter 1920 in the first field after Scaled Size (and press Tab) and 540 in the second, instead of the original 640 and 480, respectively (if it shows 0, make sure you save the file first!):

    [​IMG]


    Now, you can just save the file. (Again, here, you can also change the subtrack names to reflect their being bitmaps.)Why just 540? you may ask. I've found it the most ideal. When keeping the default one (after entering 1920 in the first textfield, it'll be computed to be 1440 as can also be seen in THIS screenshot), the bitmap subs will be in the center of the screen as can be seen in the following screenshot (click it for the original-sized one):
    [​IMG]
    After changing the default 1440 to 540, the subtitle will be a bit distorted (vertically scaled) but, at least, displayed at the bottom of the screen:
    [​IMG]
     
  5. shortcut3d macrumors 65816

    Joined:
    Aug 24, 2011
    #5
    Raising this old thread because I'm getting random static in Handbrake files after remuxing in idx subtitles using MKVToolnix. I've made sure header compression is off (now default behavior in latest version) and do not set default track flag for subtitles.
     

Share This Page