YouTube timed text

OpenSaveXMLYouTube

The XML YouTube's player reads: captions in milliseconds, with pens for bold, italics, underline and colour, and window positions for where they sit. Also written as .ytt, and the XML form of YouTube's json3. Subtitld opens it, and the older srv1, and saves srv3.

At a glance

Extension.srv3
Media typeNone registered
SpecificationNone published by YouTube. What its player reads, described by the tools that write it, such as YTSubConverter.
Time precisionMilliseconds
Text encodingDeclared in the XML. UTF-8.
StylingPens: bold, italics, underline, colours, fonts, sizes, edges and backgrounds
PositioningWindow positions: an anchor point, and a place across and down, in %
SpeakersNone
In containersNone. YouTube's player fetches it beside the video; yt-dlp saves it.

Anatomy of a file

A <timedtext> document: pens and positions in its head, a paragraph a caption in its body. What Subtitld writes for two subtitles, one with an italic word, one at the top in yellow:

<timedtext format="3">
<head>
<pen id="1" i="1" />
<pen id="2" fc="#FFFF00" />
<wp id="1" ap="1" ah="50" av="0" />
</head>
<body>
<p t="1000" d="2500">You're a <s p="1">jerk</s>, Thom.</p>
<p t="4000" d="2000" wp="1"><s p="2">Celia!</s>
Wait.</p>
</body></timedtext>
  1. 1 · Root

    <timedtext>, format 3.

  2. 2 · Head

    Pens, numbered, each a look; window positions, each a place on the screen.

  3. 3 · Timing

    Each paragraph's start, t, and how long it lasts, d, in milliseconds. wp names its position.

  4. 4 · Text

    The caption. <s> runs take a pen; a new line in the text breaks the line.

Times

Not a timecode: whole milliseconds, a start and a duration.

Written What it is
t="4000" Starts 4 seconds in
d="2000" Lasts 2 seconds: until 6
no d Read as 5 seconds long

Pens and positions

In the head Attribute What it gives
<pen> b, i, u Bold, italics, underline
<pen> fc The text's colour, #RRGGBB
<pen> fs, sz, et, bc … Font, size, edge, background, and how opaque they are
<wp> ap The anchor point: 0 top left, 4 the centre, 8 bottom right
<wp> ah, av Where the anchor sits, across and down, in %
<ws> mh … A window's style: how its text is laid out, how it scrolls

srv3, srv1 or json3?

srv3 srv1 json3
Written as XML, <timedtext format="3"> XML, <transcript> JSON
Times Milliseconds Seconds Milliseconds
Styling and places Pens and positions None Pens and positions
In Subtitld Opens and saves Opens Opens

json3 holds what srv3 does, as JSON. Subtitld reads both the same way.

YouTube timed text in Subtitld

Kept in the .srv3
  • Every subtitle's text and line breaks
  • Italic, bold, underline and colour, on any part of the text
  • Where it sits: top, middle or bottom; left, centre or right
  • Start and end, to the millisecond
Nowhere to go
  • Strikeout, and readings above the text
  • Speakers' names as such, translations beside the original
  • Dubs, speakers' faces and colours

Save a .usfx project to keep them.

Opening a YouTube timed text file

Subtitld opens .srv3, .ytt and .srv1, and an .xml whose root is <timedtext> or <transcript>. It reads:

  • pens as bold, italics, underline and colour; white, the player's own, as no colour;
  • window positions as the nine places a subtitle can sit in;
  • automatic captions, which roll a line at a time, as a subtitle a line, each until the next begins;
  • srv1's <text start dur>, in seconds, and its text, escaped once more than XML needs.

Fonts, sizes, edges, backgrounds and opacity are not read. An .xml that is neither says so.

Exporting YouTube timed text

Subtitld's export dialog with XML chosen, speaker names before the text and formatting kept

Export, then Subtitles and XML, offers:

  • TextThe original, a translation, or both, the translation below.
  • Speaker namesLeft out, or before the text (Thom: …).
  • FormattingKept, or removed. Removed, the place goes too.
  • Shift timesEvery subtitle earlier or later by the same amount.

Subtitld writes srv3 as .srv3, in UTF-8: a pen for each look the text uses, a position for each place but the bottom centre, which is the player's own, and a paragraph for each subtitle, in order of start. Empty subtitles are left out.

Trivia

Not listed

YouTube's help lists the caption files it takes, SubRip, SBV, LRC, WebVTT, TTML, SCC and more. Its own timed text is not among them.

.ytt

YTSubConverter turns ASS subtitles into srv3, under the name .ytt, to bring styles, positions and karaoke to YouTube's own captions.

Ruby

srv3 can also carry readings above the text and vertical text. YTSubConverter writes them from ASS tags of its own, {\ytruby} and {\ytvert}.

Related formats

Have a .srv3 to fix?

Open it in Subtitld with the video and retime it on the waveform.

Download Subtitld