ffmpegwasm / ffmpeg.wasm

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

Playground throws: Uncaught (in promise) RuntimeError: memory access out of bounds #722

Open guest271314 opened 2 months ago

guest271314 commented 2 months ago

Describe the bug Playground throws

790132bf.a92c5f5d.js:1 Uncaught (in promise) RuntimeError: memory access out of bounds

To Reproduce Upload tos.mkv from https://github.com/Kagami/mpv.js/blob/master/example/tos.mkv. Include arguments to convert to WebM.

Expected behavior MKV file to be converted to WEBM file.

Screenshots Screenshot_2024-04-06_22-17-10

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

netmaster4 commented 2 months ago

This is the ffmpeg output of the tos.mkv file

FFmpeg Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) FFmpeg Stream #0:1 -> #0:1 (mp3 (mp3float) -> aac (native)) FFmpeg [aac @ 0x1177380] Too many bits 13653.333333 > 12288 per frame requested, clamping to max

guest271314 commented 2 months ago

Works with ffmpeg on the machine.

guest271314 commented 2 months ago

@netmaster4 Where is that aac coming from?

Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> vp9 (libvpx-vp9))
  Stream #0:1 -> #0:1 (mp3 (mp3float) -> opus (libopus))
  Stream #0:2 -> #0:2 (subrip (srt) -> webvtt (native))
netmaster4 commented 2 months ago

direct from the tos.mkv file. and your Stream #0:1 with contains an MP3 ... and converts on ffmpegwasm to AAC. (default audio encoder)

Do you use the old v5.1 ffmpeg version on machine? i think its an ffmpeg sw bug not an ffmpeg wasm bug

guest271314 commented 2 months ago

My machine is using ffmpeg version 4.4.2.

and converts on ffmpegwasm to AAC. (default audio encoder)

That might be the issue.

not an ffmpeg wasm bug

So you are able to convert the tos.mkv to tos.webm file in the playground on your machine?

guest271314 commented 2 months ago

Wait a minute, is libvpx-vp9 not supported?

// equivalent ffmpeg.wasm API call
ffmpeg.exec(["-i","tos.mkv","-c:v","-c:v","libvpx-vp9","-c:a","libopus","-f","webm","tos.webm"]);

// equivalent ffmpeg command line
ffmpeg -i tos.mkv -c:v -c:v libvpx-vp9 -c:a libopus -f webm tos.webm
[NULL @ 0xef6d90] Unable to find a suitable output format for 'libvpx-vp9'
libvpx-vp9: Invalid argument
Aborted()