Converting MKV to M4V with subtitles

Discussion in 'Apple TV and Home Theater' started by LinMac, Oct 25, 2008.

  1. macrumors 65816

    Oct 28, 2007
    First of all I would like to start by saying that this thread is mostly about subtitle support. There is another thread here that deals with conversion of the video, audio, and pass through of both.

    I've tried two different methods of putting subtitles into m4v video:

    Burned in or permanent subtitles:

    1) Used mkvextract to extract the ssa subtitle track.
    2) Converted ssa subtitle track to srt subtitle track with Subtitle Workshop
    3) Cleaned subtitle track with Subcleaner
    4) Converted video into valid AppleTV mp4 with VisualHub.
    5) Opened video in Submerge, selected appropriate srt file, rendered subtitles, saved as self contained mov, imported into iTunes, and synced to AppleTV.

    Where I failed:

    Submerge is an excellent program that rendered the subtitles correctly, but there are two fatal limitations that I don't know how to work around.

    It only supports 2 lines of subtitles.
    It won't automatically wrap subtitle lines that are too long.

    I had Subcleaner limit the lines to 50 characters which will wrap some lines into 3 or even 4 different lines. 65 characters can help work around this, but some dialog is still into 3 lines which Submerge still cuts off. One line that I just looked at was 145 characters long and that isn't the longest one.

    Soft subtitles compatible with AppleTV/iPhone with Muxo:

    1) Used mkvextract to extract the ssa subtitle track.
    2) Converted ssa subtitle track to srt subtitle track with Subtitle Workshop
    3) Cleaned subtitle track with Subcleaner
    4) (Tried with and without this step with same results) Converted the srt document to utf8 with iconv (iconv -i ascii -t utf8 >
    4) Converted video into valid AppleTV mp4 with VisualHub.
    5) Opened video in Muxo, clicked + to add subtitle track, selected the track, clicked Add Track, closed the program.

    Where I failed:

    I opened all_done_subtitles_added.mp4 in Quicktime Pro without a problem, but after changing the file type to m4v so it will pick up subtitles QuickTime Pro gives the error: "The movie contains an incorrect duration." The file will open in VLC 0.9.4, but the seek bar is unusable as it tries to seek through what it thinks are thousands of minutes of content moving far too quickly.

    The real question:

    How does one actually add actual subtitle tracks from an mkv on a Mac? I have many tools that help get part of the process done, but competing the process seems impossible to do in a way that is actually readable on the screen.

    Please don't bother to suggest that I use QuickTime Pro + Perian to export the video directly from the MKV with subtitles read by Perian. This works at 5fps on a Late 2008 Macbook Pro and is unusable in my opinion.

    Final notes:

    I am using or have available OS X Leopard 10.5.5, QuickTime Pro, Handbrake 0.9.3 Snapshot 3 (r1797), VisualHub 1.34, Perian 1.1.2, Subtitle Workshop, Subcleaner, mkvextract, VLC 0.9.4, and other assorted tools. I am using Crossover from Codeweavers (Wine) for the Windows software so I do not have a full Windows installation available.
  2. macrumors newbie

    Oct 19, 2008
  3. macrumors 68000

    May 6, 2004

    If I understand what you want to do? Burn in Subtitles during mkv=>mp4 conversion?

    Short anwser: Perian and Visualhub:Advanced:Video:Force:Quicktime Decoding

    Is this what you want to do?

    FROM Visualhub forum: (not my post)

    "It's been mentioned before, but now that Perian 1 is officially out, I thought I'd make a new post on keeping subtitles in a VisualHub conversion. This is for (DivX or XViD) .avi files or .mkv files with external .srt or .ssa subtitles or for .mkv files with embedded srt or ssa subtitles......"

    Check out this post:;f=14;t=3733

    Post back here to let us know if it works for you.
  4. thread starter macrumors 65816

    Oct 28, 2007
    That can't/won't work.

    Quicktime decoding processes at below 5fps which means each 30 minute block of video takes 5 hours to process on the uni-Macbook Pro 2.8GHz with 128GB SSD. Quicktime just isn't usable for video encoding at those speeds.
  5. macrumors 68020


    Nov 18, 2007
    So would the soft subtitle one work with the extension mp4 not m4v? if it does I'll try and do this later
  6. thread starter macrumors 65816

    Oct 28, 2007
    I'm thinking that the mp4 container doesn't contain support for soft subtitles because Quicktime won't pick up that data if the file is named mp4. It will if the file is named m4v because of the different container format.
  7. macrumors 68020

    Mar 27, 2003
    .m4v and .mp4 are *exactly* the same container with a different file extension only, which for apple signals their devices to look for certain characteristics for some reason.

    eg. in HandBrake if you use AC3 in an mp4 and chapter markers, the atv will not see them. Simply rename the same file to mymovie.m4v and voila, the atv sees them. Same is true for just chapter markers on an iPod.
    Trust me, the muxer creates the exact same container. Go figure.
  8. thread starter macrumors 65816

    Oct 28, 2007
    Not a worry. I just assumed they were different containers because of the different Quicktime behavior, but it is good to know. :D
  9. macrumors member


    Sep 29, 2009

    LinMac I know it´s been a year but im trying to do the same thing and was wondering.. did you make it worked?

    How did you do it?

    I would really apreciate the help becasue i've been googling for some time now but can´t find a straight answer
  10. macrumors newbie

    Jan 9, 2010

    Wow. After all this time it came down to 2 more clicks.
    I don't know about for you, but for me... Keeping the subtitles in my MKVs is worth a 200 minute conversion for a 30 minute file. I'll just run it overnight.

    I use a 2.53 GHz Unibody MacBook Pro and that's how long the files are taking me. and YES it WORKS!

    To help out the previous poster, for the past 6 months or so I've been using a wonderful program called MKVTools to convert and keep the subtitles. This was working but unfortunately it causes a little bit of a degrade in the quality, and the subtitles can occasionally look really ugly/jumbled. A few days ago I decided to try out Quicktime X's encoding (with Perian) and the subtitles looked BEAUTIFUL (just like the original was intended to look) I rejoiced until yesterday when I found out that some of the files DROPPED AUDIO after being converted!!

    Using the method in this thread (which I only found because of frustrations with Handbrake... it really was a miracle) is working SEAMLESSLY so far! Again, that was

    Perian with Quicktime
    Visualhub:Advanced:Force:Quicktime Decoding

    AMAZING! I literally freaked out running around because of excitement for about 5 minutes after it worked! I've been working on this constantly for the last 3 years, and the last 8 or so hours were completely dedicated to it! I finally gave up, went to bed, decided to run one last search for "handbrake srt" and this came up as a related topic!!

    Hope pour souls in the future can find this thread as well. SPREAD THE WORD!
  11. macrumors newbie

    Jan 12, 2010
    But how do you configure VisualHub, because I can't find a way to choose the language (my MKV contains two subtitles). Or did you just add a seperate .srt in the folder?
  12. macrumors regular


    Mar 17, 2004
    I demux the video, audio, subtitles and chapters with iMKVExtract. I encode video to 720p in Handbrake, if needed. Then mux the mp4, ac3, srts and chapters together in Subler.

    I use Jubler to rewrite .ass subtitles as .srts. I currently use command line tools (mkvdts2ac3) to re-encode DTS to AC3 although I'm thinking of trying out this GUI app next time around.
  13. macrumors newbie

    Jan 26, 2009
    There are lots of options for .mkv files with subs. Lately, I installed Perian and I have Quicktime Pro. I open the .mkv in quicktime, along with the .srt or whatever form of subtitle you have and then SAVE (not export) it as a .mov file, then I use Toast, Popcorn or Handbrake to convert the .mov to .m4v. Works for what I use it for. I'm so anal about it, I even edit the .srt files in text editor if they're not JUST how I like them!:D
  14. macrumors 6502a

    Apr 5, 2010
    Sorry to dig up an old thread, but its what I could find on the subject...

    I've tried a couple of these methods, for getting a couple movies to mp4 with subtitles for viewing on the XBox 360, but it appears these subs aren't actually burned in, rather just contained in the container?

    (The 360 doesn't support traditional subs)

    Any suggestions?
  15. macrumors 6502

    Oct 4, 2005
  16. macrumors 6502a


    Feb 18, 2010
    I use Handbrake for this. If the subtitle is part of the original file (assuming mkv?), I don't think you have a choice but to burn the subtitles into the video. Subtitles have to be an external .srt file if you want to make the subtitle optional in Handbrake.
  17. macrumors 68000

    Jan 26, 2006
    Whitehouse, OH
    Handbrake can also convert closed caption tracks on DVDs as a soft subtitle track.
  18. macrumors 68020

    Mar 27, 2003
    As of HandBrake can now take in text based subs from .mkv's which means you can now get the mkv's soft (text) subs in your .m4v's (note this does not mean using ocr to read vobsubs).
  19. macrumors 65816

    Mar 13, 2007
    Houston, TX
    Can someone post an idiot's guide for this. Thanks.

    - An Idiot
  20. macrumors 68020

    Mar 27, 2003
    No guide needed, if soft subs are in the mkv they will show up in the source subtitle list in HB. Either compile the current svn head or wait til the next nightly is generated ( 4 a.m. in France iirc) and download the binary. Done deal.

    You will know if that commit is in the nightly by clicking on "recent changes" after choosing your platform.
  21. macrumors 6502a

    Apr 5, 2010
    To clarify...

    X-Box 360 will not read subtitle tracks/files. The subtitles have to be *burned into* the movie.

    I'll check out the nightlies of Handbrake, but last I heard they aren't doing burned subtitles from srt files...
  22. macrumors 68020

    Mar 27, 2003
    Correct. HB has no font rendering engine. Will only do text to text.

    Here is the thread that developed that in the current hb nightlies for reference:
  23. macrumors 6502a

    Apr 5, 2010
    Guess I'll look for something that can convert srt to vobsub (or whatever file type is necessary for Handbrake to burn in subs).

    Any ideas?
  24. macrumors newbie

    May 13, 2009
    I just opened the .mkv file (created with MakeMKV from DVD and Blu-Ray rip) in QuicktimePro7+Perian. Waited until it was read into memory, and then Exported the movie for AppleTV. It seems to run right around 1:1 conversion-time:running-time at 110%CPU on an iMac 3GHz Core2Duo.

    There is some terrible sound and problems when playing the mkv in QT7pro. It plays fine in VLC. The video exhibits bad blocky "compression type" errors, and the audio is mostly loud clicking. Maybe the QT glitch is due to a monophonic AC3 file?

    Anyway, the subtitles appear to be included, so if the audio and video problem could be resolved, this appears to be the easiest way to get movies with subtitles into the stupid DRM crippled viewing system that includes AppleTV.

    As someone mentioned above, The NIGHTLY BUILD of Handbrake ( ) converts these things fine! Whew. Problem solved. :)

    I am curious why Handbrake still releases a "64 bit" OSX app, when it's dependent upon VLC and VLC has stopped development of a 64bit OSX release.
  25. macrumors 68020

    Mar 27, 2003
    Simple, using vlc's dylib only allows hb to read a protected dvd. Period. Many (most?) users prerip their dvd content to make queueing up several encodes at a time much easier and/or use hb to transcode movie files. In either case there is no need for vlc and the 64 bit version of hb is around 15% faster than the 32 bit version.

    Also, you *can* find builds of the last relatively stable 64 bit vlc if you need to use hb on physical dvd's.

Share This Page