Problem
src/lib/ffmpeg.ts creates a Blob URL for the exported video:
return {
blobUrl: URL.createObjectURL(blob),
...
};
URL.createObjectURL creates a reference-counted object in browser memory.
The Blob's memory is not freed until URL.revokeObjectURL is called. The
exportVideo function never calls revokeObjectURL, and there is no cleanup
in the React component that receives the blobUrl.
A user who exports multiple videos in the same browser session accumulates one
unreleased Blob in memory per export. For large video files (100MB+), a few
exports can exhaust available tab memory.
Additionally, the temporary CDN fetch Blob URLs created by toBlobURL for the
WASM core in loadFFmpeg are also created but never revoked.
Impact
- Memory grows unboundedly with each export.
- Long editing sessions or repeated exports degrade performance and eventually
crash the tab.
Suggested Fix
- When a new export replaces the previous one, revoke the old Blob URL:
if (previousBlobUrl) URL.revokeObjectURL(previousBlobUrl);
- In the React component, revoke the Blob URL in the cleanup function of
useEffect when the component unmounts.
- Revoke the WASM core Blob URLs after FFmpeg finishes loading (the WASM
engine retains its own reference to the loaded module; the Blob URL is
no longer needed after ffmpeg.load() completes).
Problem
src/lib/ffmpeg.tscreates a Blob URL for the exported video:URL.createObjectURLcreates a reference-counted object in browser memory.The Blob's memory is not freed until
URL.revokeObjectURLis called. TheexportVideofunction never callsrevokeObjectURL, and there is no cleanupin the React component that receives the
blobUrl.A user who exports multiple videos in the same browser session accumulates one
unreleased Blob in memory per export. For large video files (100MB+), a few
exports can exhaust available tab memory.
Additionally, the temporary CDN fetch Blob URLs created by
toBlobURLfor theWASM core in
loadFFmpegare also created but never revoked.Impact
crash the tab.
Suggested Fix
useEffectwhen the component unmounts.engine retains its own reference to the loaded module; the Blob URL is
no longer needed after
ffmpeg.load()completes).