question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module.instantiateWasm callback failed with error: out of memory

See original GitHub issue

Describe the bug Getting out of memory issue with small files (893 Kb).

To Reproduce

data below is a video-only Blob from a webcam.

async convert(data) {
        const { createFFmpeg, fetchFile } = FFmpeg;
        const ffmpeg = createFFmpeg({
            corePath: this.convertWorkerURL,
            log: this.debug
        });
        const name = "foo";

        // load and convert blob
        await ffmpeg.load();
        ffmpeg.FS('writeFile', name, await fetchFile(data));
        await ffmpeg.run('-i', name,  'output.mp4');
        const output = ffmpeg.FS('readFile', 'output.mp4');

        // create new blob
        let result = new Blob([output.buffer], { type: 'video/mp4' })
    }

Screenshots

Process and error in screenshot below:

Screenshot from 2020-11-14 23-17-28

Desktop (please complete the following information):

  • OS: Ubuntu 20
  • Browser: Firefox
  • Version 82

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
bever1337commented, Jan 10, 2021

@Marcosdg3 I am able to reproduce this in Firefox. With the devtools opens, calls to emscripten instantiateWasm fail. With devtools closed, the ffmpeg command is successful.

Browser: Firefox 84.0 (64-bit) OS: Catalina 10.15.7

2reactions
thijstriemstracommented, Nov 14, 2020

Also: would be nice to have some sort of error handling…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to properly handle "out of memory" error with Wasm/JS
I'm working on a computer-vision web-app. To do so, I use the OpenCV library in a Wasm Module as provided in the docs....
Read more >
[#QTBUG-101055] wasm: declarative apps crash with threads
... Ithe app fails to run with: Module.instantiateWasm callback failed with error: out of memory worker.js onmessage() captured an uncaught ...
Read more >
Photoshop, LibreOffice wasm compilation OOMs with devtools ...
Open up devtools; Navigate to photoshop; Observe 'Module.instantiateWasm callback failed with error: out of memory' in console; Errors cascade.
Read more >
ffmpegjs - Bountysource
Module.instantiateWasm callback failed with error: out of memory $ 0. Created 2 years ago in ffmpegwasm/ffmpeg.wasm with 4 comments.
Read more >
C and WASM via emcc - ontouchstart
The Module object: Our interface to the outside world. ... instantiateWasm callback failed with error: ' + e); return false; } } instantiateAsync();...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found