ffmpeg.wasm icon indicating copy to clipboard operation
ffmpeg.wasm copied to clipboard

ffmpeg.wasm does not support nodejs

Open fdmafhgs opened this issue 1 year ago • 4 comments

I installed ffmpeg.wasm in a project with solidjs and imported it in one of the files and it wrote this to me, I use bun as the runtime

fdmafhgs avatar Aug 13 '24 10:08 fdmafhgs

https://ffmpegwasm.netlify.app/docs/faq

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 Of course, it is still highly welcome to contribute a nodejs version of ffmpeg.wasm.

jz1 avatar Aug 14 '24 11:08 jz1

бля какой ноде жс я же говорю юзаю бан

fdmafhgs avatar Aug 19 '24 07:08 fdmafhgs

@jz1 If ffmpeg.wasm isn't compatible with NodeJS, then why is there a lot of code related to NodeJS in ffmpeg-core.js?

if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");

If this should only work in worker, then you should add -sENVIRONMENT=worker to emcripten build options in build/ffmpeg-wasm.sh.

izogfif avatar Aug 30 '24 06:08 izogfif

This error is being thrown even though it's loaded in a browser context in Astro.

loukamb avatar Dec 29 '24 00:12 loukamb