Make transparent a specific color inside a video

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

Make transparent a specific color inside a video

megabug


Hi,


I have two videos:
1 - An animated "title" text video (letters moving around with a complex schema) with a black background.
2 - Another video taken with a camera


Using libpigment, I tried to put the video 1 over video 2 but the black background of titles is not transparent and covers the second video. If I try to change alpha value on the whole video the black will be mixed with the second video making it darker.


Is it possible to make transparent a only part of the video with a specific color (the black on the first video in my case)?


--
megabug


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Make transparent a specific color inside a video

Kapil Agrawal
Probably videobox and videomixer may fix it

-kapil

On Fri, Oct 30, 2009 at 4:55 PM, megabug <[hidden email]> wrote:


Hi,


I have two videos:
1 - An animated "title" text video (letters moving around with a complex schema) with a black background.
2 - Another video taken with a camera


Using libpigment, I tried to put the video 1 over video 2 but the black background of titles is not transparent and covers the second video. If I try to change alpha value on the whole video the black will be mixed with the second video making it darker.


Is it possible to make transparent a only part of the video with a specific color (the black on the first video in my case)?


--
megabug

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
http://www.linkedin.com/in/kapilagrawal

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Make transparent a specific color inside a video

megabug
On Friday 30 October 2009 12:59:17 Kapil Agrawal wrote:
> Probably videobox and videomixer may fix it
>
> -kapil


No, as I stated before in my email, changing the whole frame alpha value is not useful in my case.


Anyway I managed to find the solution myself: the "alpha" plugin works and provides a chroma-key feature that is exacly what I needed.


Now I have another problem: PgmImageSink (in pigment library) refuses to receive a stream with Alpha channel in it.


filesrc -> decodebin -> alpha -> pgmimagesink (doesn't work)


If I put an ffmpegcolorspace, the pipeline runs successfully but the alpha channel is filtered.


filesrc -> decodebin -> alpha -> ffmpegcolorspace -> pgmimagesink
(works but ffmpegcolorspace removes the alpha channel)


Even using capsfilter to force a colorspace with alpha channel won't work.
I think that the problem is in pgmimagesink, but any suggestions are welcome!


Bye
--
megabug


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Make transparent a specific color inside a video

Jan Schmidt-6
In reply to this post by megabug
On Fri, 2009-10-30 at 12:25 +0100, megabug wrote:

>
> Hi,
>
>
>
> I have two videos:
> 1 - An animated "title" text video (letters moving around with a
> complex schema) with a black background.
> 2 - Another video taken with a camera
>
>
>
> Using libpigment, I tried to put the video 1 over video 2 but the
> black background of titles is not transparent and covers the second
> video. If I try to change alpha value on the whole video the black
> will be mixed with the second video making it darker.

You can use the 'alpha' element to perform 'green-screening',
selectively converting a given color range to transparency. It would be
better/more efficient overall to use a format for the titles that
supports an alpha channel already, however - such as PNG files.

Regards,
Jan.

>
>
>
> Is it possible to make transparent a only part of the video with a
> specific color (the black on the first video in my case)?
>
>
>
> --
> megabug
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


--
Jan Schmidt <[hidden email]>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

videomixer

palani-3
Hi,

I tried the following command:
gst-launch rtspsrc location=rtsp://IP/test.mp4 ! rtph264depay !
mfw_vpudecoder ! videobox ! videomixer ! videobox ! mfw_v4lsink

I am getting the following errors.

(gst-launch-0.10:1883): GStreamer-CRITICAL **:
gst_mini_object_is_writable: assertion `mini_object != NULL' failed

(gst-launch-0.10:1883): GStreamer-CRITICAL **:
gst_mini_object_is_writable: assertion `mini_object != NULL' failed

(gst-launch-0.10:1883): GStreamer-CRITICAL **:
gst_mini_object_is_writable: assertion `mini_object != NULL' failed

(gst-launch-0.10:1883): GStreamer-CRITICAL **:
gst_mini_object_is_writable: assertion `mini_object != NULL' failed

If I try without videomixer, I did not get this error and video plays
properly.

Can anyone help me?

Regards,
Palanivel



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: videomixer

Stefan Sauer
[hidden email] schrieb:

> Hi,
>
> I tried the following command:
> gst-launch rtspsrc location=rtsp://IP/test.mp4 ! rtph264depay !
> mfw_vpudecoder ! videobox ! videomixer ! videobox ! mfw_v4lsink
>
> I am getting the following errors.
>
> (gst-launch-0.10:1883): GStreamer-CRITICAL **:
> gst_mini_object_is_writable: assertion `mini_object != NULL' failed
>
> (gst-launch-0.10:1883): GStreamer-CRITICAL **:
> gst_mini_object_is_writable: assertion `mini_object != NULL' failed
>
> (gst-launch-0.10:1883): GStreamer-CRITICAL **:
> gst_mini_object_is_writable: assertion `mini_object != NULL' failed
>
> (gst-launch-0.10:1883): GStreamer-CRITICAL **:
> gst_mini_object_is_writable: assertion `mini_object != NULL' failed
>
> If I try without videomixer, I did not get this error and video plays
> properly.
>
> Can anyone help me?
>  
G_DEBUG="fatal_warnings" gdb --args gst-launch rtspsrc
location=rtsp://IP/test.mp4 ! rtph264depay ! mfw_vpudecoder ! videobox !
videomixer ! videobox ! mfw_v4lsink

inside gdb "run" and when it breaks "bt", then you got a backtrace and
can make a fix.

Stefan

> Regards,
> Palanivel
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel