-
-
Notifications
You must be signed in to change notification settings - Fork 1k
-
Hi,
I'm trying to make it work but load never resolves and reading the docs I'm not sure to understand how it's expected to load the worker and wasm file.
Installation says:
Note
As @ffmpeg/ffmpeg spawns a web worker, you cannot import @ffmpeg/ffmpeg from CDN like unpkg. It is recommended to download it and host it on your server most of the time.
But the next section only shows how to load the worker and wasm file from unpkg, not how to bundle it
Thanks
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 2 replies
-
Related to #568 I guess.
Here is what I tried:
import ffmpegWasm from '@ffmpeg/core-mt/wasm?url' // resolves to "/@fs/node_modules/@ffmpeg/core-mt/dist/esm/ffmpeg-core.wasm" in dev import ffmpegCore from '@ffmpeg/core-mt?url' // resolves to "/@fs/node_modules/@ffmpeg/core-mt/dist/esm/ffmpeg-core.js" in dev await this.ffmpeg.load({ coreURL: await toBlobURL(ffmpegCore, 'text/javascript'), wasmURL: await toBlobURL(ffmpegWasm, 'application/wasm') })
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
joy of code has a tutorial on ffmpeg wasm in sveltekit pwa, i'm guessing it should be possible
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Just scrubbing it seems he just copies the build output, sure it's a way but not really "bundle friendly" which I assume most people use nowadays.
Vite has the tooling for what this project needs so I don't get why it's not simplifi (just check the amount of issues about worker hosting)
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks still as I think I can find a way around it using https://www.npmjs.com/package/vite-plugin-cdn-import
Beta Was this translation helpful? Give feedback.