GNOME Bugzilla – Bug 762809
alpha: Sample pipeline does not demonstrate functionality
Last modified: 2016-02-28 16:57:25 UTC
The alpha filter's sample pipeline is: gst-launch-1.0 videotestsrc pattern=smpte75 ! alpha method=green ! \ videomixer name=mixer ! videoconvert ! autovideosink \ videotestsrc pattern=snow ! mixer. Since the snow pattern (without alpha) comes second, it covers the frame and the smpte75 pattern is not visible. The two sources should be switched: gst-launch-1.0 videotestsrc pattern=snow ! videomixer name=mixer ! \ videoconvert ! autovideosink \ videotestsrc pattern=smpte75 ! alpha method=green ! mixer.
Instead of switching the order, we should be explicit about the pad names and set the zorder of them in the mixer properly. Can you provide a patch?
Created attachment 322571 [details] [review] reorder elements in the sample pipeline Here is a patch for my initial suggestion. My reading of the docs suggests zorder is a "pad property", but I'm unable to find information on how to set it using gst-launch syntax. Videomixer's sink pads are Request pads. Again I can't find any information about how to create or reference these from the gst-launch syntax. I'm just beginning to understand gstreamer, so I would appreciate if you could hint more at the preferred solution.
Properties on pads can be set using the following syntax: ... ! compositor sink_0::prop1=value ! ... Unfortunatly, pad properties are not part of autogenerated documentation. It's a non-trivial issue.
Created attachment 322579 [details] [review] Fix sample pipeline using the zorder pad property Thanks! Here is a patch using the zorder pad property.
Review of attachment 322579 [details] [review]: Just a detail, otherwise looks better. ::: gst/alpha/gstalpha.c @@ +32,3 @@ * |[ * gst-launch-1.0 videotestsrc pattern=smpte75 ! alpha method=green ! \ + * videomixer name=mixer sink_0::zorder=1 sink_1::zorder=0 ! \ While doing so, we could change to use compositor (same API). In order to guaranty working pipeline, we should link with mixer.sink_0 and mixer.sink_1 too.
Created attachment 322586 [details] [review] Fix sample pipeline using the zorder and explicit names This version links using explicit names. (Now I see what was meant by those!) I've also put the snow effect first, to make the pipeline more straightforward to read. By "compositor", do you mean the element from gstreamer-plugins-bad? Is it better in some way? I tried simply swapping "compositor" for "videomixer", but that showed a black bar instead of the snow.
Hmm, replacing with compositor should have had no side effect. Let's merge this, we'll file a new bug for that new issue. Thanks for this change btw.
Note, replacing with compositor gives the same result for me here.