View Full Version : DVD -> mp4 with subtitles
Sitron
13th May 2008, 16:50
Hi,
I'm new to this forum, but I have search without finding the solution. I am converting my DVDs to mp4 (to play on my Playstation 3). I have got everything to work perfectly, but now I want to add subtitles.
1. Is it best to use mencoder to extract the subtitles and hardcode them into the videostream?
2. Can I change the look of the subtitle?
3. Can I convert the VOB-subtitle to Mpeg4 text?
I hope some of you can answer :-)
rberger
14th May 2008, 05:50
Can't answer exhaustively, but may add some observations.
Obviously, hardcoding into the picture is not the optimal solution, since you
can't turn subtitles off anymore. I never did that, but apparently mencoder
supports this, and also has options to manipulate the appearance of the
subtitles. I guess the usual approach would be to add a black band at the
bottom via "expand" and place the subs there. Change in appearance will
mostly be limited to color/transparency, since vobsubs are afaik principally
bitmaps, and e.g. changing the font would imply character recognition,
which generally is the hardest part of dealing with subs and can't be done
by mencoder. The mencoder man page is btw generally pretty instructive.
Where you still have questions, I can recommend their mailing list.
The next question would be if DVD vobsubs can be muxed into mp4 as they
are. Apparently, nero is capable of this via a private stream extension. There's
been a patch to gpac/mp4box to support this kind of muxing some time ago
http://sourceforge.net/tracker/index.php?func=detail&aid=1477731&group_id=84101&atid=571740
but again, I didn't try that myself and don't know whether that patch was
integrated and, if so, whether the functionality is still supported by mp4box.
You'll have to find out yourself.
That said, if you succeed muxing it in, there's always the question of player
compatibility. I.e. the question which players will correctly demux and play
back your stream. I guess it won't be too many, but nero certified ones should do.
Last, the question of conversion to a text format. This involves character recognition
(OCR) and in my experience can't be fully automated. Here's a link to get
you started
http://www.bunkus.org/dvdripping4linux/en/separate/subtitles.html
The approach there basically works, but the result will just be as good as
the OCR engine, in this case gocr. I also tried a different engine once
http://code.google.com/p/tesseract-ocr/
which was supposed to do better, but didn't really in my experience.
So if you go that way, it will involve manual correction of the generated subs.
I did that for two of my fav movies and wrote me a little script to loop over
and simultaneously display the text/bitmap subs in emacs so that I could
easily correct the text version. It still took me hours (over 1200 subs per
movie). So this is best described as the thorny path I guess.
Bottom line: apart from hardcoding, which has it's own drawbacks, there's
no fail safe, fully automated and broadly compatible way to get vobsubs into
an mp4 container. To my knowledge, that is.
1. Is it best to use mencoder to extract the subtitles and hardcode them into the videostream?
This is probably the easiest way. Of course, hardcoding the subtitles should be done at the same time when re-encoding the video in the first place.
2. Can I change the look of the subtitle?
As rberger said, only a bit if you use the original subtitles. For greater flexibility you would need to OCR the subtitles and then render them to the video with the desired font. For OCR, Windows tools like SubRip probably work better than gocr-based native programs, so you could try running them in Wine.
3. Can I convert the VOB-subtitle to Mpeg4 text?
Yes, if you OCR the subtitles, but I don't think that PS3 supports MPEG-4 TTXT either?
rberger
14th May 2008, 13:20
For OCR, Windows tools like SubRip probably work better than gocr-based native programs, so you could try running them in Wine.
As it happens, I installed me a WinXP copy I had lying around in VirtualBox a couple of days ago, to try out some windows utilities.
So I just checked SubRip on the "Mulholland Drive" DVD, which contains a mixture of plain/italics text and even music notes in the subs. I can confirm that it works very well once you figure out how to handle it best, and get's you done much faster than the native approach I mentioned above.
The generated srt contained a couple of errors still, but they were minor and easily corrected during a single reading through the file. Definitely helpful.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.