fix(render): fix WebM transparency — use screenshot mode + proper CDP setup

- Force screenshot capture mode for WebM (beginFrame doesn't support
  alpha channel in chrome-headless-shell)
- Set Emulation.setDefaultBackgroundColorOverride once during session
  creation (matching experiment-framework's approach)
- Fix acquireBrowser to pass executable path in screenshot mode on
  Linux (was setting undefined, causing puppeteer-core to fail)
- Add Page.captureScreenshot params: fromSurface, captureBeyondViewport,
  optimizeForSpeed (matching experiment-framework)
- Fix regression harness extractMonoPcm16 for videos without audio
- Add getEncoderPreset unit tests
- Add webm-transparency regression test with golden baseline

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
James
2026-03-27 02:35:03 +00:00
co-authored by Claude Opus 4.6
parent a146c9e527
commit efc7b82755
5 changed files with 10 additions and 7 deletions
@@ -104,6 +104,8 @@ export async function pageScreenshotCapture(page: Page, options: CaptureOptions)
const result = await client.send("Page.captureScreenshot", {
format,
quality: format === "jpeg" ? (options.quality ?? 80) : undefined,
fromSurface: true,
captureBeyondViewport: false,
optimizeForSpeed: true,
});
return Buffer.from(result.data, "base64");