Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th July 2014, 06:45   #1  |  Link
bennynihon
Registered User
 
Join Date: Oct 2001
Posts: 106
mp4box not processing <font> tags in .SRT subtitle mux

I'm trying to properly import a .SRT file, using MP4Box, that contains <xml> or <html> type tags

Code:
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.

Code:
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
Code:
mp4box.exe -ttxt subtitles.srt
that seems to incorrectly process the <font> tags too.

Code:
<TextSample sampleTime="00:00:00.010" xml:space="preserve">&lt;font color=&quot;#ffff80&quot;&gt;This is a test;&lt;/font&gt;<Style fromChar="24" toChar="71" styles="Bold Italic " fontID="1" fontSize="18" color="ff ff ff ff"/>
</TextSample>
Any help is appreciated.
bennynihon is offline   Reply With Quote
Old 20th July 2014, 13:24   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,504
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
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 21st July 2014, 10:41   #3  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
It doesnt make any sense to have a font color without knowing the font name or the font family related...
Kurtnoise is offline   Reply With Quote
Old 21st July 2014, 20:16   #4  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,279
Agreed...

A typical 'TTXT' header contains the following type of information: -

Code:
<?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
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 21st July 2014 at 20:41.
SeeMoreDigital is offline   Reply With Quote
Old 21st July 2014, 20:45   #5  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,938
Someone was having subtitle problems here. I don't know if it's related. http://forum.doom9.org/showthread.ph...68#post1686268
hello_hello is offline   Reply With Quote
Old 21st July 2014, 21:27   #6  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,279
Quote:
Originally Posted by hello_hello View Post
Someone was having subtitle problems here. I don't know if it's related. http://forum.doom9.org/showthread.ph...68#post1686268
Nope... That poster is working with (multiple) 'graphics based' idx/sub subtitles
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 23rd July 2014, 02:33   #7  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,562
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 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.
foxyshadis is offline   Reply With Quote
Old 23rd July 2014, 07:54   #8  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
Subtitle Edit 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 :


Last edited by Kurtnoise; 23rd July 2014 at 10:21.
Kurtnoise is offline   Reply With Quote
Old 23rd July 2014, 09:38   #9  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,279
Quote:
Originally Posted by foxyshadis View Post
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...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 23rd July 2014, 10:18   #10  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
Quote:
Originally Posted by SeeMoreDigital View Post
As I'm not sure Apple TV or iTunes supports them.
I'm sure that iTunes does...

Kurtnoise is offline   Reply With Quote
Old 23rd July 2014, 14:39   #11  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,279
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
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 31st July 2014, 17:08   #12  |  Link
bennynihon
Registered User
 
Join Date: Oct 2001
Posts: 106
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
bennynihon is offline   Reply With Quote
Old 1st August 2014, 13:40   #13  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
Quote:
Originally Posted by bennynihon View Post
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.
Kurtnoise is offline   Reply With Quote
Old 4th August 2014, 15:34   #14  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,279
Quote:
Originally Posted by Kurtnoise View Post
@SMD: oops...I missed your post. I'll upload a sample asap.
Thanks, that will be great
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 6th August 2014, 14:14   #15  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
http://www.mediafire.com/download/16...ample_ttxt.m4v
Kurtnoise is offline   Reply With Quote
Old 6th August 2014, 14:24   #16  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,279
Many thanks
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 6th August 2014, 17:48   #17  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,279
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?
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 6th August 2014 at 18:36.
SeeMoreDigital is offline   Reply With Quote
Old 7th August 2014, 11:09   #18  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
That's strange...Using any builds from here should work.

Anyway, here is the ttxt :
Code:
<?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>
Kurtnoise is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:23.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.