ffmpegwasm / ffmpeg.wasm

FFmpeg for browser, powered by WebAssembly
https://ffmpegwasm.netlify.app
MIT License
13.63k stars 787 forks source link

FFmpeg is not defined #529

Closed Jveshi closed 11 months ago

Jveshi commented 11 months ago

Describe the bug FFmpeg is not defined

I used to use version 0.11.x, recently released 0.12.x, I need to make changes to the code. I downloaded the required files into a local directory and referenced them. image


But when I started using it, an error occurred, what should I do.

const ffmpeg = new FFmpeg();

image


Try it on the official page, such as Playground, the result is the same.

image

Desktop:

rambo-panda commented 11 months ago
window.FFmpegWASM.FFmpeg
Jveshi commented 11 months ago
window.FFmpegWASM.FFmpeg

I get it, I made a mistake according to the official docs.did not write this code

const { FFmpeg } = FFmpegWASM; const { fetchFile } = FFmpegUtil;


But then encountered a new problem image image But if change it to this, it will be fine. image


The new version seems to be slower. (maybe the code is still buggy with multithreading not enabled) What is your situation? V0.12.2 image V0.11.6 image

jeromewu commented 11 months ago

The core you use in v0.12.2 is single-thread, that's why it is slower. You can use core-mt instead.

More details: https://ffmpegwasm.netlify.app/docs/getting-started/usage#transcoding-video-multi-thread