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

WebAssembly.Memory(): could not allocate memory

Open TheSecondAkari opened this issue 2 years ago • 2 comments

I have made a browser plug-in for "video download and encoding", which is used in Edge and Chrome browsers. The same product. Most users can use it smoothly. However, a small number of users will report an error 【RangeError: WebAssembly.Memory(): could not allocate memory】 What causes the error? For example, "System, Notebook, PC" ? Can we handle it?

TheSecondAkari avatar Sep 16 '22 13:09 TheSecondAkari

I can't locate the cause of this error.
Only a small number of plug-in users will encounter this problem

TheSecondAkari avatar Sep 16 '22 13:09 TheSecondAkari

use: ffmpeg.wasm v0.10.1

TheSecondAkari avatar Sep 16 '22 13:09 TheSecondAkari

no problem on pc, on mobile chrome will got same error

kkxlkkxllb avatar Sep 28 '22 07:09 kkxlkkxllb

@kkxlkkxllb same here do you know any hack or any solution for it

EABangalore avatar Oct 04 '22 07:10 EABangalore

@EABangalore only way is Use single thread version

const ffmpeg = createFFmpeg({
  mainName: 'main',
  corePath: 'https://unpkg.com/@ffmpeg/[email protected]/dist/ffmpeg-core.js',
});

can run on chrome mobile

kkxlkkxllb avatar Oct 11 '22 06:10 kkxlkkxllb

@kkxlkkxllb I try to use Use single thread version!

but,it error!

RuntimeError: abort(LinkError: WebAssembly.instantiate(): mismatch in shared state of memory, declared = 0, imported = 1). Build with -s ASSERTIONS=1 for more info.

how to fix it? please help. /(ㄒoㄒ)/~~

TheSecondAkari avatar Oct 12 '22 16:10 TheSecondAkari

@kkxlkkxllb thank you very much for replying, what version of ffmpeg is compatible with corePath: 'https://unpkg.com/@ffmpeg/[email protected]/dist/ffmpeg-core.js', as you answered above.

EABangalore avatar Oct 13 '22 10:10 EABangalore

@TheSecondAkari what version of ffmpeg are you using .

EABangalore avatar Oct 13 '22 10:10 EABangalore

@EABangalore ffmpeg.wasm v0.11.4

TheSecondAkari avatar Oct 13 '22 10:10 TheSecondAkari

How to make it indexed to the right version。 I use it as this . const ffmpeg = createFFmpeg({ mainName: 'main', corePath: 'https://unpkg.com/@ffmpeg/[email protected]/dist/ffmpeg-core.js', });

What else need to pay attention to?

TheSecondAkari avatar Oct 13 '22 10:10 TheSecondAkari

@TheSecondAkari 你是在chrome mobile浏览器里测试的吗?如果是其他手机浏览器是会报错的,我在 chrome mobile里测试是成功的,单线程模式

kkxlkkxllb avatar Oct 14 '22 01:10 kkxlkkxllb

@kkxlkkxllb 我使用的是台式电脑的chrome浏览器测试的

TheSecondAkari avatar Oct 14 '22 11:10 TheSecondAkari

@kkxlkkxllb please don't mind still i'm in learning how can i install this https://unpkg.com/@ffmpeg/[email protected]/dist/ffmpeg-core.js with npm

EABangalore avatar Oct 16 '22 03:10 EABangalore

@kkxlkkxllb @EABangalore single thread version is right. It can fix. But it has another bug. #436

TheSecondAkari avatar Oct 24 '22 12:10 TheSecondAkari

@TheSecondAkari have you found any solution for https://github.com/ffmpegwasm/ffmpeg.wasm/issues/436

EABangalore avatar Jan 29 '23 06:01 EABangalore

@TheSecondAkari have you found any solution for #436

Turn it off, restart it, and run the second command. Although this is stupid, I only know this method now。

image

TheSecondAkari avatar Jan 29 '23 08:01 TheSecondAkari