ffmpegwasm / ffmpegwasm/ffmpeg.wasm

HLS: Hook on closing a chunk/file

Đang mở
#268 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ả

Hello. I'm using ffmpeg.wasm to create a HLS playlist from a given input.
I want to upload the individual chunks/files (`stream0.ts`, `stream1.ts`, `...`) asynchronously - to be more precise - as soon as ffmpeg has finished writing them.

I'm unsure on how to achieve this. ffmpeg doesn't seem to log when it's closing a file, only when opening:

> [fferr] [hls @ 0x1a7b5c0] Opening '/output/stream1.ts' for writing

This of course isn't the information I need because I may only start uploading a file once it's done being written to. I could infer that if I encounter the log message

> [fferr] [hls @ 0x1a7b5c0] Opening '/output/stream1.ts' for writing

that `stream0.ts` (`n-1`) is ready for upload, but this is quite hacky in my opinion plus there are edge cases like the playlist files and so on.

I also thought about continiously reading the FS with

```js
ffmpeg.FS('readdir' as FSMethodNames, '/output')
```

But I have the same problem. files appear as soon as ffmpeg opens them for writing.

Looking through the Emscripten FS API [this](https://emscripten.org/docs/api_reference/Filesystem-API.html#FS.trackingDelegate[callback%20name]) seems to be exactly what I need:

```js
FS.trackingDelegate['onCloseFile'] = function(path) {
out('Closed ' + path);
};
```

However, I don't really understand an how to use that inside my React application. This is my first time working with ffmpeg and WASM in general. I'd appreciate any help.

Thanks.

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.