fix: use beginFrame for headless recording capture - #29
Closed
carlesandres wants to merge 1 commit into
Closed
Conversation
|
@carlesandres is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
carlesandres
marked this pull request as ready for review
June 5, 2026 15:06
carlesandres
force-pushed
the
fix-recording-quality
branch
from
June 5, 2026 19:25
77c6de8 to
087aaea
Compare
Author
@ctate I've done my best to make it easy for you review. |
carlesandres
marked this pull request as draft
June 9, 2026 11:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR narrows the core headless recording fix from #12.
Credit to @sld0Ant for the earlier investigation and implementation work that identified the correct fix direction. This PR keeps only the begin-frame-control capture-path fix, the aligned PNG source-frame update, and focused test coverage so it is easier to review independently.
If you have time, I’d also welcome feedback from @sld0Ant on whether this captures the intended minimal version of the earlier fix.
Problem
webreelalready launches headless Chrome with--enable-begin-frame-control, but the recorder still captures frames with:Page.captureScreenshot()That creates two problems:
Page.captureScreenshot()is the wrong capture API for begin-frame-control modeChanges
This PR makes the narrowest recording-path fix I could extract from #12:
HeadlessExperimentalto the CDP client typeHeadlessExperimental.enable()during recording setupRecorder.start()and during failure cleanupPage.captureScreenshot()withHeadlessExperimental.beginFrame()optimizeForSpeed.pngWhy this helps
This fixes the headless capture path for begin-frame-control mode and improves source-frame quality for final exports.
The scope here is intentionally narrow. This PR is not claiming full 4k support or universal high-resolution throughput. It is only claiming:
Tests
Added focused coverage for:
HeadlessExperimental.beginFrame()with PNG screenshots.pngHeadlessExperimental.enable()happening beforeRecorder.start()The small
vitest.config.tsalias change is test-only plumbing for that runner coverage. It lets Vitest resolve the workspace@webreel/corepackage from source instead of requiring a builtdistoutput first.Verification run locally:
pnpm --filter @webreel/core testpnpm --filter webreel testpnpm type-checkDocs
Updated the user-facing
--frameswording to match current behavior:.webreel/frames/as PNG source frames in headless recording modeNon-goals
This PR intentionally does not include: