Problem with mix live audio stream

Douglas Amorim Ferreira douglaseel at gmail.com
Mon Sep 15 12:08:34 PDT 2014


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?

Thanks in advance!

-- 
*Douglas Amorim Ferreira*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140915/528350cc/attachment.html>


More information about the gstreamer-devel mailing list