ffmpegwasm / ffmpegwasm/ffmpeg.wasm

Unable to convert gif to video format (mp4/webm etc.)

Offen
#261 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C
Sterne
17.8k
Forks
1.1k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I've been trying for a while to convert gifs to video formats, but the output is always a blank video player (nothing plays).

This is my code:
```
if (!ffmpeg.isLoaded()) {
await ffmpeg.load();
}
ffmpeg.FS('writeFile', name, await fetchFile(originalImage)); //originalImage is the uploaded gif
await ffmpeg.run('-i', name, '-movflags', 'faststart', '-pix_fmt', 'yuv420p', '-vf', 'scale=trunc(iw/2)*2:trunc(ih/2)*2', 'output.mp4');
const data = ffmpeg.FS('readFile', 'output.mp4');
const file = new File(data, 'output.mp4');
```

Once I upload the file and insert it into a video player, the player is blank and nothing happens. I even tried to download and play it on my machine, but it says some codecs are missing and the file cannot be played. I assume this is due to some other underlying issue.

**Expected behavior**
Be able to convert gif to video format successfully.

**Desktop (please complete the following information):**
- OS: Ubuntu 20.04.3 LTS
- Browser: Chrome
- Version 94.0.4606.61

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.