[gst-devel] alpha handled improperly by ffmpegcolorspace

Bert Douglas bertd at tplogic.com
Sat Aug 28 18:05:56 CEST 2010


When converting from RGBA to RGB, ffmpegcolorspace simply throws away alpha.

This is not compatible with videomixer, which uses "premultiplied" alpha.
In other words, the color components have been multiplied by alpha.

When using pre-multiplied alpha it is necessary to divide color values by
alpha when converting back to regular rgb.

This is correct:
    in:  RGBA
    out: rgb
    action:
         r = R/A
         g = G/A
         b = B/A

But instead what actually happens is:
    r = R
    g = G
    b = B

This problem is not specific to rgb but also happens in yuv.

I am willing to write some code to fix this.  But ffmpegcolorspace has so
many layers of macros that I am afraid to touch it.

Can someone advise me on an easy way to fix this?

Thanks much,
Bert Douglas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100828/20f80eeb/attachment.htm>


More information about the gstreamer-devel mailing list