Subtitle output still differs from upstream's SubtitleEdit writers in five measured places #246

Closed
opened 2026-10-11 11:40:01 +02:00 by Claude · 1 comment
Collaborator

Left after #242. Text tracks (SRT, ASS, SSA; sidecar or embedded) are parsed into cues and written by writers matched to captures from a private upstream v12.2 container (crates/ephyra-http/src/routes/streaming/subtitle_cues.rs, fixtures under crates/ephyra-http/tests/upstream/subtitles/). What still differs, each measured unless said otherwise:

  • TTML from an ASS or SSA source: upstream writes the source's styles into the head and style="Default" xmlns="…" on every <p>; ours has the plain head.
  • TTML from SRT with ill-formed markup (unclosed or misordered <i>/<b>): upstream applies a SubtitleEdit fix-up; ours keeps the text. Only a lone < matches.
  • ass/ssa from a SAMI source: upstream 718 and 660 bytes, ours 699. SAMI and other formats outside SRT/ASS/SSA still go through ffmpeg.
  • ssa from an ASS source: upstream's SSA writer gives 1082 bytes, ours 767 (the raw ass).
  • Charset of a non-UTF-8 sidecar: a byte-order mark, else Windows-1252; upstream uses UtfUnknown. A latin-1 file matches; a file UtfUnknown would call something else does not.

Unmeasured:

  • An external .idx/.sub pair: the pinned ffmpeg has no vobsub muxer to make one. Upstream probably answers 500; the port answers 404.
  • ASS override codes beyond \i \b \u \c \an8 \pos, and ill-formed ASS/SSA.
  • WebVTT colour class names other than red, lime, blue, yellow and color123456.

The cue parser and writers were written after #242's review round and have not been independently reviewed; they are held by the captured fixtures and by serving.json (77 responses, 0 differences).

Left after #242. Text tracks (SRT, ASS, SSA; sidecar or embedded) are parsed into cues and written by writers matched to captures from a private upstream v12.2 container (`crates/ephyra-http/src/routes/streaming/subtitle_cues.rs`, fixtures under `crates/ephyra-http/tests/upstream/subtitles/`). What still differs, each measured unless said otherwise: - **TTML from an ASS or SSA source**: upstream writes the source's styles into the head and `style="Default" xmlns="…"` on every `<p>`; ours has the plain head. - **TTML from SRT with ill-formed markup** (unclosed or misordered `<i>`/`<b>`): upstream applies a SubtitleEdit fix-up; ours keeps the text. Only a lone `<` matches. - **`ass`/`ssa` from a SAMI source**: upstream 718 and 660 bytes, ours 699. SAMI and other formats outside SRT/ASS/SSA still go through ffmpeg. - **`ssa` from an ASS source**: upstream's SSA writer gives 1082 bytes, ours 767 (the raw ass). - **Charset of a non-UTF-8 sidecar**: a byte-order mark, else Windows-1252; upstream uses UtfUnknown. A latin-1 file matches; a file UtfUnknown would call something else does not. Unmeasured: - An external `.idx`/`.sub` pair: the pinned ffmpeg has no vobsub muxer to make one. Upstream probably answers 500; the port answers 404. - ASS override codes beyond `\i \b \u \c \an8 \pos`, and ill-formed ASS/SSA. - WebVTT colour class names other than `red`, `lime`, `blue`, `yellow` and `color123456`. The cue parser and writers were written after #242's review round and have not been independently reviewed; they are held by the captured fixtures and by `serving.json` (77 responses, 0 differences).
Author
Collaborator

Landed (six commits ending in the lint commit on main): text tracks are read and written by ports of SubtitleEdit's readers and writers, held to about 200 answers captured from a private upstream v12.2 and compared byte for byte (15 sources × six writers, with windows) plus 34 charset captures. All five measured differences are closed: TTML from ASS/SSA with its styles, ill-formed SRT markup, SAMI sources, ssa from ASS, and charset detection. Also: a VobSub .idx is read as upstream reads it (200; a graphical format on it is 400), the wider set of ASS override codes, and the WebVTT colour classes read from the source rather than assumed. Not independently reviewed; the captures are the verification. What remains is filed separately.

Landed (six commits ending in the lint commit on main): text tracks are read and written by ports of SubtitleEdit's readers and writers, held to about 200 answers captured from a private upstream v12.2 and compared byte for byte (15 sources × six writers, with windows) plus 34 charset captures. All five measured differences are closed: TTML from ASS/SSA with its styles, ill-formed SRT markup, SAMI sources, `ssa` from ASS, and charset detection. Also: a VobSub `.idx` is read as upstream reads it (200; a graphical format on it is 400), the wider set of ASS override codes, and the WebVTT colour classes read from the source rather than assumed. Not independently reviewed; the captures are the verification. What remains is filed separately.
Sign in to join this conversation.
No description provided.