ffmpegwasm / ffmpegwasm/ffmpeg.wasm

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

Abierto
#449 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C
Estrellas
17.8k
Forks
1.1k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.