ffmpeg.js
ffmpeg.js copied to clipboard
Cannot read property 'write' of undefined
I ran into this exception and couldn't find any related issue in the repo. Maybe I'm passing the video in the wrong way to ffmpeg
?
Repro steps
- Load a video to a blob
const blob = await fetch(videoURL).then((r) => r.blob());
- Try to do a simple trim operation using ffmpeg.js
const result = ffmpeg({
MEMFS: [{ name: "video.webm", data: blob }],
arguments: [
"-ss",
"00:00:1.0",
"-i",
"video.webm",
"-t",
"10",
"-c",
"copy",
"output.webm",
],
});
console.log(result);
- Verify the exception is thrown
Stack trace
When I look at the stack to see where the exception is thrown, I think this line is the culprit:
process.stdout.write.bind(process.stdout)
Since this is on the client side, there's no process.stdout
. Is there a way for me to prevent this from happening?
Environment
- Next.js
- ffmpeg.js: ^4.2.9003
- Chrome
I have noticed this as well. It seems when you do your own build with the steps on the readme, the build is different then the standard prebuilt js files that you get from "npm install ffmpeg.js." As you can see highlighted in the picture there are multiple lines like "process.stdout.write" and "process.stderr." The normal npm download does not included these lines of code.
Not sure what's causing this but if I find out anything I will update this thread.
Any news about this issue? I'm having the same problem.
I have noticed this as well. It seems when you do your own build with the steps on the readme, the build is different then the standard prebuilt js files that you get from "npm install ffmpeg.js." As you can see highlighted in the picture there are multiple lines like "process.stdout.write" and "process.stderr." The normal npm download does not included these lines of code.
Not sure what's causing this but if I find out anything I will update this thread.
I installed using npm and i have the same issue.
I can reproduce this issue on mac OSX, ffmpeg installed from brew, ffmpeg js installed via npm.
Even when installing via NPM I can also reproduce the issue, when running in a browser environment.
I have the same issue using the NPM package in a browser environment. Any updates on this?
I have the same problem
Is this issue still open? Cause I encounter the same issue with MacOS, installed via NPM