Skip to content

feat: implement Audio Extraction (MP3/WAV) and self-host FFmpeg WASM engine#1091

Open
Abhishek2005-ard wants to merge 6 commits into
magic-peach:mainfrom
Abhishek2005-ard:feat/extract-audio
Open

feat: implement Audio Extraction (MP3/WAV) and self-host FFmpeg WASM engine#1091
Abhishek2005-ard wants to merge 6 commits into
magic-peach:mainfrom
Abhishek2005-ard:feat/extract-audio

Conversation

@Abhishek2005-ard
Copy link
Copy Markdown

Description

This PR introduces the Extract Audio feature, allowing users to rip just the audio track from their uploaded videos into MP3 or high-quality WAV formats.

Additionally, it fundamentally resolves the Failed to load the FFmpeg engine. Check your internet connection. error by self-hosting the FFmpeg WebAssembly assets locally, completely removing reliance on external CDNs like unpkg.com or jsdelivr during runtime.

✨ Key Features & Changes:

  1. Audio Extraction Formats: Added MP3 and WAV options to the Format Selector dropdown.
  2. Context-Aware UI: When an audio format is selected, the application automatically hides video-specific options (Quality sliders, Denoise, Stabilization) and displays a clean, informational banner.
  3. Accurate Size Estimations: Updated the exportEstimate logic to accurately calculate the estimated file size for MP3 (192kbps) and WAV (CD-Quality 1411kbps) exports based on clip duration.
  4. Self-Hosted FFmpeg Assets: Added scripts to pre-download the FFmpeg WebAssembly (.wasm), Web Worker, and core .js files into the public/ffmpeg directory.
  5. Intelligent Hybrid Loader: Re-engineered src/lib/ffmpeg.ts to seamlessly pick the best local FFmpeg build based on browser isolation:
    • Uses the extremely fast Multi-Threaded (core-mt) build when the environment is fully Cross-Origin Isolated.
    • Falls back to the universally compatible Single-Threaded UMD build when running in non-isolated local development environments, completely preventing Chromium strict-sandbox Web Worker crashes.
  6. Local Development Isolation: Added COOP (same-origin) and COEP (require-corp) HTTP headers to next.config.ts to mimic production isolation locally.

🧪 How to Test:

  1. Start the local development server (npm run dev).
  2. Upload a video file.
  3. Scroll down and select MP3 or WAV in the Output Format dropdown.
  4. Verify that the video quality sliders are hidden and replaced with an audio-only notice.
  5. Click EXPORT and ensure the process finishes correctly without any "FFmpegLoadError" or network connection issues, and that the audio file downloads successfully.

ScrrenRecord:-

Screen.Recording.2026-05-24.212116.mp4

close #1079

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@Abhishek2005-ard 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.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @Abhishek2005-ard!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 24, 2026

✅ PR Format Check Passed — @Abhishek2005-ard

Basic 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.

@github-actions github-actions Bot added level:advanced Advanced level - 55 pts type:bug Bug fix type:design UI/UX design type:feature New feature type:testing Testing labels May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:advanced Advanced level - 55 pts type:bug Bug fix type:design UI/UX design type:feature New feature type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Extract and Export Audio (MP3/WAV)

1 participant