ffmpegwasm / ffmpeg.wasm

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

ffmpeg.wasm does not support nodejs #773

Open Unitoshka opened 3 months ago

Unitoshka commented 3 months ago

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

jz1 commented 3 months ago

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.

Unitoshka commented 2 months ago

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

izogfif commented 2 months ago

@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.