[gst-devel] AYUV text overlay

Lane Brooks lane at brooks.nu
Tue Jan 11 07:31:33 CET 2011


Sebastian,

Looking through the git log, it looks like you added support for the 
AYUV format in the pango textoverlay element.

It does not quite behave how I was hoping it would, so I wanted to 
discuss it with you to understand the current implementation.

If I create a completely transparent background image, I was hoping that 
textoverlay would still overlay the requested text appropriately, but 
the current implementation leaves the resulting image (including the 
text overlay) completely transparent (so the text is invisible). You can 
see this by running this pipeline:

gst-launch videotestsrc pattern=white ! 
video/x-raw-yuv,format=\(fourcc\)AYUV ! alpha alpha=0.0 ! textoverlay 
text=Testing auto-resize=False font-desc=60px ! videomixer ! 
ffmpegcolorspace ! autovideosink

Attached is a patch that changes the alpha compositing behavior to use a 
"A OVER B" scheme (http://en.wikipedia.org/wiki/Alpha_compositing).  Can 
you comment on this approach? With this patch, the above pipeline works 
like I want it to in that the text overlays and is visible regardless of 
alpha of the background image. I am not sure, however, the reasons for 
the current implementation and what advantages it has.

In case there is confusion, if you run the above pipeline with and 
without this patch, you will instantly see the difference. Without this 
patch, you get a completely transparent image and the text overlay is 
invisible. With the patch you get a transparent image everywhere except 
for the text in the overlay.

If the behavior from this patch is considered the appropriate behavior, 
I can also fix the the RGBA/ABGR path to do the same thing.

Thanks,
Lane


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_over.txt
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110110/5b845a66/attachment.txt>


More information about the gstreamer-devel mailing list