gstreamer/gst/videomixer
Lane Brooks 69b5aedc58 videomixer2: Add transparent background option for alpha channel formats
This option allows the videomixer2 element to output a valid alpha
channel when the inputs contain a valid alpha channel. This allows
mixing to occur in multiple stages serially.

The following pipeline shows an example of such a pipeline:

gst-launch videotestsrc background-color=0x000000 pattern=ball ! video/x-raw-yuv,format=\(fourcc\)AYUV ! videomixer2 background=transparent name=mix1 ! videomixer2 name=mix2 ! ffmpegcolorspace ! autovideosink  videotestsrc ! video/x-raw-yuv,format=\(fourcc\)AYUV ! mix2.

The first videotestsrc in this pipeline creates a moving ball on a
transparent background. It is then passed to the first videomixer2.
Previously, this videomixer2 would have forced the alpha channel to
1.0 and given a background of checker, black, or white to the
stream. With this patch, however, you can now specify the background
as transparent, and the alpha channel of the input will be
preserved. This allows for further mixing downstream, as is shown in
the above pipeline where the a second videomixer2 is used to mix in a
background of an smpte videotestsrc. So the result is a ball hovering
over the smpte test source. This could, of course, have been
accomplished with a single mixer element, but staged mixing is useful
when it is not convenient to mix all video at once (e.g. a pipeline
where a foreground and background bin exist and are mixed at the final
output, but the foreground bin needs an internal mixer to create
transitions between clips).

Fixes bug #639994.
2011-04-01 11:35:26 +02:00
..
blend.c videomixer2: Add transparent background option for alpha channel formats 2011-04-01 11:35:26 +02:00
blend.h videomixer2: Add transparent background option for alpha channel formats 2011-04-01 11:35:26 +02:00
blendorc-dist.c Update generated orc code 2010-10-15 14:02:57 -07:00
blendorc-dist.h Update generated orc code 2010-10-15 14:02:57 -07:00
blendorc.orc videomixer2: Add transparent background option for alpha channel formats 2011-04-01 11:35:26 +02:00
gstcollectpads2.c videomixer2: Add videomixer2 element 2010-09-04 14:52:11 +02:00
gstcollectpads2.h videomixer2: Add videomixer2 element 2010-09-04 14:52:11 +02:00
Makefile.am videomixer2: Add documentation and add to the docs 2010-09-04 14:55:43 +02:00
README A plugin to add an alpha channel to I420 video. Can optionally do chroma keying. 2004-05-28 18:01:34 +00:00
videomixer.c Revert "Check that collectpads exists before removing pad" 2011-02-21 12:25:19 +01:00
videomixer.h videomixer: Move debug categories into the source files and add debug category for the blend functions 2010-08-04 19:43:08 +02:00
videomixer.vcproj more working plugins 2004-07-27 21:41:30 +00:00
videomixer2.c videomixer2: Add transparent background option for alpha channel formats 2011-04-01 11:35:26 +02:00
videomixer2.h videomixer2: Add transparent background option for alpha channel formats 2011-04-01 11:35:26 +02:00
videomixer2pad.h videomixer2: Add documentation and add to the docs 2010-09-04 14:55:43 +02:00
videomixerpad.h videomixer: Don't mix input with different pixel aspect ratios 2010-06-01 11:21:29 +02:00

Video Mixer
-----------

A generice video mixer, it blends the ayuv buffers from all pads onto 
a new buffer. The new buffer has by default a checkerboard pattern but
its color can be changed with a property.
The mixer can mix streams with different framerates and video sizes. It
uses the duration value of the buffer to schedule the rendering of the
buffers. For streams with a different resoltion than the final output
resolution one can specify the position of the top left corner where this
image should be placed with the pad properties xpos and ypos.
The overall alpha value of a stream can also be specified with a pad
property.
By default, the streams are blended in the order that the pads were 
requested from the element. This can be overridden by changing the 
zorder pad property of the stream, a stream with lower zorder gets
drawn first.


TODO
----

- really implement zorder
- take I420 yuv as well
- output AYUV if possible.
- implement different blend modes, some code is already done
- use filter caps on srcpad to decide on the final output size