ffmpegwasm / ffmpegwasm/ffmpeg.wasm

FFmpeg UMD not loading in browser — exports is not defined and FFmpeg stays undefined (photo compression works, video fails)

Open
#909 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
17.8k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

IM SO FREAKING CLOSE!!!! I’m building a browser-based video & photo compression tool (VidShrink).
Photo compression via ffmpeg.wasm + @ffmpeg/util works perfectly, but the FFmpeg UMD never fully initializes for video — I keep getting:
Uncaught ReferenceError: exports is not defined
FFmpeg UMD loaded: false
FFmpeg Util present: false
FFmpeg still missing after wait
{ FFmpeg: undefined, FFmpegWASM: Module, FFmpegUtil: undefined }
Even though photo compression succeeds.

Environment

Running locally on localhost:3000

No bundler — pure tags in index.html

Using CDNs:
<script src="https://cdnjs.cloudflare.com/ajax/libs/ffmpeg/0.12.15/umd/ffmpeg.min.js">

window.__FFMPEG_CORE_PATH = "https://cdn.jsdelivr.net/npm/@ffmpeg/core@0.12.15/dist/umd/ffmpeg-core.js";

Chrome 129 on Windows 11

What works
✅ Photo compression via FFmpeg WASM runs and produces output correctly.

What fails
❌ FFmpeg UMD never sets window.FFmpeg → video compression errors:
Error: FFmpeg UMD script not ready. Check index.html load order (no defer on UMD).

What I’ve tried (Everything under the sun)

Different CDNs (cdnjs, unpkg, jsDelivr)

Local hosting of /assets/ffmpeg/*.js

Adding shim to alias window.FFmpegWASM → window.FFmpeg

Hard refresh / clearing cache

Could you please confirm what the correct UMD URLs and load order should be for a non-bundled browser setup in 2025?
Or if UMD builds have moved / changed names?

Thanks for keeping this project alive — it’s awesome work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.