Subtitle

Overview of ew-vodingest subtitle handling

Supported Input Subtitle Formats

  • SRT
  • STL
  • TTML1
  • WebVTT
  • Fragmented MP4 (WebVTT)

Output Subtitle Format

ew-vodingest stores subtitles as WebVTT in fragmented MP4 format for VoD. It converts other formats to WebVTT. However, not all features can be preserved, especially styling.


Styling Conversion

For each input format, ew-vodingest has it different ways to preserved styling. Please follow below sessions for more details.

WebVTT

  • All styling is preserved.

SRT

  • Supported: Italic <i>, Bold <b>, Underline <u>
  • Not Supported: Text position, color

STL

  • Justification: Converted as follows:

    Hex ValueMeaningWebVTT Result
    0x00Defaultdefault
    0x01Leftleft
    0x02Centerdefault
    0x03Rightright

    Example:

    WEBVTT
    
    00:00:00 --> 00:00:01 align:left
    text
    

TTML

  • Reference: TTML Styling Attributes
  • Note: Conversion may not display perfectly; client must support CSS/WebVTT styling.
TTML AttributeConversion / Support
tts:backgroundColorCSS background-color
tts:colorCSS color
tts:displayUnsupported
tts:displayAlignUnsupported
tts:extentUnsupported
tts:fontFamilyCSS font-family
tts:fontSizeCSS font-size (only one value, px/em)
tts:fontStyleCSS font-style
tts:fontWeightCSS font-weight
tts:lineHeightUnsupported
tts:opacityUnsupported
tts:originWebVTT Region viewportanchor (percent only)
tts:paddingUnsupported
tts:showBackgroundUnsupported
tts:textAlignWebVTT align
tts:textDecorationCSS text-decoration (see table)
tts:textOutlineUnsupported
tts:unicodeBidiCSS unicode-bidi
tts:visibilityUnsupported
tts:wrapOptionCSS white-space
tts:writingModeWebVTT vertical
tts:zIndexUnsupported

textDecoration Mapping:

TTML ValueCSS Value
underlineunderline
lineThroughline-through
overlineoverline
noUnderlineunsupported
noLineThroughunsupported
noOverlineunsupported

unicodeBidi Mapping:

TTML ValueCSS Value
normalnormal
embedembed
bidiOverridebidi-override

writingMode Mapping:

TTML ValueWebVTT Value
tbrlrl
tblrlr

TTML Regions & Styles

  • <region> → WebVTT Region (::cue-region), ID preserved
  • <style> → WebVTT ::cue, ID preserved
  • Inline style: If TTML style is set directly on text, a virtual ::cue class is created.

Example (inline style):

<p begin="00:00:00.000" end="00:00:05.000" tts:color="yellow">text</p>

Converted WebVTT:

WEBVTT

STYLE
::cue(.itemCue_1) { color: yellow; }

00:00:00.000 --> 00:00:05.000
<c.itemCue_1>text</c>

Examples

TTML <style> Example:

<style xml:id="s" tts:backgroundColor="#ffffff00" tts:color="#ffffff" ... />
<p begin="00:00:00.000" end="00:00:05.000" style="s">text</p>

Converted WebVTT:

WEBVTT

STYLE
::cue(.s) {
   background-color: #ffffff00;
   color: #ffffff;
   /* ... */
}
00:00:00.000 --> 00:00:05.000 align=right vertical=rl
<c.s>text</c>

TTML <region> Example:

<region xml:id="r" style="s" tts:origin="10% 20%" tts:color="red" />
<p begin="00:00:00.000" end="00:00:05.000">text</p>

Converted WebVTT:

WEBVTT

Region: viewportanchor=10%,20%

STYLE
::cue-region(r) {
  color: red;
  background-color: #ffffff00;
}

00:00:00.000 --> 00:00:05.000 region=r
text