How to name a Gstreamer element which is assigned to property of another one?

Given that I have this GStreamer pipeline:

v4l2src name=webcam ! glsinkbin sink=gtkglsink name=sink_bin

How can I set name for gtkglsink?

You should be able to just use a valid gst-launch line as a value the sink property :slight_smile:

So this should work:

gst-launch-1.0 v4l2src name=webcam ! glsinkbin sink="gtkglsink name=my_sink" name=sink_bin

Thank you. I wish this example were added to GStreamer documentation.

Why do you want to set a name to the gtkglsink? You can get it directly from the sink property if needed.

That would need some rationale why one would want to do that, but also setting name and other properties works exactly the same as everywhere else in the pipeline strings :slight_smile:

If you have a suggestion for a documentation improvement, please send a MR.

1 Like

Because I want to get that sink element from the Gtk.Pipeline object.

The use case is that, I want to embed the sink to an area of a Gtk.Window. With a pipeline (without name) like this:

v4l2src name=webcam ! glsinkbin sink=gtkglsink name=sink_bin

I have to go from pipeline, getting the glsinkbin via its name, then access to sink property. It is longer than:

pipeline.get_by_name('my_sink')

Here is my concrete use:

That’s true, but it would also give you some other element if there were multiple with the same name somewhere inside the pipeline hierarchy.

I think it can be solved easily by defining my own naming scheme, like quan_gtksink, quan_videosink.

That’s true. Whatever works for you, I guess :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.