[gst-devel] import image with transparent background

Terry Leung terry83 at gmail.com
Mon Jan 7 03:57:23 CET 2008


Hi,

I've now added a capsfilter before the ffmpegcolorspace
The caps is like that:
g_object_set (G_OBJECT (m_pCaps), "caps", gst_caps_from_string
("video/x-raw-rgb,alpha_mask=255"), NULL);

Therefore, the pipeline before videomixer is like the following:
filesrc ! gdkpixbufdec ! capsfilter ! ffmpegcolorspace ! queue ! videomixer

in the sink pads of videomixer, i've set the alpha value to 1.0
(otherwise the whole image will be half or fully transparent, this is
not the result i want)

The result i want is only those image/character in the file are solid,
while the background should be transparent.

After I've added a capsfliter in between(make sure it use the second
caps), the result is still the same, the whole picture overlay on top
of another video with solid background

Here is the attached png file for testing

is it possible that the alpha channel is lost in ffmepgcolorspace
which convert the raw rgb with alpha mask to AYUV?

Regards,
Terry


On Jan 4, 2008 5:44 PM, Tim Müller <t.i.m at zen.co.uk> wrote:
>
> On Fri, 2008-01-04 at 11:38 +0800, Terry Leung wrote:
>
> > I've just complied the plugin you mentioned
> >
> > The src caps are as following:
> >  ...
> >       video/x-raw-rgb
> >                     bpp: 32
> >                   depth: 32
> >              alpha_mask: 255
> >  ...
> >
> > The src of it is still raw rgb (without alpha).
>
> Not according to what you posted (check the second caps; note that this
> is a list of possible output caps, it's not the first in the list that
> counts).
>
> > If then , how can i use the alpha channel of a png image?
>
> Both
>
>  gst-launch-0.10 -v filesrc location=rgba32.png ! gdkpixbufdec !
> fakesink
>
> and
>
>  gst-launch-0.10 -v filesrc location=rgba32.png ! pngdec ! fakesink
>
> give me RGBA output (note the alpha mask in the caps), both with CVS and
> the current releases.
>
> Maybe you could make your image file available somewhere so we can try
> it?
>
>
>  Cheers
>   -Tim
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.png
Type: image/png
Size: 710 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080107/5b714bdf/attachment.png>


More information about the gstreamer-devel mailing list