Adding alpha or transparency to video

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

Adding alpha or transparency to video

Jonathan Wong-7
Hi,

Hope this is the right place to ask this.

Is it possible to code a transform that adds transparency to a video stream? How do I do it?
GstVideoFilter? GstBaseTransform?

Is it already done somewhere?

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adding alpha or transparency to video

ved kpl
Hi,

There are a few elements to add such effects to video.
You can have a look at effectv.

gst-inspect effectv.


On Fri, Apr 17, 2009 at 8:08 AM, Jonathan Wong <[hidden email]> wrote:

> Hi,
>
> Hope this is the right place to ask this.
>
> Is it possible to code a transform that adds transparency to a video stream? How do I do it?
> GstVideoFilter? GstBaseTransform?
>
> Is it already done somewhere?
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adding alpha or transparency to video

Jonathan Wong-7
Hi,

I forgot to mention I need it on Windows (and then Linux later).

I found this: http://pbx.mine.nu/effectv/ (a port of effectv to win32, using DirectShow no less)

I am hoping to programmatically make a video stream semi-transparent (alpha channel).

Any advice on where to start looking? Or should I mess around with a GstBuffer and see what
effects I get from messing around? :P

Currently, I do the semi-transparent effect with DirectShow. No manipulation of video data, just
using DirectShow API.

ved kpl wrote:

> Hi,
>
> There are a few elements to add such effects to video.
> You can have a look at effectv.
>
> gst-inspect effectv.
>
>
> On Fri, Apr 17, 2009 at 8:08 AM, Jonathan Wong <[hidden email]> wrote:
>> Hi,
>>
>> Hope this is the right place to ask this.
>>
>> Is it possible to code a transform that adds transparency to a video stream? How do I do it?
>> GstVideoFilter? GstBaseTransform?
>>
>> Is it already done somewhere?
>>
>> ------------------------------------------------------------------------------
>> Stay on top of everything new and different, both inside and
>> around Java (TM) technology - register by April 22, and save
>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
>> 300 plus technical and hands-on sessions. Register today.
>> Use priority code J9JMT32. http://p.sf.net/sfu/p
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>


------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adding alpha or transparency to video

lrn-2
Jonathan Wong wrote:
> Hi,
>
> I forgot to mention I need it on Windows (and then Linux later).
>
> I found this: http://pbx.mine.nu/effectv/ (a port of effectv to win32, using DirectShow no less)
>
> I am hoping to programmatically make a video stream semi-transparent (alpha channel).
>  
GStreamer (GstBuffer) supports colorspaces with alpha-channel. Adding
transparency is as simple as converting your video to the right
colorspace (AYUV or RGBA) using ffmpegcolorspace element and then
changing the alpha values to something other than default (this could be
done by your own element, or by existing one, if you manage to find it).
However, not all videosinks and video codecs support such colorspaces,
so that depends on what you are planning to do with the video.

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adding alpha or transparency to video

Jonathan Wong-7
Hi,

Thanks for the info!

 > However, not all videosinks and video codecs support such colorspaces, so
 > that depends on what you are planning to do with the video.

Play it in a Qt widget, on Windows, then on Linux.

Any idea which videosink or codecs do support alpha channel? Has anyone done this before to show
it works? At some point, I'll try every codec or sink there is to find out.

In DirectShow, I could get 2 videos playing, one on top of the other. The top one is transparent.
I can even get it to play inverted (and other cool transforms). Hoping to do just that with GStreamer.

LRN wrote:

> Jonathan Wong wrote:
>> Hi,
>>
>> I forgot to mention I need it on Windows (and then Linux later).
>>
>> I found this: http://pbx.mine.nu/effectv/ (a port of effectv to win32, using DirectShow no less)
>>
>> I am hoping to programmatically make a video stream semi-transparent (alpha channel).
>>  
> GStreamer (GstBuffer) supports colorspaces with alpha-channel. Adding
> transparency is as simple as converting your video to the right
> colorspace (AYUV or RGBA) using ffmpegcolorspace element and then
> changing the alpha values to something other than default (this could be
> done by your own element, or by existing one, if you manage to find it).
> However, not all videosinks and video codecs support such colorspaces,
> so that depends on what you are planning to do with the video.
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>


------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adding alpha or transparency to video

Stefan Sauer
In reply to this post by Jonathan Wong-7
Jonathan Wong schrieb:
> Hi,
>
> Hope this is the right place to ask this.
>
> Is it possible to code a transform that adds transparency to a video stream? How do I do it?
> GstVideoFilter? GstBaseTransform?

try these two:

alpha:  alpha: Alpha filter
alphacolor:  alphacolor: Alpha color filter


Stefan

>
> Is it already done somewhere?
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel