ffmpegwasm / ffmpegwasm/ffmpeg.wasm

Crashes with pthread error: f.asm is undefined

未關閉
#233 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C
星號
17.8k
分支
1.1k
PR 合併指標
30 天內沒有已合併 PR

描述

**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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。