TTML — IMSC Nested Spans and Regions
TTML using the features broadcast caption profiles rely on: two layout regions, named styles including a text outline, a declared frame rate and media time base, and spans nested two deep so styles cascade. Converting this to SubRip necessarily flattens all of it. Tests whether a TTML implementation resolves style inheritance or only reads the leaf text.
<?xml version="1.0" encoding="UTF-8"?>
<tt xmlns="http://www.w3.org/ns/ttml" xmlns:tts="http://www.w3.org/ns/ttml#styling"
xmlns:ttp="http://www.w3.org/ns/ttml#parameter" ttp:timeBase="media"
ttp:frameRate="25" xml:lang="en">
<head>
<styling>
<style xml:id="white" tts:color="white" tts:fontSize="100%"/>
<style xml:id="yellow" tts:color="yellow" tts:fontStyle="italic"/>
<style xml:id="outline" tts:textOutline="black 2px"/>
</styling>
<layout>
<region xml:id="top" tts:origin="10% 10%" tts:extent="80% 20%" tts:displayAlign="before"/>
<region xml:id="bottom" tts:origin="10% 70%" tts:extent="80% 20%" tts:displayAlign="after"/>
</layout>
</head>
<body>
<div>
<p region="bottom" style="white" begin="00:00:01.000" end="00:00:04.000">Plain, then <span style="yellow">italic yellow</span>, then plain again</p>
<p region="top" style="outline" begin="00:00:04.500" end="00:00:07.500">Top region with a text outline</p>
<p region="bottom" style="white" begin="00:00:08.000" end="00:00:11.000">Nested: <span style="yellow">outer <span style="outline">inner</span> outer</span></p>
</div>
</body>
</tt>
Specifications
- Profile
- IMSC-style TTML
- Time Base
- media
- Frame Rate
- 25
- Regions
- 2
- Styles
- 3
- Nesting Depth
- 2
What is a .ttml file?
TTML (Timed Text Markup Language, .ttml, also called DFXP) is a W3C XML format for timed text and captions. It wraps timed paragraphs in a tt document with styling and layout regions, and underlies broadcast and streaming caption profiles like IMSC, SMPTE-TT, and EBU-TT.
How to use this file
Use an example .ttml file to test XML caption parsers, TTML/IMSC players, and conversion to or from SRT, VTT, and SCC.
How to use this file for testing
“TTML — IMSC Nested Spans and Regions” is a deterministic Novus Examples fixture for Subtitle parsing, Conversion testing, Video QA. The same captions across SubRip, WebVTT, ASS/SSA, SBV, and TTML, plus a synced LRC lyric file — for testing subtitle parsers, players, burn-in tools, and format converters against known timings.
Documented properties for this file: TTML · 1,186 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Media fixtures are short and synthetic by design. Prefer waveform or transcript ground truth in the same group when measuring ASR, trim, upscale, or sync tools; do not assume broadcast-quality masters.
Parse the cues and check timings against the documented count; the same captions ship across subtitle formats so you can diff a converter against a known target.
Code examples
<video controls src="clip.mp4">
<track kind="captions" srclang="en" label="English" src="imsc-styling.ttml" default>
</video>Related files
- csvCSV — Cue Timing ReportPer-cue timings and text metrics for the shared cue list, as a caption QC tool would export them: start, end, duration, line count and character count. Useful as the expected output when testing a caption analyser, and as a quick way to check reading-rate calculations against known values.

- dfxpDFXP — TTML Under Its Other ExtensionTimed text as DFXP — byte-for-byte a TTML document, just under the extension Netflix, Adobe and older captioning tool-chains still use. Same tt root, same head/body/div/p structure, same styling and region attributes. It exists to check that a caption parser dispatches on document content rather than on the file extension: a parser that accepts .ttml but rejects an identical .dfxp is exactly the bug this catches.

- jsonJSON — Caption Cue ListThe same five cues as a plain JSON array with float second timings — the shape most caption pipelines use internally between parsing one format and writing another. Handy as the expected intermediate when testing a converter, since it removes timestamp-formatting differences from the comparison.

- jsonJSON — Timed-Text Suite IndexA machine-readable index of all 67 timed-text, streaming-manifest and ad-signalling fixtures in this wave, with id, format, path and byte size for each. Useful as a work-list when running a parser across the whole suite, and as a manifest to diff against after regenerating.

- sccSCC — Broadcast CEA-608 CaptionsBroadcast closed captions as Scenarist SCC: SMPTE timecodes followed by hexadecimal CEA-608 byte pairs, with odd parity set on every byte as the standard requires. Uses pop-on mode — RCL to load, ENM to clear non-displayed memory, a preamble address code for row 15, the character pairs, then EOC to display. This is the fixture that exposes decoders which treat captions as text: the parity bits, the two-byte control codes and the frame-accurate timecodes all have to be handled.

- webmAlpha Channel — Opaque VP9 TwinThe same codec and container with NO alpha plane, as the control for the alpha clip in this group. Useful for checking that alpha detection reads the pixel format rather than assuming every WebM is transparent — and for confirming a compositing bug is in the alpha handling rather than in the player.

Generated by generation/video_timedtext.py. Free for any use, no attribution required — license.