Mix two asynchronous audio sources

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

Mix two asynchronous audio sources

paul.goulpie
Hello, I try to create a pipeline that contains two audio sources are mixed on a single audio output.
I realized this with the adder module.
Nominal way everything works fine:

gst-launch-1.0 \
audiotestsrc name='src1' ! adder0. \
udpsrc  name='src2' caps="application/x-rtp,payload=11,clock-rate=44100" port=4446 ! rtpL16depay ! audioconvert ! adder0. \
adder ! autoaudiosink

My problem occurs when the udp source (src2) stop its spread. This causes me a complete shutdown of all the pipeline.
Is there a way around this blockage: continue the distribution of the source when the source udp (src2) stops its distribution and resume mixing the two sources when the udp source (src2) resumed broadcasting.

Thank you for your response.
Reply | Threaded
Open this post in threaded view
|

Re: Mix two asynchronous audio sources

Stefan Sauer
On 10/07/2016 12:23 PM, paul.goulpie wrote:

> Hello, I try to create a pipeline that contains two audio sources are mixed
> on a single audio output.
> I realized this with the adder module.
> Nominal way everything works fine:
>
> gst-launch-1.0 \
> audiotestsrc name='src1' ! adder0. \
> udpsrc  name='src2' caps="application/x-rtp,payload=11,clock-rate=44100"
> port=4446 ! rtpL16depay ! audioconvert ! adder0. \
> adder ! autoaudiosink
>
> My problem occurs when the udp source (src2) stop its spread. This causes me
> a complete shutdown of all the pipeline.
> Is there a way around this blockage: continue the distribution of the source
> when the source udp (src2) stops its distribution and resume mixing the two
> sources when the udp source (src2) resumed broadcasting.
>
> Thank you for your response.
For completeness, can you also list the pipeline that feeds the
udpstream. While we also have audiomixer now in addition to adder, both
won't accept spase streams.
You could also try to add queues to buffer on the udp branch to cover
for some discontinuities.

As a last resort you can handle the udp failure and disconnect/reconnect
that branch.

Stefan
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Mix-two-asynchronous-audio-sources-tp4679989.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



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

Re: Mix two asynchronous audio sources

Mailing List SVR
In reply to this post by paul.goulpie
Il 07/10/2016 12:23, paul.goulpie ha scritto:

> Hello, I try to create a pipeline that contains two audio sources are mixed
> on a single audio output.
> I realized this with the adder module.
> Nominal way everything works fine:
>
> gst-launch-1.0 \
> audiotestsrc name='src1' ! adder0. \
> udpsrc  name='src2' caps="application/x-rtp,payload=11,clock-rate=44100"
> port=4446 ! rtpL16depay ! audioconvert ! adder0. \
> adder ! autoaudiosink
>
> My problem occurs when the udp source (src2) stop its spread. This causes me
> a complete shutdown of all the pipeline.
> Is there a way around this blockage: continue the distribution of the source
> when the source udp (src2) stops its distribution and resume mixing the two
> sources when the udp source (src2) resumed broadcasting.

you can try interaudiosink/src, somethink like:

udpsrc ! interaudiosink

interaudiosrc ! rtpL16depay

when udpsrc error out you should get silence and you can try to restart
the first pipeline periodically,

You could use a similar approach with appsink/src too but in this case
you have to push silence buffers yourself,

Nicola

>
> Thank you for your response.
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Mix-two-asynchronous-audio-sources-tp4679989.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Mix two asynchronous audio sources

Mailing List SVR
Il 07/10/2016 16:41, Mailing List SVR ha scritto:

> Il 07/10/2016 12:23, paul.goulpie ha scritto:
>> Hello, I try to create a pipeline that contains two audio sources are
>> mixed
>> on a single audio output.
>> I realized this with the adder module.
>> Nominal way everything works fine:
>>
>> gst-launch-1.0 \
>> audiotestsrc name='src1' ! adder0. \
>> udpsrc  name='src2' caps="application/x-rtp,payload=11,clock-rate=44100"
>> port=4446 ! rtpL16depay ! audioconvert ! adder0. \
>> adder ! autoaudiosink
>>
>> My problem occurs when the udp source (src2) stop its spread. This
>> causes me
>> a complete shutdown of all the pipeline.
>> Is there a way around this blockage: continue the distribution of the
>> source
>> when the source udp (src2) stops its distribution and resume mixing
>> the two
>> sources when the udp source (src2) resumed broadcasting.
>
> you can try interaudiosink/src, somethink like:
>
> udpsrc ! interaudiosink
>
> interaudiosrc ! rtpL16depay

small correction:

udpsrc ! rtpL16depay ! interaudiosink

interaudiosrc ! audioconvert ....

you cannot test inter elements using gst-launch, you have to write a
gstreamer application,

Nicola

>
> when udpsrc error out you should get silence and you can try to
> restart the first pipeline periodically,
>
> You could use a similar approach with appsink/src too but in this case
> you have to push silence buffers yourself,
>
> Nicola
>
>>
>> Thank you for your response.
>>
>>
>>
>> --
>> View this message in context:
>> http://gstreamer-devel.966125.n4.nabble.com/Mix-two-asynchronous-audio-sources-tp4679989.html
>> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Mix two asynchronous audio sources

Nicolas Dufresne-4
In reply to this post by Stefan Sauer
Le vendredi 07 octobre 2016 à 15:18 +0200, Stefan Sauer a écrit :
> For completeness, can you also list the pipeline that feeds the
> udpstream. While we also have audiomixer now in addition to adder,
> both
> won't accept spase streams.
> You could also try to add queues to buffer on the udp branch to cover
> for some discontinuities.

Audiomixer should work fine with sparsed streams if your pipeline is
live (e.g. audiotestsrc is-live=1). Otherwise you'll need gap events to
be correctly placed by upstream elements.

regards,
Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel