Kagami / ffmpeg.js

Port of FFmpeg with Emscripten
Other
3.24k stars 329 forks source link

Cannot read property 'write' of undefined #184

Open liyang9331 opened 1 year ago

liyang9331 commented 1 year ago

image

liyang9331 commented 1 year ago

image

genu commented 1 year ago

If you look at the example, the print and printErr functions are set. If you don't set those, process.stderr and process.stdout are used by default, which are undefined in browser:

For example, you can do this:

let stdout = "";
let stderr = "";

ffmpeg({
  arguments: ["-version"],
  print: function(data) { stdout += data + "\n"; },
  printErr: function(data) { stderr += data + "\n"; },
});