Problem with mix live audio stream

Thiago Santos thiagoss at osg.samsung.com
Mon Sep 22 07:17:13 PDT 2014


On 09/15/2014 04:08 PM, Douglas Amorim Ferreira wrote:
> Hello,
> I need to mix two different live audio streams into one. Each of these 
> audio streams is from a rtsp-server.
> To listen just one of these audio streams, I used this pipeline:
>
> gst-launch-1.0 rtspsrc location=rtsp://ip_host:port0/audio0 
> latency=2000 ! application/x-rtp, "media=(string)audio, 
> clock-rate=(int)8000, encoding-name=(string)PCMA" ! rtppcmadepay ! 
> alawdec !  autoaudiosink
>
> And this pipeline worked fine.
> Thus, I created a pipeline to mix differents audio streams:
>
> gst-launch-1.0 rtspsrc location=rtsp://ip_host:port0/audio0 
> latency=2000 ! application/x-rtp, "media=(string)audio, 
> clock-rate=(int)8000, encoding-name=(string)PCMA" ! rtppcmadepay ! 
> alawdec ! audioresample ! liveadder name=m_pAdder ! interleave 
> name=m_pInterleave ! autoaudiosink rtspsrc 
> location=rtsp://ip_host:port1/audio1 latency=2000 ! application/x-rtp, 
> "media=(string)audio, clock-rate=(int)8000, 
> encoding-name=(string)PCMA" ! rtppcmadepay ! alawdec ! audioresample ! 
> m_pAdder.
>
> And also was good..
> Now I wanna have freedom to play any of these audio in any channel 
> (left and right), with the possibility to reconfigure in real time.
> Ok, I think the first step is convert a single mono audio stream in a 
> stereo one. And I do it:
>
> gst-launch-1.0 interleave name=m_pInterleave ! autoaudiosink rtspsrc 
> location=rtsp://ip_host:port0/audio0 latency=2000 ! application/x-rtp, 
> "media=(string)audio, clock-rate=(int)8000, 
> encoding-name=(string)PCMA" ! rtppcmadepay ! alawdec ! audioconvert ! 
> "audio/x-raw, channels=2" ! deinterleave name=m_pAudio0 
> m_pAudio0.src_0 ! queue ! m_pInterleave.sink_0 m_pAudio0.src_1 ! queue 
> ! m_pInterleave.sink_1
>
> Works! Now, I just mix two stereo streams (mix left channel0 with left 
> channel1 and right with right). The pipeline is:
>
> gst-launch-1.0 interleave name=m_pInterleave ! autoaudiosink rtspsrc 
> location=rtsp://ip_host:port0/audio0 latency=2000 ! application/x-rtp, 
> "media=(string)audio, clock-rate=(int)8000, 
> encoding-name=(string)PCMA" ! rtppcmadepay ! alawdec ! audioconvert ! 
> "audio/x-raw,channels=2" ! deinterleave name=m_pAudio0 m_pAudio0.src_0 
> ! queue ! liveadder name=m_pAdderEsq ! m_pInterleave.sink_0 rtspsrc 
> location=rtsp://ip_host:port1/audio1 latency=2000 ! application/x-rtp, 
> "media=(string)audio, clock-rate=(int)8000, 
> encoding-name=(string)PCMA" ! rtppcmadepay ! alawdec ! audioconvert ! 
> "audio/x-raw,channels=2" ! deinterleave name=m_pAudio1 m_pAudio1.src_0 
> ! queue ! m_pAdderEsq. m_pAudio0.src_1 ! queue ! liveadder 
> name=m_pAdderDir ! m_pInterleave.sink_1 m_pAudio1.src_1 ! queue ! 
> m_pAdderDir.
>
> And... I've got EOS !!!!
> Anybody know what is the problem?
> What is the mistake I made?

The pipeline looks fine. Does it fail if you replace the rtspsrc and rtp 
depayloading + decoding with audiotestsrcs?
It should be easy to track what is pushing EOS from a GST_DEBUG=6 log. 
Search for "creating new event 0x[0-9a-f]* eos" and look at the lines 
around it to find the elements that are creating the EOS event. It might 
be happening for both your rtsp sources.

You could also try using audiomixer instead of liveadder.

>
> Thanks in advance!
>
> -- 
> /Douglas Amorim Ferreira/
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


-- 
Thiago Sousa Santos
Senior Multimedia Engineer, Open Source Group
Samsung Research America - Silicon Valley

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140922/1bbb648d/attachment-0001.html>


More information about the gstreamer-devel mailing list