After searching through the forums and on the search engines, e.g. Google, Bing, etc., I’ve come across some information I wanted to share.
I’ve been trying and have succeeded in adding soft subtitles to an m4v (mp4 container) so that both soft subtitles and chapters work. One complication is that I’m on Windows and am not able to use Subler, iSubtitle, etc. I’ve finally gotten it to work, at least in one instance on the French movie Taxi.
Here are my steps and observations.
Software I’m using for muxing/editing:
• Handbrake 0.9.5
• HxD Hex Editor
• YAMB 18.104.22.168 beta 2
Software & hardware I’m using for playback:
• iTunes 10.2 (modified setup so that it installs on WHS)
• AppleTV2 w/ firmware 4.1.1
1. Create mp4/m4v
First thing I did is transcode the movie from the DVD without a subtitle track in Handbrake. I use the iPhone4 preset and then add the Decomb filter and set the Constant Quality slider to 12.5. Be sure to let Handbrake create chapter markers. Make sure the resulting file has no spaces or special characters in the title. My resulting file is Taxi.m4v.
2. Get SRT file and convert to TTXT
I got mine from opensubtitles.org. Open YAMB and convert the SRT to TTXT. Make sure the ttxt filename is the same as the m4v file, i.e., taxi.ttxt.
3. Add subtitle file to MP4 container
Open your m4v file in YAMB and add the TTXT file to the container. Set the language of the ttxt file to English and set the font. I just went with MS Sans Serif 10. One thing I’m not sure of here is if the order of the files in the container matter. I’m going to assume they do. My order is 1st video , 2nd audio, 3rd txt file (this is the chapter file Handbrake created), 4th ttxt subtitle file. Note I changed the output file extension to m4v. Just do this when naming the output file.
4. Correct the mp4 handler
From everything I read online you have to go in and correct the subtitle handler from “text” to “sbtl”. However, with mine I had to do the opposite. I opened my file in iTunes and saw 2 subtitle tracks one for English and another for Unspecified. The Unspecified is the chapter text. Seeing this in iTunes confirms YAMB/MP4Box created the sbtl handler and I need to go in and change the Unspecified from “sbtl” to “text” so chapters are recognized as chapters instead of subtitles. Note when I didn't have the chapters and only had the subtitles in the MP4 container I had to change text to sbtl. Maybe there is something with having multiple text pieces that prompts YAMB/MP4Box to make the handlers sbtl instead of text?
Open the m4v in HxD Hex Editor. Do a search for hdlr. In my case and as I set them in YAMB, the 1st one was the video handler, 2nd was the audio handler, evidenced by the “GPAC ISO Audio Handler”, 3rd was a sbtl and 4th was another sbtl. The 4th had “GPAC Streaming Text Handler” shortly afterwards and this told me the 4th was the subtitles. Clearly the 3rd hdlr had to be the chapters. I went back to the 3rd hdlr and found the sbtl right after it and changed it to text. Save the M4V file.
That’s it! The file plays in iTunes and the AppleTV2 with chapters and subtitles. I must note that there appears to be an issue on the AppleTV2 in that it displays the subtitles really small and you can’t change the size. From reading around this is being addressed in iOS4.3.
+ Reply to Thread
Results 1 to 6 of 6
Mike, Thanks a million it worked great! Just what I needed. YOUR're the mannnn.
You got me there, only mike can answer that.
I've been collecting many great softwares and advices from this website. Though I could find some useful information from this thread (thanks Mike and all others), I couldn't find an answer to the issue I have now and that makes me register and write this 1st post on here. Hopefully someone has leads to the solving of it.
So here it is:
I want to soft-code several subtitles (.srt files) in a .mp4 container. To do so, I first used Yamb/MP4Box, then My MP4Box GUI. Both of them fail to mux one specific .srt file, while the 13 others get muxed in fine.
As error notification, I get from YAMB:
[23:34:11] : Importing SRT File...
[23:34:12] : Invalid UTF Data
[23:34:12] : Error importing c:\Users\...\Uploads\Subs\Film_01\Film_01.Czech.sr t:lang=cs: Corrupted Data in file/stream
[23:34:12] : Creation failed.
Timed Text (SRT) import - text track 720 x 576, font Serif (size 18)
Invalid UTF data (line 7)
Error importing c:\Users\...\Uploads\Subs\Film_01\Film_01.Czech.sr t:lang=cs: Corrupted Data in file/stream
I checked that line in the .srt file and didn't find anything particular, apart from maybe a specific czech letter (ž). The .srt file is saved as ANSI like all other .srt files I mux. Anyway, when I leave the 7th line blank and re-try the muxing, I get the same type of error message, this time only on another line (30 something). There is this "ž" letter at that other line too, but after a little check, I can find it in other lines in-between. Which means that specific letter is not likely the source of the problem (well, I'm pretty sure the Czech alphabet is not the issue here, but I'm trying to understand here ^^).
Anyway, would anyone have an idea on how I could fix that?
Strangely, this .srt get muxed in fine when making a .mkv, but not here...
Plus, no matter if I convert the .srt into .ttxt, both Yamb and My MP4Box GUI won't accept this specific file. And yes, the file does bear the same name than the source file.
Thanks in advance for any help!
(this is a copy-paste from a new thread I posted here https://forum.videohelp.com/threads/350539-Invalid-UTF-Data-when-muxing-srt-file-in-mp4...4Box?p=2197378 ; I hope there's nothing wrong by posting that somehow twice :-S ...)