ffmpegwasm / ffmpegwasm/ffmpeg.wasm
Provide a way to pass the WASM and Core file content directly to the library instead of URLs.
- Dominant language
- C
- Stars
- 17.8k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
I am trying to write a userscript for Greasymonkey/Violentmonkey that requires media conversion. Due to the nature of the ecosystem, I cannot use the NPM package. Calling `ffmpeg.load({coreUrl, wasmUrl})` doesn't work, since websites usually have CORS enabled and I therefore cannot fetch the content from unpkg or other CDNs.
**Describe the solution you'd like**
These engines are able to load arbitrary JS dependency from CDNs by adding a metadata header field called `@require`. This works for the core JS file. But the WASM file cannot be loaded that way: under the hood, these extensions call `eval`, which won't work for WASM modules.
It would be great if the library could offer an option called `wasmBlob` that contains the raw WASM binary blob. The option could be exclusive or take precedence over wasmUrl. If it exists, ffmpeg would not fetch the WASM binary but try to load the provided blob.
This would work in my case, since these userscript extensions provide a custom HTTP fetch method called `GM_xmlHttpRequest` that can circumvent CORS restrictions.
**Describe alternatives you've considered**
There aren't any that I am aware of.
**Additional context**
-
Contributor guide
Assessment
This issue has not been assessed yet.