ffmpegwasm / ffmpeg.wasm

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

NOT SUITED FOR NODEJS #659

Open jdking123 opened 6 months ago

jdking123 commented 6 months ago

⨯ node_modules\@ffmpeg\ffmpeg\dist\esm\empty.mjs (4:14) @ new FFmpeg ⨯ Error: ffmpeg.wasm does not support nodejs at ResultVideo (./src/components/resultvideo.js:20:69) null

Hahlh commented 4 months ago

This might be relevant:

https://ffmpegwasm.netlify.app/docs/faq/#why-ffmpegwasm-doesnt-support-nodejs

loretoparisi commented 3 months ago

This might be relevant:

https://ffmpegwasm.netlify.app/docs/faq/#why-ffmpegwasm-doesnt-support-nodejs

According to this Q&A

Why ffmpeg.wasm doesn't support nodejs?
ffmpeg.wasm did support nodejs before 0.12.0, but decided to discontinue nodejs support due to:

It takes extra effort to maintain nodejs support
If you are not in browser, there are a lot of better choices than using WebAssembly for a better performance, ex:
nodejs: https://www.npmjs.com/package/fluent-ffmpeg
react-native: https://github.com/arthenica/ffmpeg-kit

While I totally agree about the effort (of course it's a huge and amazing project 🥇 ), I do not think that the other solutions are comparable in practice. By example fluent-ffmpeg requires ffmpeg to be installed on the device, this cannot be done in all use cases. I would prefer to have the wasm compiled running without having the native ffmpeg installed: in some circumstances that will be the only way. If we take into consideration the ffmpeg-kit for React Native, this will requires lame (or shine) anyways to run.

I hope that support to Node.JS will be provided for >0.12.x, or at least instructions to manually adapt the current version, eventually with limited capabilities.

Raphael2908 commented 1 month ago

This might be relevant: https://ffmpegwasm.netlify.app/docs/faq/#why-ffmpegwasm-doesnt-support-nodejs

According to this Q&A

Why ffmpeg.wasm doesn't support nodejs?
ffmpeg.wasm did support nodejs before 0.12.0, but decided to discontinue nodejs support due to:

It takes extra effort to maintain nodejs support
If you are not in browser, there are a lot of better choices than using WebAssembly for a better performance, ex:
nodejs: https://www.npmjs.com/package/fluent-ffmpeg
react-native: https://github.com/arthenica/ffmpeg-kit

While I totally agree about the effort (of course it's a huge and amazing project 🥇 ), I do not think that the other solutions are comparable in practice. By example fluent-ffmpeg requires ffmpeg to be installed on the device, this cannot be done in all use cases. I would prefer to have the wasm compiled running without having the native ffmpeg installed: in some circumstances that will be the only way. If we take into consideration the ffmpeg-kit for React Native, this will requires lame (or shine) anyways to run.

I hope that support to Node.JS will be provided for >0.12.x, or at least instructions to manually adapt the current version, eventually with limited capabilities.

I do agree with the statement above. And while I still use ffmpeg.wasm for a prototype, I will have to swap it out in the future which will be a hassle. I love that I can run ffmpeg in the client without sending large video files to my backend for processing. Hopefully with OpenAI's Whisper getting better and better, we can see a return to supporting ffmpeg.wasm for node.