ASS subtitles in the browser, live

Why styled subtitles often change on the web

Open a fansub episode in a web player and the subtitles often turn into plain white text. The title that was meant to sweep across the screen sits in a line at the bottom, the positions are off, and the font is not the one the group picked. The other way out is for the server to burn the subtitles into the picture, but that means transcoding the whole video: the image gets worse and playback starts slower. Kryspal never does that, so the question is how a styled subtitle gets onto the screen at all.

What ASS can do that browsers cannot

Browsers cannot do much on their own. The subtitle format they know, WebVTT, can place a line and give it basic styling such as color and italics, but it carries no fonts and cannot rotate, animate or draw anything. ASS does all of that, and fansub groups lean on it. A line can have its own font, outline and shadow, an exact position and a rotation. It can fade, move, change color syllable by syllable as the lyrics are sung, or be a vector shape, often stacked in several layers with fonts shipped inside the video. Turned into plain text or WebVTT, most of the positions and effects, and the fonts, are gone.

WebVTT can place a line and style it with color and italics; ASS also carries fonts, rotation, animation and shapes
What WebVTT can carry, and what ASS adds.

Drawn in your browser, as the authors made it

So Kryspal leaves the subtitle as it is. The server hands over the subtitle and the video's fonts, and the web player draws it in your browser by ASS's own rules, using libass compiled to WebAssembly. Nothing is burned into the picture, and the video is never transcoded. Everyday Chinese, Japanese and Korean text shows as characters, not empty boxes, even when the file lacks a font for it. On a large file on a cloud drive the first lines are there within seconds, drag the progress bar and they follow, and with danmaku on the two stay apart: the subtitles on top, the danmaku keeping clear of their band.

The server sends the subtitle data and the fonts in the video; the browser draws the subtitle with libass
The server sends data; the browser draws.

All posts