ffmpegwasm / ffmpeg.wasm

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

[WIP] Proof of concept to let ffmpeg.wasm work in angular #562

Closed DeepHorizons closed 7 months ago

DeepHorizons commented 11 months ago

Attempt to fix #560 and #548

I am not a web developer and am not familiar with the tools to compile or test this locally. If someone could point me in the direction of some tutorials / docs on that I can test this in an angular app.

netlify[bot] commented 11 months ago

Deploy Preview for ffmpegwasm canceled.

Name Link
Latest commit a174d04e69db9bf39e9800511df3ffe6e1d62e4e
Latest deploy log https://app.netlify.com/sites/ffmpegwasm/deploys/64e7ad765564eb00080654a0
th-m commented 9 months ago

I would love to have this merged

fromage9747 commented 9 months ago

same here...

steam0r commented 9 months ago

for what it's worth. if you need this as a quickfix in javascript, edit vanilla-app/public/assets/ffmpeg/package/dist/umd/ffmpeg.js to have the load method look like this:

load = (r = {}) => (this.#e || (this.#e = new Worker(r.workerLoadURL ? r.workerLoadURL : new URL(e.p + e.u(814), e.b), {type: void 0}), this.#o()), this.#i({
    type: t.LOAD,
    data: r
}));

then give a workerLoadURL in ffmpg.load():

const options = {
    "coreURL": await toBlobURL(coreFile, "text/javascript"),
    "wasmURL": await toBlobURL(wasmFile, "application/wasm"),
    "workerLoadURL": await toBlobURL(workerFile, "text/javascript")
};
await ffmpeg.load(options);
ronaldohoch commented 7 months ago

Hi guys, any news about this solution?

jeromewu commented 7 months ago

Fixed by #652

ayoubqrt commented 7 months ago

Hi @jeromewu , why did you create you own pull request instead of contributing to this one ? (I'm just curious)

jeromewu commented 7 months ago

@ayoubqrt Sorry about that, there was another PR (#639) fixing the same issue and I tried to fix it with my own PR (#652) as I am not sure if the author will respond to my comments soon. And later I found this PR is actually doing the same fix (The name was misleading, so I am not aware of that in the first place). I have no intention to redo the work here.

ayoubqrt commented 7 months ago

Okay no problem at all @jeromewu . Thank you for the clarification. I think it would have been nice anyway to wait his answer but I understand that it can be frustrating as you want to ship the fix. Have a nice day !

ronaldohoch commented 7 months ago

@jeromewu tested here and it don't worked. Tested in Angular 16 and in Angular 17, with your code sample and it wont load the worker :(