TTML is large, and most players support only part of it. A profile names the part a
document uses, or the part a player must support. Each feature of the language has a
designator, a URI such as http://www.w3.org/ns/ttml/feature/#textOutline,
and a profile is a list of features, each required, optional or prohibited.
Designators
| Kind | Base URI |
|---|---|
| Profile | http://www.w3.org/ns/ttml/profile/ |
| Feature | http://www.w3.org/ns/ttml/feature/ |
| Extension | http://www.w3.org/ns/ttml/extension/ |
| Resource (TTML2) | http://www.w3.org/ns/ttml/resource/ |
| Profile | Designator, after the profile base | Defined by |
|---|---|---|
| DFXP Transformation | dfxp-transformation | TTML1: what a program that converts TTML must understand |
| DFXP Presentation | dfxp-presentation | TTML1: what a player must support |
| DFXP Full | dfxp-full | TTML1: every feature |
| SDP US | sdp-us | TTML1: Simple Delivery Profile for US closed captions |
| TTML2 Transformation | ttml2-transformation | TTML2 |
| TTML2 Presentation | ttml2-presentation | TTML2 |
| TTML2 Full | ttml2-full | TTML2 |
| IMSC 1.2 Text | imsc1.2/text | W3C IMSC 1.2 |
| IMSC Image | imsc1/image | W3C IMSC |
Profile elements
| Element | Attributes | Content | Meaning |
|---|---|---|---|
ttp:profile | use (a designator), xml:id; in TTML2 also type (processor, the default, or content), designator, combine (replace, the default, leastRestrictive, mostRestrictive), xml:base | metadata*, then ttp:features* and ttp:extensions*, or (TTML2) ttp:profile* | A profile, in head or as the root of a separate profile document. use starts from a known profile, which the children then change. |
ttp:features | xml:base (default the feature base URI), xml:id | metadata*, ttp:feature* | A group of features. |
ttp:feature | value, xml:id; in TTML2 also extends or restricts | a designator, relative to the base | One feature and whether it is needed. |
ttp:extensions | xml:base (default the extension base URI), xml:id | metadata*, ttp:extension* | A group of extensions. |
ttp:extension | as ttp:feature | a designator | One extension: a feature defined outside TTML. |
value | Meaning |
|---|---|
required | Must be supported. The default in a processor profile. |
optional | May be supported. The default in a content profile. |
prohibited | TTML2: must not be used. |
use | TTML1’s word for required; deprecated in TTML2 and read as required. |
Profile attributes
Written on tt. TTML1 has only ttp:profile; the rest are
TTML2.
| Attribute | Values | Default | Meaning |
|---|---|---|---|
ttp:profile | one designator | none | The profile a processor needs. TTML2 prefers the next two. |
ttp:contentProfiles | designators, or all(…) | none | The profiles the document conforms to. |
ttp:processorProfiles | designators, or all(…) or any(…) | none | The profiles a processor must support: all of them, or any one. |
ttp:contentProfileCombination | leastRestrictive, mostRestrictive, replace, ignore | ignore | How several content profiles combine: where they disagree about a feature, the least or most restrictive value wins, or a later one replaces an earlier one. |
ttp:processorProfileCombination | as above | ignore | How several processor profiles combine. |
ttp:inferProcessorProfileMethod | loose, strict | loose | How strictly a processor profile is worked out from the content profile when none is given. |
ttp:inferProcessorProfileSource | combined, first | first | Whether to infer it from all content profiles or the first. |
ttp:permitFeatureNarrowing | true, false | false | Whether a feature or extension may be satisfied by a more narrowly defined one, related to it through extends or restricts. |
ttp:permitFeatureWidening | true, false | false | Whether a feature or extension may be satisfied by a more widely defined one, where its definition has a restricts attribute. |
ttp:validation | required, optional, prohibited | optional | Whether the document must be validated before use. |
ttp:validationAction | abort, warn, ignore | follows ttp:validation: abort, warn, ignore | What to do when validation fails. |
TTML1 features
Each is written after # on the feature base URI. TTML2 keeps these and
adds a feature for each new element, attribute and value.
| Area | Features |
|---|---|
| Groups | #core, #content, #structure, #styling, #layout, #timing, #animation, #metadata, #profile, #presentation, #transformation |
| Structure | #nested-div, #nested-span, #lineBreak-uax14, #bidi |
| Styling methods | #styling-chained, #styling-inheritance-content, #styling-inheritance-region, #styling-inline, #styling-nested, #styling-referential |
| Styles | #backgroundColor (-block, -inline, -region), #color, #direction, #display (-block, -inline, -region), #displayAlign, #extent (-region, -root), #fontFamily (-generic, -non-generic), #fontSize (-anamorphic, -isomorphic), #fontStyle (-italic, -oblique), #fontWeight (-bold), #lineHeight, #opacity, #origin, #overflow (-visible), #padding (-1 to -4), #showBackground, #textAlign (-absolute, -relative), #textDecoration (-over, -through, -under), #textOutline (-blurred, -unblurred), #unicodeBidi, #visibility (-block, -inline, -region), #wrapOption, #writingMode (-horizontal, -horizontal-lr, -horizontal-rl, -vertical), #zIndex |
| Lengths | #length, #length-cell, #length-em, #length-integer, #length-negative, #length-percentage, #length-pixel, #length-positive, #length-real |
| Parameters | #cellResolution, #clockMode (-gps, -local, -utc), #dropMode (-dropNTSC, -dropPAL, -nonDrop), #frameRate, #frameRateMultiplier, #markerMode (-continuous, -discontinuous), #pixelAspectRatio, #subFrameRate, #tickRate, #timeBase-clock, #timeBase-media, #timeBase-smpte |
| Timing | #timeContainer, #time-clock, #time-clock-with-frames, #time-offset, #time-offset-with-frames, #time-offset-with-ticks |
IMSC
IMSC (Internet Media Subtitles and Captions) is the W3C’s TTML profile for online video, used in DASH, HLS and CMAF streams. Its Text profile carries styled text and its Image profile carries pictures of subtitles. It limits a document to at most four regions shown at once, which must not overlap or leave the root container, and adds a few attributes of its own:
| Attribute | On | Values | Meaning |
|---|---|---|---|
itts:forcedDisplay | body, div, p, region, span | true, false (default) | Shown even when the player shows forced subtitles only. Inherited. |
itts:fillLineGap | p | true, false (default) | Fill the background between lines. Inherited. |
ittp:activeArea | tt | four percentages: left, top, width, height | The part of the root container the subtitles use. |
ittp:aspectRatio | tt | numerator denominator | Deprecated; replaced by ttp:displayAspectRatio. |
ittp:progressivelyDecodable | tt | true, false (default) | Deprecated: the document can be shown before it has all arrived. |
ittm:altText | in metadata | text | Deprecated; replaced by the altText metadata item. |
The namespaces are http://www.w3.org/ns/ttml/profile/imsc1#styling
(itts:), …#parameter (ittp:) and
…#metadata (ittm:).
Worked example
<tt xmlns="http://www.w3.org/ns/ttml" xmlns:ttp="http://www.w3.org/ns/ttml#parameter"
xml:lang="en"
ttp:contentProfiles="http://www.w3.org/ns/ttml/profile/imsc1.2/text">
<head>
<ttp:profile use="ttml2-presentation">
<ttp:features>
<ttp:feature value="required">#textShadow</ttp:feature>
<ttp:feature value="optional">#animation</ttp:feature>
</ttp:features>
</ttp:profile>
</head>
…
Not confirmed
TTML2’s own feature and extension lists, which name a feature for every TTML2
addition, are not reproduced here. Drafts of TTML2 had a ttp:version
parameter, but it is not among the parameters of the published Recommendation as
read for this page. The exact working of loose and strict
inference, and of the ignore combination method, is defined in tables
of the specification not covered here.