ffmpegwasm / ffmpegwasm/ffmpeg.wasm

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

Đang mở
#261 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C
Star
17.8k
Fork
1.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.