feat: cross-browser export robustness + chromium paint-time capture#12
Merged
Conversation
Stacked on the CDP-direct screencast WIP. Five user-visible fixes: * cdp-screencast: encode at CFR (`-vf fps=N -fps_mode cfr`) so the paint-time-anchored concat output works inside downstream filter graphs. Without this, shader-splice's trim filter on a VFR source inflated the final mp4 by ~9.4s on a 165s recording. * shader-splice: append `setsar=1` to every concat input. Webkit's screencast emits SAR 108:109 while PNG transition sequences are 0:1, and concat refused to mix them. * record: auto-downgrade `captureMode: 'jpeg-stitch'` to `'webm'` on non-chromium with a loud warning. Firefox's `onFrame` only sustains ~3fps, so jpeg-stitch on FF/webkit hangs the test until timeout. * record: auto-clamp `deviceScaleFactor` to 1 on non-chromium with a warning. Webkit/firefox don't honor `--force-device-scale-factor`, so the page renders at 1x while the screencast captures at the 2x viewport — the unrendered region appears as gray padding (a "frame within a frame" once the export's frame effect wraps it). * CI matrix: a tiny silent demo (`ci-smoke`) plus a verify script that asserts dimensions, duration, and that the bottom-right pixel is not near-gray. Runs on chromium / firefox / webkit per push and PR. Includes a missing `narration.startRecording()` call in demos/blocks-showcase.demo.ts that was breaking that demo on every browser.
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
Five user-visible fixes that make Argo's capture and export robust across chromium, firefox, and webkit. Stacks on the original
feat/cdp-direct-screencastWIP that was paused while v0.34.2's paint-trigger shipped.src/cdp-screencast.tsopens a raw CDP session and usesmetadata.timestamp(paint time) for frame timing instead of arrival wallclock. Sidesteps the throughput-induced visual lag that v0.34.1's quality cap only mitigated. Encodes the concat output at CFR via-vf fps=N -fps_mode cfrso downstream filter graphs (shader-splice in particular) don't inflate the timeline.setsar=1on shader-splice concat inputs — webkit's screencast emits SAR 108:109 while PNG transition sequences are 0:1; concat refused to mix them. Every scene segment + transition segment now normalizes SAR to 1:1.captureMode: 'jpeg-stitch' → 'webm'on non-chromium — firefox'sonFrameonly sustains ~3fps, hanging the page-side test until timeout. Loud warning, runs through.deviceScaleFactorto 1 on non-chromium — webkit/firefox don't honor--force-device-scale-factor. Without clamping, the page renders at 1x while the screencast captures at the 2x viewport, leaving the right + bottom of every frame as gray padding (a "frame within a frame" once the export's frame effect wraps it).ci-smokedemo + verify script asserts dimensions / duration / non-gray bottom-right pixel. Runs on chromium / firefox / webkit per push and PR.Also includes a one-line fix to
demos/blocks-showcase.demo.ts(missingnarration.startRecording()call that was breaking the demo on every browser).Test plan
npm test— 636 tests pass locallyARGO_CDP_DIRECT=0: legacy path still works