ffmpegwasm / ffmpegwasm/ffmpeg.wasm

Crashes with pthread error: f.asm is undefined

Offen
#233 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C
Sterne
17.8k
Forks
1.1k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Describe the bug**
I am using ffmpeg-wasm to transcode multiple mp2 files to mp3 in the browser. Sometimes, it works flawlessly on multiple files, but then logs an error to the console and the ffmpeg.run promise doesn't even resolve nor reject

```
fferr pthread sent an error! blob:http://localhost:3000/2b82eddd-2ff1-4fd6-8c5c-4b9def392732:219: TypeError: f.asm is undefined
```

**To Reproduce**
I cannot successfully reproduce this, so I'll describe my setup:

* I am using svelte-kit for my website
* I am using `async-mutex` to stop concurrent transcoding, the plan is to transcode one after another
* my code was inspired by the `transcode.html` example in this repo
* I only create a single instance
* I only call load if `isLoaded` returns false

```ts
const { createFFmpeg, fetchFile } = window.FFmpeg

if (!ffmpeg) {
ffmpeg = createFFmpeg({
corePath: "/ffmpeg/ffmpeg-core.js"
})
}

ffmpeg.setLogger(({ type, message }) => {
//...
})

ffmpeg.setProgress(({ ratio }) => {
//...
})

if (!ffmpeg.isLoaded()) {
await ffmpeg.load()
}

ffmpeg.FS("writeFile", file.name, await fetchFile(file))

const mp3 = replaceSuffix(file.name, "mp3")

// sometimes this crashes but doesn't reject, so it never returns
await ffmpeg.run('-i', file.name, "-vn", "-acodec", "libmp3lame", "-b:a", "320k", mp3)

const outfile = ffmpeg.FS('readFile', mp3)
ffmpeg.FS("unlink", mp3)
```

**Expected behavior**
should not crash, and if it crashes, it should at least reject the promise

**Screenshots**
here is a screenshot of my console, I hope that this can help
![image](https://user-images.githubusercontent.com/18500203/127661559-64ecb9a6-1bf4-4972-a43c-ca0650820d26.png)

**Desktop:**
System:
OS: Linux 5.10 Arch Linux
CPU: (8) x64 Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz
Memory: 15.14 GB / 31.22 GB
Container: Yes
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.2.0 - ~/.nvm/versions/node/v16.2.0/bin/node
Yarn: 1.22.11 - /usr/bin/yarn
npm: 7.13.0 - ~/.nvm/versions/node/v16.2.0/bin/npm
Browsers:
Chromium: 92.0.4515.107
Firefox: 90.0.2

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.