• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

WebVTT configuration

The WebVTT subtitles look and feel is configured by /etc/webvtt_config.xml. The size and margin of render buffer is defined. And also fonts customization is associated with specific languages to get better display effect.

WebVTT configuration schema


<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="WebVttConfig">
  <xsd:element name="WebVttConfig">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="RenderBufferConfig" maxOccurs="1" minOccurs="1">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="ScreenWidth" type="xsd:integer" maxOccurs="1" minOccurs="1"></xsd:element>
              <xsd:element name="ScreenHeight" type="xsd:integer" maxOccurs="1" minOccurs="1"></xsd:element>
              <xsd:element name="XMargin" maxOccurs="1" minOccurs="1">
                <xsd:complexType>
                <xsd:choice>
                  <xsd:element name="Pixels" type="xsd:integer" maxOccurs="1" minOccurs="1"></xsd:element>
                  <xsd:element name="Proportion" maxOccurs="1" minOccurs="1">
                    <xsd:simpleType>
                      <xsd:restriction base="xsd:double">
                        <xsd:minInclusive value="0"/>
                        <xsd:maxInclusive value="1"/>
                      </xsd:restriction>
                    </xsd:simpleType>
                  </xsd:element>
                </xsd:choice>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="YMargin" maxOccurs="1" minOccurs="1">
                <xsd:complexType>
                <xsd:choice>
                  <xsd:element name="Pixels" type="xsd:integer" maxOccurs="1" minOccurs="1"></xsd:element>
                  <xsd:element name="Proportion" maxOccurs="1" minOccurs="1">
                    <xsd:simpleType>
                      <xsd:restriction base="xsd:double">
                        <xsd:minInclusive value="0"/>
                        <xsd:maxInclusive value="1"/>
                      </xsd:restriction>
                    </xsd:simpleType>
                  </xsd:element>
                </xsd:choice>
                </xsd:complexType>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="FontConfig" maxOccurs="unbounded" minOccurs="1">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="Language" type="xsd:string" maxOccurs="unbounded" minOccurs="1"></xsd:element>
              <xsd:element name="RegularFontFile" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
              <xsd:element name="BoldFontFile" type="xsd:string" maxOccurs="1" minOccurs="0"></xsd:element>
              <xsd:element name="ItalicFontFile" type="xsd:string" maxOccurs="1" minOccurs="0"></xsd:element>
              <xsd:element name="BoldItalicFontFile" type="xsd:string" maxOccurs="1" minOccurs="0"></xsd:element>
              <xsd:element name="FontSize" maxOccurs="1" minOccurs="1">
                <xsd:complexType>
                <xsd:choice>
                  <xsd:element name="Pixels" type="xsd:integer" maxOccurs="1" minOccurs="1"></xsd:element>
                  <xsd:element name="Proportion" maxOccurs="1" minOccurs="1">
                    <xsd:simpleType>
                      <xsd:restriction base="xsd:double">
                        <xsd:minInclusive value="0"/>
                        <xsd:maxInclusive value="1"/>
                      </xsd:restriction>
                    </xsd:simpleType>
                  </xsd:element>
                </xsd:choice>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="HorizontalSpacing" maxOccurs="1" minOccurs="1">
                <xsd:complexType>
                <xsd:choice>
                  <xsd:element name="Pixels" type="xsd:integer" maxOccurs="1" minOccurs="1"></xsd:element>
                  <xsd:element name="Proportion" maxOccurs="1" minOccurs="1">
                    <xsd:simpleType>
                      <xsd:restriction base="xsd:double">
                        <xsd:minInclusive value="0"/>
                        <xsd:maxInclusive value="1"/>
                      </xsd:restriction>
                    </xsd:simpleType>
                  </xsd:element>
                </xsd:choice>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="LetterSpacing" maxOccurs="1" minOccurs="1">
                <xsd:complexType>
                <xsd:choice>
                  <xsd:element name="Pixels" type="xsd:integer" maxOccurs="1" minOccurs="1"></xsd:element>
                  <xsd:element name="Proportion" maxOccurs="1" minOccurs="1">
                    <xsd:simpleType>
                      <xsd:restriction base="xsd:double">
                        <xsd:minInclusive value="0"/>
                        <xsd:maxInclusive value="1"/>
                      </xsd:restriction>
                    </xsd:simpleType>
                  </xsd:element>
                </xsd:choice>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="VerticalSpacing" maxOccurs="1" minOccurs="1">
                <xsd:complexType>
                <xsd:choice>
                  <xsd:element name="Pixels" type="xsd:integer" maxOccurs="1" minOccurs="1"></xsd:element>
                  <xsd:element name="Proportion" maxOccurs="1" minOccurs="1">
                    <xsd:simpleType>
                      <xsd:restriction base="xsd:double">
                        <xsd:minInclusive value="0"/>
                        <xsd:maxInclusive value="1"/>
                      </xsd:restriction>
                    </xsd:simpleType>
                  </xsd:element>
                </xsd:choice>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="FontColor" maxOccurs="1" minOccurs="1">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:pattern value="0[x|X][0-9A-Fa-f]{8}"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element name="BackgroundColor" maxOccurs="1" minOccurs="1">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:pattern value="0[x|X][0-9A-Fa-f]{8}"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element name="Shadowed" type="xsd:boolean" maxOccurs="1" minOccurs="1"></xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

WebVTT configuration XML description

Element Name Comment Value
RenderBufferConfig Defines the global configuration of WebVTT subtitles render buffer. -
ScreenWidth Defines the width of render buffer screen in pixels. Should > 0.
e.g. 1920.
ScreenHeight Defines the height of render buffer screen in pixels. Should > 0.
e.g. 1080.
XMargin Defines the margin to the left / right border of the screen in pixels or in proportion of ScreenWidth. Should >= 0 in pixels.
e.g. <Pixels>20</Pixels>, <Proportion>0.01</Proportion>.
YMargin Defines the margin to the top / bottom border of the screen in pixels or in proportion of ScreenHeight. Should >= 0 in pixels.
e.g. <Pixels>80</Pixels>, <Proportion>0.08</Proportion>.
FontConfig Defines the font configuration in a mapping of languages and fonts. Can occur many times. -
Language Defines specific subtitle language for font configuration. Can occur many times. default is a must for the case unspecified languages are used. e.g. default, en, ar.
RegularFontFile Defines regular font file name in /usr/share/fonts/. e.g. DejaVuSans.ttf.
BoldFontFile Defines bold font file name in /usr/share/fonts/. e.g. DejaVuSans-Bold.ttf.
ItalicFontFile Defines italic font file name in /usr/share/fonts/. e.g. DejaVuSans-Oblique.ttf.
BoldItalicFontFile Defines bold italic font file name in /usr/share/fonts/. e.g. DejaVuSans-BoldOblique.ttf.
FontSize Defines the font size in pixels or in proportion of ScreenHeight. Should > 0 in pixels.
e.g. <Pixels>48</Pixels>, <Proportion>0.045</Proportion>.
HorizontalSpacing Defines the horizontal spacing of subtitle lines in pixels or in proportion of ScreenWidth. Should >= 0 in pixels.
e.g. <Pixels>2</Pixels>.
LetterSpacing Defines the horizontal spacing between the subtitle letters in pixels or in proportion of ScreenWidth. Should >= 0 in pixels.
e.g. <Pixels>1</Pixels>.
VerticalSpacing Defines the vertical spacing of subtitle lines in pixels or in proportion of ScreenHeight. Should >= 0 in pixels.
e.g. <Pixels>4</Pixels>.
FontColor Defines the subtitles font color in ARGB format. e.g. 0xFFFFFFFF (white).
BackgroundColor Defines the subtitles background color in ARGB format. e.g. 0x80000000 (semi-transparent).
Shadowed Defines whether subtitles font has outline. If true or 1, font will be rendered with shadow. e.g. true, false.

WebVTT configuration example

The WebVTT configuration XML example below shows a configuration of English and Arabic languages.


<?xml version="1.0" encoding="UTF-8"?>
<WebVttConfig>
  <RenderBufferConfig>
    <ScreenWidth>1920</ScreenWidth>
    <ScreenHeight>1080</ScreenHeight>
    <XMargin>
      <Proportion>0.01</Proportion>
    </XMargin>
    <YMargin>
      <Proportion>0.08</Proportion>
    </YMargin>
  </RenderBufferConfig>
  <FontConfig>
    <Language>default</Language>
    <RegularFontFile>DejaVuSans.ttf</RegularFontFile>
    <BoldFontFile>DejaVuSans-Bold.ttf</BoldFontFile>
    <ItalicFontFile>DejaVuSans-Oblique.ttf</ItalicFontFile>
    <BoldItalicFontFile>DejaVuSans-BoldOblique.ttf</BoldItalicFontFile>
    <FontSize>
      <Pixels>48</Pixels>
    </FontSize>
    <HorizontalSpacing>
      <Pixels>1</Pixels>
    </HorizontalSpacing>
    <LetterSpacing>
      <Pixels>0</Pixels>
    </LetterSpacing>
    <VerticalSpacing>
      <Pixels>2</Pixels>
    </VerticalSpacing>
    <FontColor>0xFFFFFFFF</FontColor>
    <BackgroundColor>0x80000000</BackgroundColor>
    <Shadowed>false</Shadowed>
  </FontConfig>
  <FontConfig>
    <Language>en</Language>
    <Language>eng</Language>
    <RegularFontFile>Arial.TTF</RegularFontFile>
    <BoldFontFile>Arialbd.TTF</BoldFontFile>
    <FontSize>
      <Pixels>36</Pixels>
    </FontSize>
    <HorizontalSpacing>
      <Pixels>2</Pixels>
    </HorizontalSpacing>
    <LetterSpacing>
      <Pixels>0</Pixels>
    </LetterSpacing>
    <VerticalSpacing>
      <Pixels>4</Pixels>
    </VerticalSpacing>
    <FontColor>0xFFFF0000</FontColor>
    <BackgroundColor>0xFF000000</BackgroundColor>
    <Shadowed>false</Shadowed>
  </FontConfig>
  <FontConfig>
    <Language>ar</Language>
    <Language>ara</Language>
    <RegularFontFile>HelveticaNeueLTArabic-Roman.ttf</RegularFontFile>
    <BoldFontFile>HelveticaNeueLTArabic-Bold.ttf</BoldFontFile>
    <FontSize>
      <Pixels>36</Pixels>
    </FontSize>
    <HorizontalSpacing>
      <Pixels>1</Pixels>
    </HorizontalSpacing>
    <LetterSpacing>
      <Pixels>1</Pixels>
    </LetterSpacing>
    <VerticalSpacing>
      <Pixels>4</Pixels>
    </VerticalSpacing>
    <FontColor>0x8000FF00</FontColor>
    <BackgroundColor>0x00000000</BackgroundColor>
    <Shadowed>true</Shadowed>
  </FontConfig>
</WebVttConfig>

5.1.p5

Copyright (c) 2017 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.