Merging pipelines

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

Merging pipelines

JPM
Hi,

I have two pipelines with differents sources and sinks :

gst_parse_launch("source1 ..... sink1", &error)
gst_parse_launch("source2 ..... sink2", &error)

Is it possible to merge both pipelines in only one gst_parse_launch() ?

Regards.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Merging pipelines

Tim Müller
On Fri, 2019-06-21 at 06:51 -0500, JPM wrote:

Hi,

> I have two pipelines with differents sources and sinks :
>
> gst_parse_launch("source1 ..... sink1", &error)
> gst_parse_launch("source2 ..... sink2", &error)
>
> Is it possible to merge both pipelines in only one gst_parse_launch()
> ?

You should be able to just pass a string like:

  "src1 ! .. ! sink1    src2 ! ... ! sink2"

Alternatively you could use gst_parse_bin_from_description() and then
put those two bins into the same pipeline.

Cheers
  Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
JPM
Reply | Threaded
Open this post in threaded view
|

Re: Merging pipelines

JPM
Hi,

"src1 ! .. ! sink1    src2 ! ... ! sink2" does not work and if I use
gst_parse_bin_from_description
gst_parse_launch does not recognize bin1 and bin2 elements.

GstElement *bin1 = gst_parse_bin_from_description("udpsrc
multicast-group=224.1.1.1 auto-multicast=true port=6000 !
image/jpeg,width=1280,height=720,framerate=31/1 ! jpegparse ! queue !
decodebin ! autovideosink sync=false", TRUE, NULL);

GstElement *bin2 = gst_parse_bin_from_description("udpsrc
multicast-group=224.1.1.2 auto-multicast=true port=6000 !
audio/x-raw,format=S16LE,rate=48000,channels=1 ! volume volume=10 ! \
audioconvert ! autoaudiosink sync=false", TRUE, NULL);

GstElement *pipeline = gst_parse_launch("bin1 bin2", &error);

Regards.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Merging pipelines

Tim Müller
Hi,

> "src1 ! .. ! sink1    src2 ! ... ! sink2" does not work

Could you be more specific? How does it "not work"? Do you get an error
or ..?

Have you tried it in gst-launch-1.0 as well?

This works just fine for example:

 gst-launch-1.0 videotestsrc ! autovideosink  videotestsrc !
autovideosink


> and if I use
> gst_parse_bin_from_description
> gst_parse_launch does not recognize bin1 and bin2 elements.
>
> GstElement *bin1 = gst_parse_bin_from_description("udpsrc
> multicast-group=224.1.1.1 auto-multicast=true port=6000 !
> image/jpeg,width=1280,height=720,framerate=31/1 ! jpegparse ! queue !
> decodebin ! autovideosink sync=false", TRUE, NULL);
>
> GstElement *bin2 = gst_parse_bin_from_description("udpsrc
> multicast-group=224.1.1.2 auto-multicast=true port=6000 !
> audio/x-raw,format=S16LE,rate=48000,channels=1 ! volume volume=10 ! \
> audioconvert ! autoaudiosink sync=false", TRUE, NULL);
>
> GstElement *pipeline = gst_parse_launch("bin1 bin2", &error);

Yeah, that's because you're cargo culting and making things up here :)

What I meant was that you could do something like:

  pipeline = gst_pipeline_new("my-pipeline");

  gst_bin_add (GST_BIN (pipeline), bin1);
  gst_bin_add (GST_BIN (pipeline), bin2);

Cheers
 Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
JPM
Reply | Threaded
Open this post in threaded view
|

Re: Merging pipelines

JPM
Hi,

You are right,  "src1 ! .. ! sink1    src2 ! ... ! sink2" works fine.

My second pipeline was wrong.

Thanks.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel