Log in

View Full Version : TTXT (in MP4) Subtitle Sample Request


SeeMoreDigital
7th December 2006, 13:19
After re-reading part 7 of Bonds MP4 FAQ: -
Extract from Bonds MP4 FAQ

How can i mux Subtitles into MP4 files?
In contrary to MPEG-1/2 the MPEG-4 Standard defines its own Text Stream/Subtitle Format under ISO 14496-17 (MPEG-4 Timed Text).
Its text-based (not picture-based as DVD subs), uses UTF-8/16 (including Cyrilic, Arabic, Chinese characters...), allows all sorts of animations (scrolling, colors, karaoke aso...), allows attaching of fonts and is streamable.

MPEG-4 TTXT creation is already supported in MP4Box and Quicktime. Playback works with Gabest's and Haali's MP4 dshow parser, Osmo4, Realplayer and Quicktime (only when placed in .3gp) and VideoLAN.....it started to make me wonder how much enthusiasm there is for the TTXT subtitle format.

I have a generated a few TTXT samples, primarily using English and various European characters. But I'm interested to know whether anybody has experimented using Arabic and Chinese characters and can provide some examples.

Can anybody oblige please?

susanap
12th December 2006, 10:10
After re-reading part 7 of Bonds MP4 FAQ: -
....it started to make me wonder how much enthusiasm there is for the TTXT subtitle format.

I have a generated a few TTXT samples, primarily using English and various European characters. But I'm interested to know whether anybody has experimented using Arabic and Chinese characters and can provide some examples.

Can anybody oblige please?

Hello,
I'm new with ttxt, but I appreciate your help. I've seen any TTXT samples. All have <TextStreamHeader> <TextSampleDescription>
<TextBox>
<TextSample sampleTime="00:00:00.000" ...>

Now TextSample has startTime but I don't know how set duration, for example I'd like write a subtitle from 00:00:00 to 00:00:05, and after I hide the Textbox from for example the moment 00:01:00 which I will write other subtitle.
Do you know how can I do it?

Thanks you

bond
12th December 2006, 19:47
SMD, try inserting the attached samples (japanese) to .mp4 with mp4box

btw subrip supports ttxt output for some time now already

susanap , no crossposting

SeeMoreDigital
12th December 2006, 20:13
Hi Bond,

Thanks for the Japanese subtitles. I used YAMB 1.6.0 to mux them into MP4, however I don't seem to be able to get MediaPlayer Classic or VLC to display them correctly... All I see are rows of square boxes :confused:

Drachir
12th December 2006, 20:16
@SMD convert "japanese_utf-8.srt" to ttxt. open the ttxt file and change the fontName= to a font that support Japanese character like "Sazanami Mincho". For playback Osmo4 have to find this font in the FontDirectory. You can find the font here: http://sourceforge.jp/projects/efont/

bond
12th December 2006, 20:20
you need to have japanese fonts installed on your system to see japanese fonts of course

edit: quicktime doesnt need windows fonts it seems, so try to mux with mp4box to .3gp and try to play it in qt

SeeMoreDigital
12th December 2006, 21:17
you need to have japanese fonts installed on your system to see japanese fonts of course I didn't think of that.... Where does one get Japanese fonts from?

EDIT: I've worked it out.... Great, it works :thanks:

SeeMoreDigital
13th December 2006, 00:03
If anybody else is interested, I altered the time-lines of the UTF-8 subtitle sample Bond sent me... And here it is: -

<?xml version="1.0" encoding="UTF-8" ?>
<!-- GPAC 3GPP Text Stream -->

<TextStream version="1.0">
<TextStreamHeader width="0" height="0" 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="Georgia" fontID="1"/>
</FontTable>

<TextBox top="0" left="0" bottom="0" right="0"/>
<Style styles="Normal" fontID="1" fontSize="36" color="ff ff ff ff"/>
</TextSampleDescription>
</TextStreamHeader>

<TextSample sampleTime="00:00:00.000" text="'おまえは 人“として ²てられた''だが 人“の一員では ない'">
</TextSample>
<TextSample sampleTime="00:00:09.000" text="">
</TextSample>
<TextSample sampleTime="00:00:10.000" text="'カル・エル  彼らは 偉大な民たりうる''彼らもそれを 望んでいる'">
</TextSample>
<TextSample sampleTime="00:00:19.000" text="">
</TextSample>
<TextSample sampleTime="00:00:20.000" text="'ただ Sを 照らす 光を 欠いているだけだ'">
</TextSample>
<TextSample sampleTime="00:00:29.000" text="">
</TextSample>
<TextSample sampleTime="00:00:30.000" text="'一人息子よ  人“たちの善へのΗκ それこそが…'">
</TextSample>
<TextSample sampleTime="00:00:39.000" text="">
</TextSample>
<TextSample sampleTime="00:00:40.000" text="'おまえを 彼らのもとへる 一番の理由だ'">
</TextSample>
<TextSample sampleTime="00:00:49.000" text="">
</TextSample>
</TextStream>


By-the-way.... What "term" needs to be used to switch the scrolling option on?


Cheers

bond
13th December 2006, 19:47
http://gpac.sourceforge.net/doc_ttxt.php

SeeMoreDigital
13th December 2006, 19:59
Many thanks again... I shall do some experiments :D

Drachir
15th December 2006, 13:09
Hi, does anyone know a good free Sans/Serif TruType font with a wide UTF-8 character support? For now I use http://dejavu.sourceforge.net/ which isn't bad, but doesn't support Japanese, Chinese or Korean.

You can set the default Sans/Serif font in the GPAC config this way:


[FontEngine]
...
FontSans=DejaVu Sans
DejaVu Sans=DejaVuSans.ttf
DejaVu Sans Bold=DejaVuSans-Bold.ttf
DejaVu Sans Bold Italic=DejaVuSans-BoldOblique.ttf
DejaVu Sans Italic=DejaVuSans-Oblique.ttf
FontSerif=DejaVu Serif
DejaVu Serif=DejaVuSerif.ttf
DejaVu Serif Bold=DejaVuSerif-Bold.ttf
DejaVu Serif Bold Italic=DejaVuSerif-BoldOblique.ttf
DejaVu Serif Italic=DejaVuSerif-Oblique.ttf
...