What the best way for mix two streams, when they may start/stop independent from each other

Carl Karsten carl at nextdayvideo.com
Mon Nov 21 17:23:34 UTC 2016


quick answer:   https://github.com/voc/voctomix#contact

Watch the 2 videos.

If I understand your question, it isn't an easy problem



On Mon, Nov 21, 2016 at 10:46 AM, Dmitry Valento <va.dimon at tut.by> wrote:

> Hello
> I couldn’t find out the easiest way for control mixing of two streams.
> Pipeline looks like:
>
> In most cases, audio flows from audiotestsrc and WAV-files are played
> periodically.
> There are three major moments during the pipeline work:
> 1) start wav-file playing when audiotestsrc is already running
> 2) stop wav-file playing manually
> 3) normal wav-file playing finishing (EOS)
> 4) play another wav-file when previous file isn’t finished yet
>
> I’ve already implemented next logic:
> 0) on application start-up all elements are created, but elements related
> to
> WAV-playing aren’t added to BIN
> 1) upon request of start wav-file playing, elements related to WAV-playing
> are added to BIN, linked with each other, probe is added to sink_1 (element
> adder) for catch EOS
> 2) on manual stop, filesrc is set to NULL state, elements related to
> WAV-playing are moved outside BIN (not removed completely), pad sink_1 is
> removed (element adder)
> 3) on EOS, the probe is removed from sink_1 and a EOS message sent to BUS -
> in another procedure (seems like in another thread) the message is caught
> and the step 2 is started
> 4) on start playing another file when a previous isn’t finished yet, the
> filesrc is set to NULL state, location is changed and finally filesrc is
> set
> to PLAYING state.
>
> Advantages of this logic: settings of audiodynamic and equalizer (and
> another filters) aren’t lost.
> Disadvantages: it needs to store in private struct pointers to elements
> related to WAV-playing and it needs to move these elements to/outside BIN
> and relink all pads.
>
> I suppose, there is should be more elegant solution for realize these
> requirements, but I don’t know how. May be it is possible to create some
> “fake” source element which will replace filesrc when wav-files aren’t
> played. I’ve tried to use fakesrc element, but couldn’t find out how to
> configure it properly.
> Could you please give me suggestions about how to make logic more elegant?
>
> Thank you.
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.
> n4.nabble.com/What-the-best-way-for-mix-two-streams-when-
> they-may-start-stop-independent-from-each-other-tp4680810.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161121/fd71834f/attachment.html>


More information about the gstreamer-devel mailing list