ffmpegwasm / ffmpegwasm/ffmpeg.wasm

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

Ouverte
#445 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C
Étoiles
17.8k
Forks
1.1k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.