ffmpegwasm / ffmpegwasm/ffmpeg.wasm

can't decode webm video with alpha channel

Open
#621 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
17.8k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
i have two materials,one is a webm video with alpha channel,and another is a png image,i need to generate a video with background,the background is png image,and ensure alpha channel are preserved

**To Reproduce**
here is code:
```
await ffmpeg.writeFile('input.webm', await fetchFile('video/output_idle.webm'));
await ffmpeg.writeFile('bg.png', await fetchFile('bg-vertical.png'));
await ffmpeg.exec(
[
'-i',
'input.webm',
'-c:v',
'libvpx',
'-i',
'bg.png',
'-filter_complex',
'[0:v][1:v]overlay=(W-w)/2:(H-h)/2',
'-vcodec',
'libx264',
'output.mp4'
]
);
```
i use libvpx to decode the input webm video, but the console reports the following error:
image

**Expected behavior**

I hope ffmpeg.wasm can decode webm format based video with transparent channel for easy operation

**Screenshots**
I use native ffmpeg to execute the same command, and it shows that the video input stream format output by ffmpeg is `yuva420p`, but the input stream format output using ffmpeg.wasm is `yuv420p`, and it feels like the transparent channel is lost.
image
native ffmpeg
image
ffmpeg.wasm

**Desktop (please complete the following information):**
- OS: macOs Sonoma 14.0
- Browser:chrome
- Version:118.0.5993.117

**Additional context**
png:
![bg-vertical](https://github.com/ffmpegwasm/ffmpeg.wasm/assets/30484035/649758ac-5c7c-466b-9692-6daf0396c256)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.