PDA

View Full Version : Converting MKV to M4V with subtitles




LinMac
Oct 25, 2008, 10:11 PM
First of all I would like to start by saying that this thread is mostly about subtitle support. There is another thread here (http://forums.macrumors.com/showthread.php?t=301017) 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 fileASCII.srt > fileUTF8.srt
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.



brc76
Oct 26, 2008, 10:34 AM
You might get some inspiration here http://forums.macrumors.com/showthread.php?t=584526 as I'm trying to solve the same issue but on a win platform instead

Kind regards
brc

spacepower7
Nov 9, 2008, 12:28 PM
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:

http://www.isquint.org/cgi-bin/ikonboard.cgi?act=ST;f=14;t=3733

Post back here to let us know if it works for you.

LinMac
Nov 9, 2008, 05:52 PM
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:

http://www.isquint.org/cgi-bin/ikonboard.cgi?act=ST;f=14;t=3733

Post back here to let us know if it works for you.

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.

northy124
Nov 15, 2008, 12:02 PM
So would the soft subtitle one work with the extension mp4 not m4v? if it does I'll try and do this later

LinMac
Nov 16, 2008, 07:35 PM
So would the soft subtitle one work with the extension mp4 not m4v? if it does I'll try and do this later

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.

dynaflash
Nov 16, 2008, 08:30 PM
It will if the file is named m4v because of the different container format.
.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.

LinMac
Nov 16, 2008, 08:52 PM
.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.

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

arturoimaz
Sep 29, 2009, 07:35 PM
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

Zenigame96
Jan 9, 2010, 04:59 AM
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:

http://www.isquint.org/cgi-bin/ikonboard.cgi?act=ST;f=14;t=3733

Post back here to let us know if it works for you.

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.

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


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!!

THANK YOU THANK YOU THANK YOU!!!
Hope pour souls in the future can find this thread as well. SPREAD THE WORD!

Tiestoo
Jan 12, 2010, 07:28 AM
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!!

THANK YOU THANK YOU THANK YOU!!!
Hope pour souls in the future can find this thread as well. SPREAD THE WORD!

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?

mcdermd
Jan 12, 2010, 05:03 PM
I demux the video, audio, subtitles and chapters with iMKVExtract (http://mkv4mac.free.fr/index.php?p=log#imk). I encode video to 720p in Handbrake (http://www.handbrake.fr), if needed. Then mux the mp4, ac3, srts and chapters together in Subler (http://code.google.com/p/subler/).

I use Jubler (http://www.jubler.org/) 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 (http://www.2shared.com/file/6497967/84811b69/DTS_to_AC3_convertorapp.html) next time around.

hotrod54chevy
Jan 25, 2010, 11:33 AM
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

Dorkington
Apr 27, 2010, 09:03 PM
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?

williedigital
Apr 30, 2010, 04:22 PM
it will do exactly what you want

deadwulfe
May 3, 2010, 03:11 PM
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?

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.

NightStorm
May 3, 2010, 03:46 PM
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.

Handbrake can also convert closed caption tracks on DVDs as a soft subtitle track.

dynaflash
May 4, 2010, 12:07 PM
As of http://trac.handbrake.fr/changeset/3283 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).

rayward
May 4, 2010, 02:01 PM
As of http://trac.handbrake.fr/changeset/3283 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).

Can someone post an idiot's guide for this. Thanks.

- An Idiot

dynaflash
May 4, 2010, 04:29 PM
Can someone post an idiot's guide for this. Thanks.

- An Idiot
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.

http://forum.handbrake.fr/viewtopic.php?f=6&t=15901

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

Dorkington
May 10, 2010, 09:24 AM
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...

dynaflash
May 10, 2010, 09:37 AM
I'll check out the nightlies of Handbrake, but last I heard they aren't doing burned subtitles from srt files...
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: http://forum.handbrake.fr/viewtopic.php?f=4&t=16099

Dorkington
May 12, 2010, 01:20 PM
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?

ckeilah
May 25, 2010, 10:54 PM
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.


<edit>
As someone mentioned above, The NIGHTLY BUILD of Handbrake ( http://build.handbrake.fr/job/Mac32/lastBuild/ ) 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.

dynaflash
May 26, 2010, 08:21 AM
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.
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.

mumdb1
May 31, 2010, 03:08 PM
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?

I've been trying to do this for over a year now, MKV titles with subtitles and I want to stream to the 360 with titles BURNED on the video. Can anyone help us?

Zenigame96
Aug 22, 2010, 12:30 PM
I've been trying to do this for over a year now, MKV titles with subtitles and I want to stream to the 360 with titles BURNED on the video. Can anyone help us?

As I said before, as long as you have Perian installed so that Quicktime will read MKVs and render the subs for you,

Visualhub:Advanced:Force:QuickTime Decoding.

This does work, it does burn the subs in, and it does create whatever type of file you would like. A couple of things I've noticed after going mkv crazy over the last 6 months or so....

1. Do not encode in h.264 while you have the "Force:Quicktime Decoding" box checked, Quicktime has some sort of a ridiculously stupid problem where it washes out colors when encoding in h.264. If you need the files to be in h.264 format, I would suggest first re-encoding with the "Force:Quicktime Decoding" box checked, but the "H.264" box unchecked, after that conversion is done (depending on the size/length of the file this can take around ~200 minutes for a 20 minute episode, and that's on a 2.53GHz Unibody MacBook Pro.), you will want to UNCHECK the "Force:Quicktime Decoding" box, take your new file (so say before you were converting "episode123.mkv" to "episode123.mp4", now you will want to be converting "episode123.mp4") and re-encode it AGAIN, with the "H.264" box checked, this should leave you with an H.264 type file, that was once MKV, with the subtitles burned in, and not looking like crap.

Also, something to note. I'm not sure why, and I haven't quite found a work around for this yet, but occasionally when you are re-encoding using the "Force:Quicktime Decoding" method, the files will come out with what I like to call "jaggies". The only fix (with good looking subs..) I've found for this so far, is to find an alternative release of the same video. Up until last night, I had only ever run into this issue with SD videos, but last night it actually happened to me with something that was encoded in 1080p. :( You could also settle for re-encoding these files using MKVTools (which I mentioned previously), but your subtitles may or may not come out looking nice/easy to read.

I hope this can be of help to somebody, as I've been wrestling with MKVs for years, so I definitely understand the frustration some of you must be feeling. I'll subscribe to this thread so that whenever somebody finds it and responds I'm actually notified. :P

Take care all, and if somebody figures out a work around for the "jaggies", I'd much appreciate some help there!

lbotez
Oct 23, 2010, 05:03 PM
That worked like a charm! Hey, thanks. You have no idea what a problem I've had with get subtitles on shows from the UK (my husband can't understand the accents; and the only way I can watch my favorite shows with him is with subtitles).

Quick question. the .srt files - is there a way to make the font smaller on the subtitles? Seems like it's a bit too large.

As I said before, as long as you have Perian installed so that Quicktime will read MKVs and render the subs for you,

Visualhub:Advanced:Force:QuickTime Decoding.

This does work, it does burn the subs in, and it does create whatever type of file you would like. A couple of things I've noticed after going mkv crazy over the last 6 months or so....

1. Do not encode in h.264 while you have the "Force:Quicktime Decoding" box checked, Quicktime has some sort of a ridiculously stupid problem where it washes out colors when encoding in h.264. If you need the files to be in h.264 format, I would suggest first re-encoding with the "Force:Quicktime Decoding" box checked, but the "H.264" box unchecked, after that conversion is done (depending on the size/length of the file this can take around ~200 minutes for a 20 minute episode, and that's on a 2.53GHz Unibody MacBook Pro.), you will want to UNCHECK the "Force:Quicktime Decoding" box, take your new file (so say before you were converting "episode123.mkv" to "episode123.mp4", now you will want to be converting "episode123.mp4") and re-encode it AGAIN, with the "H.264" box checked, this should leave you with an H.264 type file, that was once MKV, with the subtitles burned in, and not looking like crap.

Also, something to note. I'm not sure why, and I haven't quite found a work around for this yet, but occasionally when you are re-encoding using the "Force:Quicktime Decoding" method, the files will come out with what I like to call "jaggies". The only fix (with good looking subs..) I've found for this so far, is to find an alternative release of the same video. Up until last night, I had only ever run into this issue with SD videos, but last night it actually happened to me with something that was encoded in 1080p. :( You could also settle for re-encoding these files using MKVTools (which I mentioned previously), but your subtitles may or may not come out looking nice/easy to read.

I hope this can be of help to somebody, as I've been wrestling with MKVs for years, so I definitely understand the frustration some of you must be feeling. I'll subscribe to this thread so that whenever somebody finds it and responds I'm actually notified. :P

Take care all, and if somebody figures out a work around for the "jaggies", I'd much appreciate some help there!

Zenigame96
Oct 23, 2010, 08:46 PM
Every once in a while I will come across a video that QuickTime renders the subs as being ridiculously huge...when this happens I just use MKVTools (google it) and convert it using that way. The subs don't look as pretty, but it gets the job done. If you need any suggestions in regards to using MKVTools, feel free to respond and I should get an e-mail saying somebody responded on this thread again (like I did this time.)

Good luck!

That worked like a charm! Hey, thanks. You have no idea what a problem I've had with get subtitles on shows from the UK (my husband can't understand the accents; and the only way I can watch my favorite shows with him is with subtitles).

Quick question. the .srt files - is there a way to make the font smaller on the subtitles? Seems like it's a bit too large.

BlackMangoTree
Oct 24, 2010, 03:54 AM
Burning subtitles is easy for SRT use MKVtools. For SSA use Handbrake.
Would be nice if Handbrake could burn in SRT subs.

MacUser09
Nov 17, 2010, 01:55 PM
Forgive me, but I am a beginner at this.

I ripped my "2012" Blu Ray using MakeMkv.
Converted to mp4v, Apple TV preset, with 1280x720 custom anamorphic using Handbrake, as suggested in another thread here.
I also ticked the "Forced only", and "Burned in" boxes under "Subtitles", expecting them to be added.
However I can see the subtitles when I play the .mkv file, but not the mp4v.

Can someone explain in simple terms how I get them to show please?

ulis6
Nov 17, 2010, 03:50 PM
Hello everybody 

Donīt waist you time with VisualHub , IMKVEXTRACT , Squint , or Quicktime Pro , Demux, HandBrake or even FFMPEGX.

Buy Submerge (Bitfield) itīs only 9US$.

:) http://www.bitfield.se/submerge/index.html

This is the best App iīve ever tried to convert my videos to M4V with subtitles.

Try it īcos you wontīregret.

Ritsuka
Nov 18, 2010, 07:07 AM
Yeah right. I guess you didn't understand the issue here. The fact is that subtitles in bluray are not text, but bitmaps, and the subtitles format used by Apple is text-only.
So the only options are to translate it to text, download an already translated text file somewhere from the net, or burn the subtitles on the video.

Unfortunately HandBrake does not support bluray subtitles yet.

Richdmoore
Jul 11, 2011, 09:37 PM
I am trying to convert my HD-DVD (with MakeMKV) into apple compatible formats, and am having the same subtitle issues. I can't try the steps above, because Visualhub is no longer available.

Any other solutions, especially for a non-techie?

Aidoneus
Jul 12, 2011, 07:50 AM
Post#40 in this thread worked for me.

http://forums.macrumors.com/showthread.php?t=905628&page=2

Sheph
Jul 18, 2011, 09:05 AM
I have a mkv file along with the srt file and tried to convert that to mp4 via Handbrake using the Iphone 4 preset as i want to be able to watch it with subtiles.

I had already selected under Subtitles, Import SRT, clicked Add, select under Track, the srt file. Then i tried all combinations of forced only, burned in, default, but no combination worked.

I also know the srt files are fine as if i play the file under VLC player it's showing up. But i'd like to watch on iphone 4 while i'm on the road.

I really want to be able to get this done as I'm watching House MD and it's so much more enjoyable with the subtitles on. Thanks to anyone who can help!



(PS I use windows and has this other program called DVD43 installed in the background which supports handbrake while under windows. It worked fine with other dvd files i have.)