Skip to content

fix(producer): keep video captures viewport-bound on software#1788

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/software-capture-beyond-viewport
Jun 29, 2026
Merged

fix(producer): keep video captures viewport-bound on software#1788
miguel-heygen merged 1 commit into
mainfrom
fix/software-capture-beyond-viewport

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

Fixes #1715 by stopping video compositions from forcing Chrome's beyond-viewport screenshot compositor under software rendering.

Why

The latest #1715 analysis checks out at source level: both the in-process renderer and distributed chunk renderer forced captureBeyondViewport: true whenever a composition had native videos. That preserves a hardware-rendering workaround, but on SwiftShader/software render hosts it sends every frame through a much more expensive full-surface compositor path. Distributed chunks are explicitly software-only, so they were always taking the slow path for video compositions.

How

  • Added resolveVideoCaptureBeyondViewport(videoCount, browserGpuMode) so the video workaround is only enabled on resolved hardware rendering.
  • In the in-process renderer, resolve the actual browser GPU mode via the engine's cached resolveBrowserGpuMode(...) before building capture options. auto therefore uses the real probed hardware/software result, not the requested string.
  • In distributed chunks, pass the known software mode and explicitly set captureBeyondViewport: false for video chunks.
  • Leave no-video renders unchanged by returning undefined, so existing engine/browser defaults still apply.

Test plan

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (not applicable)

Verification run:

  • bunx vitest run packages/producer/src/services/render/captureBeyondViewport.test.ts
  • bun --filter @hyperframes/producer typecheck
  • bun run format:check
  • bun run lint
  • bunx vitest run packages/producer/src/services/render/captureBeyondViewport.test.ts packages/producer/src/services/renderOrchestrator.test.ts
  • bun test --timeout 60000 packages/producer/src/services/distributed/renderChunk.test.ts
  • bun --filter @hyperframes/producer build
  • git diff --check

Note: I verified the source-level root cause and both affected call sites locally. I could not run the reporter's private benchmark suite from the issue thread, so the perf delta still needs validation on the same software-render host/fixture after merge.

@miguel-heygen miguel-heygen merged commit c9613cd into main Jun 29, 2026
45 checks passed
@miguel-heygen miguel-heygen deleted the fix/software-capture-beyond-viewport branch June 29, 2026 22:29
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.

https://github.com/heygen-com/hyperframes/issues/1653 - still reproducible in 0.75.0

1 participant