【发布时间】:2021-07-14 13:30:33
【问题描述】:
详细错误:
WebAssembly.Memory(): could not allocate memory
at https://*******/ffmpeg-core.js:22:82
at https://*******/ffmpeg.min.js:1:6506
at f (https://*******/ffmpeg.min.js:1:11322)
at Generator._invoke (https://*******/ffmpeg.min.js:1:11110)
at Generator.next (https://*******/ffmpeg.min.js:1:11747)
at i (https://*******/ffmpeg.min.js:1:4295)
at c (https://*******/ffmpeg.min.js:1:4498)
ffmpeg 代码:
const downloadWithFFMPEG = async () =>{
const sourceBuffer = await fetch(recordingURL).then(r => r.arrayBuffer());
await ffmpeg.load();
await ffmpeg.FS(
"writeFile",
"input.webm",
new Uint8Array(sourceBuffer, 0, sourceBuffer.byteLength)
);
await ffmpeg.run("-i", "input.webm", "-c", "copy", "output.mp4")
const output = ffmpeg.FS("readFile", "output.mp4");
var link = document.createElement('a')
link.href = URL.createObjectURL(new Blob([output.buffer], { type: 'video/mp4;codecs=H264' }));
link.download = this.data;
link.click();
recording = false;
}
问题简介: 该错误仅适用于 android chrome 浏览器。相同的代码在 pc/laptop chrome 上运行良好。 还在 chrome://flags 上为 android 浏览器启用了 Webassembly-thread,因为有人建议我这样做,但仍然是同样的错误。有人可以帮我吗?
【问题讨论】:
标签: javascript html google-chrome ffmpeg webassembly