Skip to content

[upstream #688] perf(recording): stream native Windows screen recording to main process without renderer round-trip #2

Description

@My-Denia

Migrated from upstream OpenScreen issue: https://github.com/siddharthvaddem/openscreen/issues/688

Source: siddharthvaddem/openscreen#688
Upstream labels: none


Summary

Currently, the native Windows finalize path (finalizeNativeWindowsRecording in src/hooks/useScreenRecorder.ts) reads the entire on-disk screen recording back into renderer memory via window.electronAPI.readBinaryFile(nativeScreenPath) and ships those bytes to the main process via storeRecordedSession. For long recordings this can be a multi-GB IPC transfer and risks an OOM crash in the renderer on stop — even after the webcam sidecar OOM fix in #687.

Proposed fix

Add a dedicated main-process IPC handler (e.g. attach-webcam-to-screen-recording) that accepts:

  • The native screen file path (already on disk)
  • The webcam sidecar file name / whether it is streamed
  • A small duration-fixed webcam blob buffer (only when not streamed)

The main process reads, patches, and merges the files itself — the renderer never marshals the multi-GB screen bytes over IPC.

Context

Acceptance criteria

  • readBinaryFile(nativeScreenPath) is removed from the renderer finalize path
  • A main-process handler owns the screen + webcam disk merge/patch
  • Renderer only marshals small in-memory webcam data (if any)
  • Existing tsc --noEmit, biome check, and vitest checks remain green

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream-migrationIssues imported from the archived upstream OpenScreen repository

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions