[Libav-user] What is correct method to identify streams containing alpha?

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Jun 15 02:13:42 EEST 2018


2018-06-14 23:03 GMT+02:00, Mark Schafer <mschafer at wireframe.biz>:
> We're trying to integrate ffmpeg 4 with Pyglet.
> Its all going very well but we have one issue:
>
> - If a VP9 (or VP8) file is created using ffmpeg4 from png files with
> alphas, we get a video file (webm) with alpha internally. (Excellent)
> - ffmpeg -i image_seq%03d.png -qmin 0 -qmax 50 -crf 5 -b:v 1M output.webm
>      - The report from this CLI indicates that an alpha has been generated.
>
> - Sample webm videos with alpha can be found on this page:
> https://simpl.info/videoalpha/
> - However on playing back we only get the RGB and do not get the alpha
> unless we override the codec to be 'libvpx'.

Yes, this is a known limitation of the native decoder, luckily you
have already found the only known work-around - not to use it if
you need this feature.

If you really want to choose the decoder based on the alpha
layer, you can check AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL
if the side_data starts with (uint64_t) 1 there is a transparency layer.

It is probably simpler to always use the libvpx decoder.

Carl Eugen


More information about the Libav-user mailing list