Bug Summary
Large uploaded videos are fully loaded into memory and decoded immediately for waveform generation, which can cause severe memory spikes, browser freezes, or tab crashes.
Files
src/hooks/useAudioWaveform.ts (around line 59)
audioContext = new AudioContextCtor();
const audioBuffer = await audioContext.decodeAudioData(
await file.arrayBuffer()
);
Called automatically from:
src/components/TrimControl.tsx (around line 28)
const { waveform, isLoading: waveformLoading } = useAudioWaveform(file);
Root Cause
Every uploaded video file is immediately:
- Read completely into memory using
file.arrayBuffer()
- Decoded using
decodeAudioData()
- Processed regardless of whether the user opens the trim feature
This occurs automatically when TrimControl mounts.
Steps to Reproduce
- Upload a large video (400–500 MB).
- Wait for the editor to initialize.
- Observe memory usage in browser task manager/dev tools.
- On lower-memory devices, the tab may become unresponsive or crash.
Actual Behavior
The application allocates a full copy of the uploaded file in memory and attempts to decode it immediately.
Large files can cause:
- Excessive memory consumption
- UI freezing
- Browser tab crashes
- Poor responsiveness
Expected Behavior
Waveform generation should be deferred until needed and should avoid loading extremely large files into memory.
Impact
The application accepts videos up to approximately 500 MB, yet immediately processes the full file.
Real users editing phone or camera footage may experience:
- Frozen UI
- Browser crashes
- Failed editing sessions
before performing any export operation.
Suggested Fix
Possible improvements include:
- Generate waveforms only when the trim panel is opened.
- Skip waveform generation for very large files.
- Downsample audio before processing.
- Move extraction work into the FFmpeg worker.
- Add true cancellation support that stops processing instead of only preventing state updates.
Why This Is a Bug
The failure mode is not theoretical. The application accepts large uploads and unconditionally allocates a full in-memory copy, making browser freezes and crashes a realistic user-facing issue.
ASSIGN TO ME UNDER GSSOC2026.
/ASSIGN /GSSOC2026
Bug Summary
Large uploaded videos are fully loaded into memory and decoded immediately for waveform generation, which can cause severe memory spikes, browser freezes, or tab crashes.
Files
src/hooks/useAudioWaveform.ts(around line 59)Called automatically from:
src/components/TrimControl.tsx(around line 28)Root Cause
Every uploaded video file is immediately:
file.arrayBuffer()decodeAudioData()This occurs automatically when
TrimControlmounts.Steps to Reproduce
Actual Behavior
The application allocates a full copy of the uploaded file in memory and attempts to decode it immediately.
Large files can cause:
Expected Behavior
Waveform generation should be deferred until needed and should avoid loading extremely large files into memory.
Impact
The application accepts videos up to approximately 500 MB, yet immediately processes the full file.
Real users editing phone or camera footage may experience:
before performing any export operation.
Suggested Fix
Possible improvements include:
Why This Is a Bug
The failure mode is not theoretical. The application accepts large uploads and unconditionally allocates a full in-memory copy, making browser freezes and crashes a realistic user-facing issue.
ASSIGN TO ME UNDER GSSOC2026.
/ASSIGN /GSSOC2026