Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

TTML style formatting

Focus mode
TTML style formatting - MediaConvert

AWS Elemental MediaConvert reads the style formatting of your input captions when your job runs. If you notice issues with the style formatting of your output, we recommend checking the formatting of your input captions or setting Style passthrough to Enabled. The following topics provide guidance for using fonts, heritable and non-heritable attributes, and right to left languages in your TTML input captions.

Specifying fonts

MediaConvert supports the following generic font families listed in the TTML2 W3C recommendation:

  • default

  • monospace

  • sansSerif

  • serif

  • monospaceSansSerif

  • monospaceSerif

  • proportionalSansSerif

  • proportionalSerif

For the best results, specify a generic font family within your TTML input captions. If you specify an individual font instead, MediaConvert will map the font to one of the generic font families listed above.

Heritable and non-heritable attributes

Style attributes are either heritable or non-heritable. The TTML 2 W3C recommendation lists these under inherited for each style attribute.

Include non-heritable style attributes in every element that you want them to apply to.

For example, tts:backgroundColor is a non-heritable style attribute. The following results in hello with a red background color and world with no background color:

<span tts:backgroundColor="red">hello<br/>world</span>

You can fix the above formatting so that hello world both have a red background color by using individual spans, each with their own style attributes, like in this example:

<span><span tts:backgroundColor="red">hello</span> <br/> <span tts:backgroundColor="red">world</span></span>

Right to left languages

MediaConvert supports both left to right and right to left text directions within TTML.

When you don’t specify text direction, MediaConvert uses left to right.

To specify right to left, include a tts:direction="rtl" attribute. If your text has a mix of bidirectional characters, also include a tts:unicodeBidi="embed" attribute as described in the TTML2 W3C recommendation. Note that tts:unicodeBidi is a non-heritable attribute.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.