Skip to content

Stream the CLI/MCP audio export instead of buffering whole files #1385

Done

Description

@EtienneLescot

Follow-up from #1383 (review comment on src/cli/CliExportRunner.tsx).

The CLI/MCP audio export (exportAudio, openscreen export -o out.wav|out.m4a) and the MP4 voiceover mix both hold whole files in memory in the renderer: the rendered MP4 is fetched back as a Blob, the audio is extracted into an ArrayBuffer, and the result goes through writeExportToPath as one buffer over IPC. For a long project that means the full MP4 plus the full WAV live in the renderer at once, which can exhaust memory.

Proposal: stream instead of buffering. Read the render from disk in chunks (mediabunny StreamSource or a file-handle source), write the extracted audio through a streamed target, and add a write-stream IPC (open / append / close) rather than a single-buffer write. A WAV could also be written by the main process directly.

Out of scope for #1383, which keeps the existing buffer-based path the MP4 export already uses.

🤖 Generated with Claude Code

Activity

  1. auberginewly commented on Oct 28, 2026

    @auberginewly
    Contributor

    I'd like to take this on. I'll investigate the CLI/MCP audio export and MP4 voiceover mix paths, then work on streaming file reads/writes and the necessary IPC so long projects don't require whole media files to be buffered in the renderer. I'll keep the work scoped to this memory issue. Please let me know if anyone is already working on it.

  2. EtienneLescot commented on Nov 28, 2026

    @EtienneLescot
    MemberAuthor

    The streamed export landed in #1521: the WAV export and the voiceover mix no longer hold whole files in memory in the main process, and the renderer peak dropped sharply. The remaining voiceover memory needs the mix to move into the compositor, tracked in its own issue (#1695). Closing this one, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions