View Full Version : mp4box not processing <font> tags in .SRT subtitle mux
bennynihon
20th July 2014, 06:45
I'm trying to properly import a .SRT file, using MP4Box, that contains <xml> or <html> type tags
1
00:00:00,010 --> 00:01:55,110
<font color="#ffff80"><i><b>This is a test</b></i></font>
Problem is, when playing the muxed output .m4v file on an Apple TV or in iTunes, those <font> tags are shown in the actual subtitle text. It's clear the options I have tried fail to get MP4Box to properly process the .SRT into an Apple compatible .mp4/.m4v file. I'm doing something like the following.
mp4box.exe -add movie.h264 -add audio.ac3:lang=en -add subtitles.srt:lang=en:hdlr=sbtl -new output.m4v
Documentation is a bit spotty, so it's unclear to me if there are better options to ensure Apple compatible output, or if it simply cannot process <font> tags properly.
Oddly though, if you use mp4box.exe -ttxt subtitles.srt that seems to incorrectly process the <font> tags too.
<TextSample sampleTime="00:00:00.010" xml:space="preserve"><font color="#ffff80">This is a test;</font><Style fromChar="24" toChar="71" styles="Bold Italic " fontID="1" fontSize="18" color="ff ff ff ff"/>
</TextSample>
Any help is appreciated.
Selur
20th July 2014, 13:24
Nor really surprising, that the whole html tagging of the fonts is not supported by most programs, since afaik. the official srt sepcification didn't include any formating. So all formating additions are kind of in official.
-> your might want to look at tools which specify in subtitle handling and conversion to get a better srt -> ttxt conversion
Kurtnoise
21st July 2014, 10:41
It doesnt make any sense to have a font color without knowing the font name or the font family related...
SeeMoreDigital
21st July 2014, 20:16
Agreed...
A typical 'TTXT' header contains the following type of information: -
<?xml version="1.0" encoding="UTF-8" ?>
<!-- GPAC 3GPP Text Stream -->
<TextStream version="1.1">
<TextStreamHeader width="1024" height="432" layer="0" translation_x="0" translation_y="0">
<TextSampleDescription horizontalJustification="center" verticalJustification="bottom" backColor="0 0 0 0" verticalText="no" fillTextRegion="no" continuousKaraoke="no" scroll="None">
<FontTable>
<FontTableEntry fontName="Serif" fontID="1"/>
</FontTable>
<TextBox top="0" left="0" bottom="432" right="1024"/>
<Style styles="Normal" fontID="1" fontSize="24" color="ff ff ff ff"/>
</TextSampleDescription>
</TextStreamHeader>
<TextSample sampleTime="00:00:00.000" xml:space="preserve"></TextSample>
<TextSample sampleTime="00:00:01.000" xml:space="preserve">TTXT UTF-8 Subtitle Test.
For use with the High-Definition Network Media Players.</TextSample>
<TextSample sampleTime="00:00:06.000" xml:space="preserve"></TextSample>
EDIT: Thinking about it some more... I can't imagine that Apple devices fully support ISO/IEC 14496-17 '.ttxt subtitles'. Surely they use some weird half-ass proprietary Apple format!?
Cheers
hello_hello
21st July 2014, 20:45
Someone was having subtitle problems here. I don't know if it's related. http://forum.doom9.org/showthread.php?p=1686268#post1686268
SeeMoreDigital
21st July 2014, 21:27
Someone was having subtitle problems here. I don't know if it's related. http://forum.doom9.org/showthread.php?p=1686268#post1686268
Nope... That poster is working with (multiple) 'graphics based' idx/sub subtitles
foxyshadis
23rd July 2014, 02:33
There are a variety of mutually-incompatible versions of formatted TTXT (TTML is supported here and there), I don't know if iOS supports any of them. HTML-formatted SRT files are a proprietary extension from VobSub/VSFilter, nothing else reads them but AegiSub, although there's a WebVTT that's similar but stuck in draft hell. Running yours through AegiSub will handily convert to ASS, then you can upload to Subtitle Converter (http://subtitleconverter.net/) and mux to see if iOS supports the creaky standard TTML. GPAC will mux that if you rename it to .ttxt.
Problem is that site isn't very stable, and the only other converter I can find is payware called EZTitles. Not much ttxt authoring support in the open source world.
Kurtnoise
23rd July 2014, 07:54
Subtitle Edit (http://forum.doom9.org/showthread.php?t=162721) supports ttxt format as well...
Anyway, you don't need to worry about the font color during the mux for Apple devices as target because using iOS 7.1 and higher, you can override the colors for subtitles by using your own style.
It's available through Settings -> General -> Accessibility -> Subtitles & Captioning :
http://i62.tinypic.com/34sklqc.png
SeeMoreDigital
23rd July 2014, 09:38
GPAC will mux that if you rename it to .ttxt.
Hmmm...
I'm of the opinion that bennynihon might be wasting his time trying to create .ttxt subtitles. As I'm not sure Apple TV or iTunes supports them. I know for sure that QuickTime player doesn't support ttxt subtitles placed within the .mp4 container...
Kurtnoise
23rd July 2014, 10:18
As I'm not sure Apple TV or iTunes supports them.
I'm sure that iTunes does...
http://i62.tinypic.com/2882jy0.png
SeeMoreDigital
23rd July 2014, 14:39
That's encouraging...
I see there's a coloured font. Are you able to provide a short sample so I can add it to my collection?
Cheers
bennynihon
31st July 2014, 17:08
yeah, I've come to the conclusion that mp4box doesn' support <font> tags, as it may not even be a supported tag in the SRT format. So I've just made sure to find subtitles that don't include those tags. And yes, I've been successful getting subtitles to work just fine in iTunes, Apple TV, etc. Thanks
Kurtnoise
1st August 2014, 13:40
yeah, I've come to the conclusion that mp4box doesn' support <font> tags, as it may not even be a supported tag in the SRT format.
This has been added in revision 5333...
@SMD: oops...I missed your post. I'll upload a sample asap.
SeeMoreDigital
4th August 2014, 15:34
@SMD: oops...I missed your post. I'll upload a sample asap.
Thanks, that will be great :D
Kurtnoise
6th August 2014, 14:14
http://www.mediafire.com/download/16wq65wlov5cj9c/Sample_ttxt.m4v
SeeMoreDigital
6th August 2014, 14:24
Many thanks ;)
SeeMoreDigital
6th August 2014, 17:48
Hi Kurtnoise,
I've tried using Yamb to de-mux the ttxt stream from the sample you provided. But the ttxt stream was not visible!
Do you have a version of MP4box that works?
Kurtnoise
7th August 2014, 11:09
That's strange...Using any builds from here (http://gpac.wp.mines-telecom.fr/downloads/gpac-nightly-builds/) should work.
Anyway, here is the ttxt :
<?xml version="1.0" encoding="UTF-8" ?>
<!-- GPAC 3GPP Text Stream -->
<TextStream version="1.1">
<TextStreamHeader width="400" height="60" layer="0" translation_x="0" translation_y="0">
<TextSampleDescription horizontalJustification="center" verticalJustification="bottom" backColor="0 0 0 0" verticalText="no" fillTextRegion="no" continuousKaraoke="no" scroll="None">
<FontTable>
<FontTableEntry fontName="Serif" fontID="1"/>
</FontTable>
<TextBox top="0" left="0" bottom="60" right="400"/>
<Style styles="Normal" fontID="1" fontSize="20" color="ff ff 00 ff"/>
</TextSampleDescription>
</TextStreamHeader>
<TextSample sampleTime="00:00:00.000" xml:space="preserve"></TextSample>
<TextSample sampleTime="00:00:05.570" xml:space="preserve">Aren't you eating breakfast, Nao?</TextSample>
<TextSample sampleTime="00:00:07.820" xml:space="preserve">I've already eaten.</TextSample>
<TextSample sampleTime="00:00:09.450" xml:space="preserve">What about you, Yuki? Today's your shift as drill instructor, isn't it?</TextSample>
<TextSample sampleTime="00:00:13.580" text="" />
</TextStream>
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.