New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alpha channel not working for .webm #3256

Closed
fullmetal1 opened this Issue Jun 16, 2016 · 13 comments

Comments

Projects
None yet
5 participants
@fullmetal1

fullmetal1 commented Jun 16, 2016

I haven't extensively tested this. alpha channel works correctly on .gif, .png, but not .webm (VP8) I have not tested on other video codecs because I lack any examples with alpha channel.

An example video can be found here https://raw.githubusercontent.com/photonstorm/phaser-examples/master/examples/assets/video/alpha-webm.webm

It is incorrectly rendered as yuv420p, without the default checkerboard background.

I used a recent version of mpv

mpv git-b00eab5 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
built on Mon Jun 13 03:02:19 EDT 2016

default settings, no scripts.

@haasn

This comment has been minimized.

Member

haasn commented Jun 16, 2016

Doesn't seem like FFmpeg recognizes VP8 with embedded alpha channels at all. Not mpv's bug.

If FFmpeg were to correctly recognize/decode and export the video as YUVA420P instead of YUV420P, mpv should display it correctly. (But I haven't tested it, is there anything else that uses a YUVA format?)

@wm4

This comment has been minimized.

Contributor

wm4 commented Jun 16, 2016

Alpha in webm is a shitty hack, and actually there are 3 of them. They involve the container layer instead of being restricted to the codec. Not sure if it can be reasonably implemented at all.

@wm4 wm4 added the wontfix label Jun 16, 2016

@wm4

This comment has been minimized.

Contributor

wm4 commented Jun 16, 2016

I can't even find a specification of this crap. Unless someone does, this is a WONTFIX.

VP8 doesn't support alpha, and the alpha plane is in a BlockAdditional element attached to each packet. There's no specification for the format of this data, and ffmpeg's VP8 decoder does not use it.

Once again I'm amazed by the unfathomable dumb crap Google produced. They also got in patches in ffmpeg for this, but only for encoding. Fuck Google.

@wm4 wm4 closed this Jun 16, 2016

@haasn

This comment has been minimized.

Member

haasn commented Jun 16, 2016

Not sure if WONTFIX is even the right label. I'd just call it “not our bug”. We just display the data we get from libavcodec, and whether to WONTFIX this or not is pretty much just FFmpeg's decision.

@wm4

This comment has been minimized.

Contributor

wm4 commented Jun 16, 2016

Even if ffmpeg implements it at some point, the demuxer is not funneling through the data to the decoder.

@pouar

This comment has been minimized.

pouar commented Jun 7, 2018

To the googlers, I managed to get it working with vp9 by using --vd=libvpx-vp9 as ffmpeg's builtin vp9 decoder seems to be broken at autodetecting this.

@CounterPillow

This comment has been minimized.

Contributor

CounterPillow commented Jun 8, 2018

@pouar That doesn't do anything for VP8 videos, which means it's unrelated to this issue.

@pouar

This comment has been minimized.

pouar commented Jun 9, 2018

true, sorry about that

@fullmetal1

This comment has been minimized.

fullmetal1 commented Jun 10, 2018

@CounterPillow Not necessarily true as VP9 is part of the webm standard, and both support alpha channels.

@CounterPillow

This comment has been minimized.

Contributor

CounterPillow commented Jun 10, 2018

@fullmetal1 The issue is about a VP8 video. VP8 does alpha channels with a bad demuxer hack. The original reporter posted this with a VP8 WebM. --vd=libvpx-vp9 does not fix this for the VP8 WebM.

@fullmetal1

This comment has been minimized.

fullmetal1 commented Jun 12, 2018

@CounterPillow Yes, I am very familiar with the original reporter....

I posted with a VP8 webm, but according to pouar, the same is true for vp9 videos decoded with ffmpeg's default vp9 decoder, which means that ffmpeg has the same issue on vp8 and vp9.

@pouar

This comment has been minimized.

pouar commented Jun 12, 2018

might not be, as adding --vd=libvpx didn't work with vp8

@pouar

This comment has been minimized.

pouar commented Jun 12, 2018

ok, I'm wrong, adding --vd=libvpx does work with vp8 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment