ffmpegwasm / ffmpegwasm/ffmpeg.wasm

Cannot execute ffmpeg.FS('init', {...}) successfully

Đang mở
#449 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C
Star
17.8k
Fork
1.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Describe the bug**
If I try to execute `ffmpeg.FS('init', {...})` so I can use stdin and stdout with ffmpeg, the code doesn't work. I get
> Oops, something went wrong in FS operation.

And no more information of what went wrong.

[FS.init()](https://emscripten.org/docs/api_reference/Filesystem-API.html#setting-up-standard-i-o-devices) is documented in emscripten and the [ffmpeg.wasm API documentation ](https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/docs/api.md#ffmpeg-fs) tells both:

> Run FS operations.

> For more info, check https://emscripten.org/docs/api_reference/Filesystem-API.html

**To Reproduce**
Place all ffmpeg files (including `ffmpeg.min.js`) in the current directory
Use this HTML:
```

Document


(async () => {
const { createFFmpeg, fetchFile } = FFmpeg;
const ffmpeg = createFFmpeg({ log: true });
await ffmpeg.load();
ffmpeg.FS('init', {
stdin: () => {
return null
}
});
})()

```
When it's done loading, it will fail with the error.

**Expected behavior**
No exception happens and emscripten's `FS.init` is executed with the provided object (which would allow streaming video content)

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: N/A
- Browser firefox
- Version 107

**Additional context**

I'm trying to stream data from the website to ffmpeg.
If I use an url for input, a websocket is opened at the root of the URL and raw HTTP traffic is sent through it. That would require custom code to handle the traffic (not useful! I need the root path for regular HTTP traffic; not websockets! If I can control the path where the websocket is requested, then I could do something about it!).
If I try to stream the input into stdin, I only get complications with it because I need to provide data byte by byte. Even then I tried continuing. I get this bug I'm reporting.

I try to figure out how to have an uncompressed version because variable names don't match but I can't find instructions on how to generate `ffmpeg.js` without being minimized. Given so, I can't help you beyond what I have here.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.