Mixing different sources from network even if one doesn't exist anymore

Nicolas Dufresne nicolas at ndufresne.ca
Thu Apr 11 15:40:47 UTC 2019


Le jeudi 11 avril 2019 à 16:46 +0200, Jack a écrit :
> Thanks Nicolas for the different hints with audiomixer, but what will
> happen (for the pipeline) if the source of the stream doesn't exist or
> the URI is wrong. For exemple if I open the URI with URIdecodebin ? Will
> Gtreamer return an error and exit ?
> I need your enlightment here.

URIDecodebin (or internal elements) will post an error message to the
application and no pad will be added. Your app would have to handle
that and cleanup the broken element from the pipeline, even though your
pipeline will keep working (unless you kill the pipeline on error like
gst-launch do). The audiomixer will only start producing when first pad
is activated and have data though. The timeout base feature will only
be activated if one of the source is actually detected to be live. So
be careful if you wanted to use an URI to some HTTP files, as it might
not be live and might not do what you want. You need at least one live
source to trigger the timeout based feature.

> ++
> 
> Jack
> 
> 
> 
> Le 11/04/2019 à 14:57, Nicolas Dufresne a écrit :
> > 
> > Le jeu. 11 avr. 2019 05 h 10, Jack <jack at rybn.org
> > <mailto:jack at rybn.org>> a écrit :
> > 
> >     Hello,
> > 
> >     I would like to mix different audio sources coming from internet (from
> >     different Icecast server). But, I would like the mix continue even if a
> >     stream doesn't exist anymore (so the pipeline doesn't return an error
> >     and exit).
> >     What is the best practice to achieve that ?
> > 
> > 
> > The audiomixer element can do that. You have to configure a latency (see
> > property of the same name, in nanosecond). This latency will allow a bit
> > of delay between streams. If a stream goes missing, the timeout will be
> > reached, and only available streams will be mixed. If they are all gone,
> > silent buffers will be produced. If you have a mean to detect idle
> > stream, be aware that performance is slightly improved if you remove the
> > requested pad, as it may no longer have to wait for the timeout to mix.
> > 
> >     Thanx.
> >     ++
> > 
> >     Jack
> > 
> >     _______________________________________________
> >     gstreamer-devel mailing list
> >     gstreamer-devel at lists.freedesktop.org
> >     <mailto:gstreamer-devel at lists.freedesktop.org>
> >     https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > 
> > 
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > 
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190411/e83c7817/attachment.sig>


More information about the gstreamer-devel mailing list