Subtitle Reference Test Files #
This directory contains reference ASS subtitle files used for validating the ass-rs rendering pipeline in the vodplace player worker.
Files #
aegisub-format-tests.ass #
Downloaded from the Aegisub project repository:
https://raw.githubusercontent.com/Aegisub/Aegisub/master/docs/specs/ass-format-tests.ass
This file exercises many ASS format features: multiple styles, positioning, colour overrides, and various override tags. It serves as a corpus for testing ass-rs parser completeness.
basic-styled.ass #
A minimal hand-written ASS file for focused validation of the rendering pipeline. It covers:
- Default style: Noto Sans SC, white, size 24, bottom-centre (alignment 2)
- Secondary style: Noto Sans SC, yellow, size 24, top-centre (alignment 8)
- Inline override tags:
{\b1}bold{\b0},{\i1}italic{\i0} - CJK text:
日本語テストat 10 seconds
Timestamps:
- 0:00:01 – 0:00:04 → "Hello, world!" (Default style)
- 0:00:02 – 0:00:05 → "Top text" (Top style, yellow, top-centre)
- 0:00:03 – 0:00:06 → "Styled bold and italic" with inline tags (Default)
- 0:00:10 – 0:00:13 → "日本語テスト" (CJK test, requires Noto Sans SC font)
validation-results.md #
Documents the results of the end-to-end rendering pipeline validation, including what worked, what didn't, and known limitations.
Reference Screenshots #
Reference screenshots (from mpv/libass) have not yet been generated. mpv was not available in the development environment at the time Task 6 was completed.
Commands to generate reference screenshots (once mpv is available) #
# Ensure mpv with libass is installed (NixOS example)
nix-shell -p mpv
# Render a screenshot at 2 seconds (overlaps lines at 1s and 2s)
mpv --no-audio \
--sub-file=tests/subtitle-reference/basic-styled.ass \
--screenshot-format=png \
--screenshot-directory=tests/subtitle-reference/reference/ \
--start=2 --end=2.1 \
--frames=1 \
"tests/subtitle-reference/basic-styled.ass" \
--vf="lavfi=[color=black:640x480:rate=1]" \
--o="tests/subtitle-reference/reference/basic-styled-2s.png"
# Alternative: use ffmpeg with libass
ffmpeg -f lavfi -i "color=black:640x480:rate=1" \
-vf "ass=tests/subtitle-reference/basic-styled.ass" \
-vframes 1 -ss 2 \
tests/subtitle-reference/reference/basic-styled-2s.png
ffmpeg -f lavfi -i "color=black:640x480:rate=1" \
-vf "ass=tests/subtitle-reference/basic-styled.ass" \
-vframes 1 -ss 3 \
tests/subtitle-reference/reference/basic-styled-3s.png
ffmpeg -f lavfi -i "color=black:640x480:rate=1" \
-vf "ass=tests/subtitle-reference/basic-styled.ass" \
-vframes 1 -ss 10 \
tests/subtitle-reference/reference/basic-styled-10s.png
Save outputs as:
tests/subtitle-reference/reference/basic-styled-2s.png— shows "Hello, world!" (default) + "Top text" (top)tests/subtitle-reference/reference/basic-styled-3s.png— shows all three overlapping linestests/subtitle-reference/reference/basic-styled-10s.png— shows CJK text
Visual Validation Notes #
Pixel-perfect matching between ass-rs and mpv/libass is not expected and is not the bar. The two renderers use different rasterisation engines:
- mpv uses libass (C library, FreeType-based rasterisation)
- ass-rs uses rustybuzz + fontdb (Rust, HarfBuzz-compatible shaping)
The visual bar is: correct text, correct colour, correct position, correct inline tag application. Sub-pixel kerning differences, anti-aliasing differences, and minor layout variations are acceptable.
Pixel-exact regression testing is deferred to Phase 7, which will use a
canvas toDataURL() capture against a stored baseline from the browser.