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

RuntimeError: memory access out of bounds compress error

Open CRIMSON-CORP opened this issue 1 year ago • 7 comments
trafficstars

Describe the bug When trying to use ffmpeg to convert mp4 to webm specifically, using the vp9 codec, i get this error "RuntimeError: memory access out of bounds" just after it starts the operation

To Reproduce Github Repository

Expected behavior i expect the compression to go on without issue, and if there is an issue, it should show how to resolve it

Screenshots image

Desktop (please complete the following information):

  • OS: [Windows 11 Pro]
  • Browser [Chrome]
  • Version [Version 121.0.6167.140 (Official Build) (64-bit)]

Additional context Im using a 16GB RAM Dell Precision 5520, i dont understand how im getting memory access out of bounds, seems to me like Chrome assigns a certain amount of memory to each tab, and the ffmpeg execution is exceeding it

CRIMSON-CORP avatar Feb 04 '24 20:02 CRIMSON-CORP

I can repro on a macintel. vp9 codec. mp4 to webm.

spiceee avatar Feb 09 '24 20:02 spiceee

Memory out-of-bounds error with vp9 is also reproducible via the playground:

https://ffmpegwasm.netlify.app/playground

spiceee avatar Feb 29 '24 22:02 spiceee

try to use this to convert mp4 to webm

await this.ffmpeg.exec([
    "-i", "input.mp4",
    "-fflags", "+genpts",
    "-preset", "ultrafast",
    "-c:v", "libvpx",
    "-c:a", "libvorbis",
    "-crf", "23",
    "-threads", "0",
    "output.webm",
]);

fixed memory out error using vorbis audio codec

Allespro avatar Mar 10 '24 11:03 Allespro

try to use this to convert mp4 to webm

await this.ffmpeg.exec([
    "-i", "input.mp4",
    "-fflags", "+genpts",
    "-preset", "ultrafast",
    "-c:v", "libvpx",
    "-c:a", "libvorbis",
    "-crf", "23",
    "-threads", "0",
    "output.webm",
]);

fixed memory out error using vorbis audio codec

thanks, your solution works, but why?

tylim88 avatar Aug 12 '24 13:08 tylim88

try to use this to convert mp4 to webm

await this.ffmpeg.exec([
    "-i", "input.mp4",
    "-fflags", "+genpts",
    "-preset", "ultrafast",
    "-c:v", "libvpx",
    "-c:a", "libvorbis",
    "-crf", "23",
    "-threads", "0",
    "output.webm",
]);

fixed memory out error using vorbis audio codec

thanks, your solution works, but why?

ugh, I don't remember, I tried different combinations of codecs, these seem to be perfect

Allespro avatar Aug 12 '24 18:08 Allespro