Repository navigation
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This focused fix changes the default codec selected for existing browser recordings from avc1 to avc3, altering production output even though bitrate and fallback behavior remain intact. The added unit and Electron regression coverage lowers implementation risk but does not remove the need to review the default transition. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change extracts browser recorder creation, prefers resize-capable ChangesBrowser recording
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to This change switches recording preference to resize-capable avc3 MP4 profiles while retaining WebM fallback and bitrate behavior, with coverage for resized recordings. No merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What Changed
Resizing Preview during recording currently produces corrupt H.264 frames in the exported MP4. Prefer supported
avc3MP4 profiles so updated decoder parameters travel with the frames when capture dimensions change. Keep the existing WebM fallback, bitrate calculation and fitted preview behavior.Move recorder construction into a small dependency-free module so an Electron regression can exercise the production configuration with a real MediaRecorder. The regression records desktop → mobile → desktop dimensions, decodes the complete file with FFmpeg, and checks frame dimensions, final-frame coverage and increasing timestamps. Existing recording tests cover format selection and the recorder's actual saved MIME type.
Closes #10494.
Why
The native capture stream changes dimensions when the viewport changes. Chromium's
avc1muxing writes the codec description once and omits updated SPS/PPS from samples. Its MediaRecorder implementation recommendsavc3when recording dimensions change.Both baseline resize takes failed full-file decoding; fixed desktop and mobile controls passed. With this change, all four corresponding exports decode successfully. Frame inspection verifies desktop and mobile geometry within each resized recording. Source packet DTS values increase strictly. All four fixed exports played to the end in Electron, including both dimension transitions. The final resized frame shows 8.000 seconds and Complete.
Validation:
cd apps/web && vp test run src/browser/browserRecording.test.ts --project unit: 33 tests passed.node --test apps/desktop/scripts/browser-recording-media.test.mjs: native regression failed with the old configuration and passed with the fix. Requires a graphical session, installed desktop Electron dependency, FFmpeg and ffprobe. This focused check is not added to CI.cd apps/web && vp run typecheckpassed.UI Changes
Original application exports, with an eight-second animation and a viewport resize around three seconds:
Before: Corrupt resize recording
before-resize.mp4
After: Valid resize recording
after-resize.mp4
Native-resolution frames from the fixed recording:
The recording format supports changing frame dimensions. Container-level width and height alone do not describe every frame. Playback outside Electron/Chromium and FFmpeg has not been verified.
The fitted preview remains unchanged. CSS scaling can reduce the source's rendered detail before screenshots or video capture. This change does not restore that detail. Screenshot softness is tracked in #9872 and proposed screenshot changes are in #9916; neither is closed by this PR.
Checklist
Model: GPT-6 Astra. Harness: Codex.
Summary by CodeRabbit
New Features
Bug Fixes