Skip to content

fix(video): select AVC level for larger capture frames - #417

Merged
iuyo5678 merged 2 commits into
mainfrom
fix/video-h264-frame-size
Oct 12, 2026
Merged

iuyo5678 merged 2 commits into
mainfrom
fix/video-h264-frame-size

Conversation

@iuyo5678

@iuyo5678 iuyo5678 commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Clear-quality recordings of taller or square tabs can fail before capture starts because the fixed H.264 level 4.2 codec allows fewer macroblocks than some frames within the 1920-pixel limit. For example, 1920x1152 is supported but 1920x1154 exceeds the limit after 16x16 edge padding.

Select baseline AVC level 5.0 only when the final, scaled frame exceeds level 4.2's 8,704-macroblock limit. Frames that already fit keep their existing encoding parameters. The change is confined to encoder configuration and regression coverage.

Validation:

  • Extension suite: 2,581 tests passed.
  • TypeScript check, production extension build, and formatting checks passed.
  • Unit coverage includes the padded-area boundary, source scaling, even-dimension rounding, portrait and square frames, the unchanged standard preset, and a guard that each preset's maximum square frame fits within level 5.0's 22,080-macroblock frame-size limit.
  • Local browser regression on macOS 26.5 arm64 with Chrome for Testing 155 (headless): offscreen encoding, recovery, and seekable MP4 playback passed, including 1920x1154, 1920x1200, 1200x1920, and 1920x1920 clear-quality recordings.

The video CI job runs on Linux. The local test does not force or identify the encoder backend, so Windows MediaFoundation and macOS VideoToolbox hardware encoding remain unverified.

Follow-up to #412.

@iuyo5678
iuyo5678 merged commit 0bcf528 into main Oct 12, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants