ffmpegwasm / ffmpegwasm/ffmpeg.wasm

FFmpeg.wasm exits early when attempting to concatenate frames into video

Aperta
#445 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C
Stelle
17.8k
Fork
1.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Describe the bug**
I am creating a tool that captures frames from an HTML canvas and uses ffmpeg.wasm to make a video out of the frames. The way it works is it saves each frame as a PNG with `ffmpeg.FS()`, then uses a glob pattern in `ffmpeg.run()` to collect all of the frames and concatenate them into a video.

The issue is that FFmpeg is exiting early (without error), causing the video to be cut short. It seems to always stop at 180 frames in both Firefox and Chrome. I have created a simpler version of the code that just uses one image for all of the frames (but still duplicates it multiple times in the FFmpeg FS) so that the code for capturing the canvas can be omitted.

**To Reproduce**

1. Clone the repo (https://github.com/viberfoner/ffmpeg-wasm-frame-limit-bug), install dependencies, and run the server locally.

```bash
git clone https://github.com/viberfoner/ffmpeg-wasm-frame-limit-bug.git
cd ffmpeg-wasm-frame-limit-bug
npm install
node server
```

2. Open http://localhost:8080 in your browser. Open dev tools and note that the frames stop encoding at 180, instead of finishing at 300.

**Expected behavior**
FFmpeg should produce a 5 second long video with 300 frames. Instead, it stops at 180 frames.

**Desktop:**
- OS: Linux Mint 20.2
- Browser: Firefox & Chrome
- Version: 107

**Additional context**
This is my first time submitting an issue on GitHub, so please let me know if I can improve it!

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.