ffmpegwasm / ffmpegwasm/ffmpeg.wasm

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

オープン
#261 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C
スター
17.8k
フォーク
1.1k
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。