After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762809 - alpha: Sample pipeline does not demonstrate functionality
alpha: Sample pipeline does not demonstrate functionality
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.7.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-28 01:28 UTC by Petr Viktorin
Modified: 2016-02-28 16:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
reorder elements in the sample pipeline (1.02 KB, patch)
2016-02-28 10:31 UTC, Petr Viktorin
none Details | Review
Fix sample pipeline using the zorder pad property (1.15 KB, patch)
2016-02-28 14:29 UTC, Petr Viktorin
none Details | Review
Fix sample pipeline using the zorder and explicit names (1.29 KB, patch)
2016-02-28 15:00 UTC, Petr Viktorin
committed Details | Review

Description Petr Viktorin 2016-02-28 01:28:14 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.
Comment 1 Sebastian Dröge (slomo) 2016-02-28 08:18:13 UTC
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?
Comment 2 Petr Viktorin 2016-02-28 10:31:03 UTC
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.
Comment 3 Nicolas Dufresne (ndufresne) 2016-02-28 13:28:55 UTC
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.
Comment 4 Petr Viktorin 2016-02-28 14:29:40 UTC
Created attachment 322579 [details] [review]
Fix sample pipeline using the zorder pad property

Thanks! Here is a patch using the zorder pad property.
Comment 5 Nicolas Dufresne (ndufresne) 2016-02-28 14:38:10 UTC
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.
Comment 6 Petr Viktorin 2016-02-28 15:00:56 UTC
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.
Comment 7 Nicolas Dufresne (ndufresne) 2016-02-28 16:48:12 UTC
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.
Comment 8 Nicolas Dufresne (ndufresne) 2016-02-28 16:56:28 UTC
Note, replacing with compositor gives the same result for me here.