import image with transparent background

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

import image with transparent background

Terry Leung-2
Hi all,

I am now writing a program to overlay an image on top of a video clip

However, as I want to overlay an image with transparent background and
those image decoder src pad are either raw rgb or raw yuv(without
alpha), I want to ask how can i do that? can gstreamer support the
transparent feature in some type of image(like png or gif)? and how?

Regards,
Terry

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: import image with transparent background

Tim-Philipp Müller-2
On Thu, 2008-01-03 at 10:41 +0800, Terry Leung wrote:

Hi,

> I am now writing a program to overlay an image on top of a video clip
>
> However, as I want to overlay an image with transparent background and
> those image decoder src pad are either raw rgb or raw yuv(without
> alpha), I want to ask how can i do that? can gstreamer support the
> transparent feature in some type of image(like png or gif)? and how?

Which image decoder exactly? What format is your image in?

IIRC, gdkpixbufdec outputs RGBA if the image has an alpha channel.

 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

gstreamer and kdevelope

Daniel Shachrur
hi,
 
is anyone writes application using gstreamer and kdevelop?
 
thanx
 
 


Express yourself instantly with MSN Messenger! MSN Messenger
-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: import image with transparent background

Terry Leung-2
In reply to this post by Tim-Philipp Müller-2
HI,

I am using png and have used gst-inspect to inspect the caps of some
common format like bitmap, jpeg and png
It dosnt matter for what decoder to use. I just need the program to
load a common format picture with transparent background and overlay
the image on top of a video.

By the way, any program that support output a gdkpixbufdec picture or
convert a png with alpha channel to this format?

Regrads,
Terry

On Jan 3, 2008 5:57 PM, Tim Müller <[hidden email]> wrote:

> On Thu, 2008-01-03 at 10:41 +0800, Terry Leung wrote:
>
> Hi,
>
>
> > I am now writing a program to overlay an image on top of a video clip
> >
> > However, as I want to overlay an image with transparent background and
> > those image decoder src pad are either raw rgb or raw yuv(without
> > alpha), I want to ask how can i do that? can gstreamer support the
> > transparent feature in some type of image(like png or gif)? and how?
>
> Which image decoder exactly? What format is your image in?
>
> IIRC, gdkpixbufdec outputs RGBA if the image has an alpha channel.
>
>  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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: import image with transparent background

Terry Leung-2
Hi,

I've just complied the plugin you mentioned

The src caps are as following:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw-rgb
                    bpp: 24
                  depth: 24
             endianness: 4321
               red_mask: 16711680
             green_mask: 65280
              blue_mask: 255
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw-rgb
                    bpp: 32
                  depth: 32
             endianness: 4321
               red_mask: -16777216
             green_mask: 16711680
              blue_mask: 65280
             alpha_mask: 255
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

The src of it is still raw rgb(without alpha). If then , how can i use
the alpha channel of a png image?

Regards,
Terry

On Jan 3, 2008 8:34 PM, Terry Leung <[hidden email]> wrote:

> HI,
>
> I am using png and have used gst-inspect to inspect the caps of some
> common format like bitmap, jpeg and png
> It dosnt matter for what decoder to use. I just need the program to
> load a common format picture with transparent background and overlay
> the image on top of a video.
>
> By the way, any program that support output a gdkpixbufdec picture or
> convert a png with alpha channel to this format?
>
> Regrads,
> Terry
>
>
> On Jan 3, 2008 5:57 PM, Tim Müller <[hidden email]> wrote:
> > On Thu, 2008-01-03 at 10:41 +0800, Terry Leung wrote:
> >
> > Hi,
> >
> >
> > > I am now writing a program to overlay an image on top of a video clip
> > >
> > > However, as I want to overlay an image with transparent background and
> > > those image decoder src pad are either raw rgb or raw yuv(without
> > > alpha), I want to ask how can i do that? can gstreamer support the
> > > transparent feature in some type of image(like png or gif)? and how?
> >
> > Which image decoder exactly? What format is your image in?
> >
> > IIRC, gdkpixbufdec outputs RGBA if the image has an alpha channel.
> >
> >  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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >
>

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: import image with transparent background

Terry Leung-2
In reply to this post by Tim-Philipp Müller-2
Hi,

I've tried to use png image with transparent background and it doesnt work

here is part of my pipeline: filesrc !  gdkpixbufdec !
ffmpegcolorspace ! videomixer
I also have another src for the videomixer with zorder value lower

any plugin that can read a image and output a rgba/ayuv video?


Regards,
Terry

On Jan 3, 2008 5:57 PM, Tim Müller <[hidden email]> wrote:

> On Thu, 2008-01-03 at 10:41 +0800, Terry Leung wrote:
>
> Hi,
>
>
> > I am now writing a program to overlay an image on top of a video clip
> >
> > However, as I want to overlay an image with transparent background and
> > those image decoder src pad are either raw rgb or raw yuv(without
> > alpha), I want to ask how can i do that? can gstreamer support the
> > transparent feature in some type of image(like png or gif)? and how?
>
> Which image decoder exactly? What format is your image in?
>
> IIRC, gdkpixbufdec outputs RGBA if the image has an alpha channel.
>
>  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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: import image with transparent background

Tim-Philipp Müller-2
In reply to this post by Terry Leung-2

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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: import image with transparent background

Terry Leung-2
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 <[hidden email]> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

test.png (972 bytes) Download Attachment