ffmpegwasm / ffmpegwasm/ffmpeg.wasm
can't decode webm video with alpha channel
- 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:
**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.
native ffmpeg
ffmpeg.wasm
**Desktop (please complete the following information):**
- OS: macOs Sonoma 14.0
- Browser:chrome
- Version:118.0.5993.117
**Additional context**
png:

Contributor guide
Assessment
This issue has not been assessed yet.