fix: add warnings for large FFmpeg video uploads#1152
Open
YLaxmikanth wants to merge 1 commit into
Open
Conversation
|
@YLaxmikanth is attempting to deploy a commit to the magic-peach1's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
👋 Thanks for your PR, @YLaxmikanth!Welcome to Reframe — a browser-based video editor built for everyone 🎬
What happens next
Quick checklist
Useful links
Happy coding! 🎉 |
Contributor
✅ PR Format Check Passed — @YLaxmikanthBasic format checks passed. A maintainer will review your code changes. This does not mean the PR is approved — it just means the format is correct. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the missing user feedback issue when uploading large videos that may exceed FFmpeg.wasm browser memory limitations.
Previously, users could upload very large files (500MB+) and experience browser freezes, silent export failures, or crashes without any warning or actionable feedback.
This PR introduces reusable file-size risk detection, adaptive warning thresholds, and a dismissible UI warning banner to improve export UX and reduce confusion around browser memory limitations.
Related Issue
Closes #1150
Type of Contribution
Participant Info
Screen Recording
Recording / Loom link: Not attached
Checklist
bun run lintpasses (no ESLint errors)bunx tsc --noEmitpasses (no TypeScript errors)aria-label/ accessible namesconsole.logstatements left inRoot Cause
The app only enforced a hard 2GB upload limit and showed minimal guidance for moderately large files.
There was no structured risk detection or user-facing warning for the common real-world scenarios where FFmpeg.wasm becomes unstable or memory-constrained during browser-based exports.
As a result:
Fix Implemented
Reusable File Risk Detection
Added:
src/lib/fileSizeRisk.tsIntroduced:
FileRiskLevelanalyzeFileRisk()formatBytes()Risk levels:
safelargevery-largeDefault thresholds:
> 500MB→ warning> 1GB→ stronger warningAdaptive Device-Memory Heuristics
When available:
is used to scale thresholds more conservatively on lower-memory devices.
Examples:
This remains non-blocking and lightweight.
Improved Warning UI
Added a dismissible warning banner in:
src/components/VideoEditor.tsxThe warning now:
Example UX:
Files Modified
Added
src/lib/fileSizeRisk.tssrc/lib/tests/fileSizeRisk.test.tsUpdated
src/hooks/useVideoEditor.tssrc/components/VideoEditor.tsxTest Coverage
Added dedicated tests for:
formatBytes()formattingValidation
Build
npm run build✅Lint
npm run lint✅Tests
npm run test✅TypeScript
bunx tsc --noEmit✅Expected Outcome