test(render): add WebM regression test and getEncoderPreset unit tests

- New regression test `webm-transparency`: minimal transparent composition
  rendered to WebM, validates VP9 codec and visual quality at 100
  checkpoints against golden baseline
- Extend regression harness: `renderConfig.format` field ("mp4" | "webm"),
  format-aware output paths and snapshot filenames
- Fix `extractMonoPcm16` to gracefully handle videos without audio
  streams (WebM without audio was throwing instead of returning empty)
- Unit tests for `getEncoderPreset()`: VP9/yuva420p for WebM,
  h264/yuv420p for MP4, preset mapping, quality preservation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
James
2026-03-27 02:19:43 +00:00
co-authored by Claude Opus 4.6
parent 15f6b86ac0
commit a146c9e527
6 changed files with 211 additions and 24 deletions
@@ -0,0 +1,14 @@
{
"name": "webm-transparency",
"description": "WebM VP9 render with transparent background (alpha channel). Validates the full WebM pipeline: PNG capture, VP9 encoding with yuva420p, and alpha_mode=1 metadata.",
"tags": ["webm", "transparency", "fast"],
"minPsnr": 30,
"maxFrameFailures": 2,
"minAudioCorrelation": 0.0,
"maxAudioLagWindows": 120,
"renderConfig": {
"fps": 30,
"format": "webm",
"workers": 1
}
}