ffmpegwasm / ffmpegwasm/ffmpeg.wasm

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

Abierto
#261 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

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

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.