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

RuntimeError: memory access out of bounds fixed after running invalid command

Open allen-garvey opened this issue 1 year ago • 2 comments

Describe the bug For certain video files, when converting from video to images, ffmpeg will fail with RuntimeError: memory access out of bounds. However if ffmpeg.exec is run before, with an invalid command, the operation will succeed.

To Reproduce

// for certain videos, fails with RuntimeError: memory access out of bounds
ffmpeg.exec(["-i", "movie.mp4", "-vf", `fps=1`, `/tmp/%02d.jpg`]);

// however the following will succeed
ffmpeg
  .exec(["-i", "not-found"])
  .then(() =>
    ffmpeg.exec(["-i", "movie.mp4", "-vf", `fps=1`, `/tmp/%02d.jpg`])
  );

Expected behavior ffmpeg.exec should work the first time without having to execute an invalid command.

Desktop (please complete the following information):

  • OS: Ubuntu 24.04
  • Browser Chrome
  • Version 132.0.6834.83

allen-garvey avatar Jan 17 '25 17:01 allen-garvey

I can reproduce the bug. For example in 20 image search it will fail 2-5 times. When converting to very small images (160x90) it works normally without fails

domlija avatar Jan 24 '25 08:01 domlija

Yes, I also encountered the same problem

leiyi2000 avatar Jun 06 '25 02:06 leiyi2000