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 摘要。