[gst-devel] UDP audio streaming issue
Nick Humphries
nick at egyptus.co.uk
Thu Jun 26 13:22:44 CEST 2008
Hi,
I'm trying to write a client that will listen to multiple MP3 streams that's
streamed across multiple UDP addresses, and will then separate out the two
stereo channels, amplify each one to an individual setting, before mixing each
mono channel into a single mono stream to play out.
This works:
gst-launch udpsrc multicast-group=227.0.0.10 port=3333 ! mad !
audioconvert ! deinterleave name=d0 d0.src0 ! audioconvert ! audioamplify
amplification=3.36 \
! adder name=mix1 ! audioconvert ! alsasink sync=false \
udpsrc multicast-group=227.0.0.10 port=3333 ! mad ! audioconvert ! deinterleave
name=d1 d1.src1 ! audioconvert ! audioamplify amplification=1 ! mix1.
So you see what I'm doing - the left-hand stereo channel gets amplified 3.36x,
the right is amplified 1x, and then they're mixed together and played back as a
mono stream.
One of the requirements is that it has to be able to mix many MP3 streams in
this way, with each MP3 stream played back on a different UDP address, and
sometimes there's no UDP data being produced on those addresses.
So, in this example, 227.0.0.10:3333 is producing data, but 227.0.0.11:3333 is
not:
gst-launch udpsrc multicast-group=227.0.0.10 port=3333 ! mad ! audioconvert !
deinterleave name=d0 d0.src0 ! audioconvert ! audioamplify amplification=3.36 \
! adder name=mix1 ! adder name=mix2 ! audioconvert ! alsasink sync=false \
udpsrc multicast-group=227.0.0.10 port=3333 ! mad ! audioconvert ! deinterleave
name=d1 d1.src1 ! audioconvert ! audioamplify amplification=1 ! mix1. \
udpsrc multicast-group=227.0.0.11 port=3333 ! mad ! audioconvert ! deinterleave
name=d2 d2.src0 ! audioconvert ! audioamplify amplification=1 ! mix2.
I get no sound played back when I run this
Running gst-launch with the -v option gives this output:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/pipeline0/mad0.src: caps = audio/x-raw-int, endianness=(int)1234,
signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)16000,
channels=(int)2
/pipeline0/mad0.src: caps = audio/x-raw-int, endianness=(int)1234,
signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)16000,
channels=(int)2
/pipeline0/audioconvert0.src: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)2, endianness=(int)1234, width=(int)32
/pipeline0/audioconvert0.src: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)2, endianness=(int)1234, width=(int)32
/pipeline0/audioconvert0.sink: caps = audio/x-raw-int, endianness=(int)1234,
signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)16000,
channels=(int)2
/pipeline0/d1.sink: caps = audio/x-raw-float, rate=(int)16000, channels=(int)2,
endianness=(int)1234, width=(int)32
/pipeline0/d0.sink: caps = audio/x-raw-float, rate=(int)16000, channels=(int)2,
endianness=(int)1234, width=(int)32
/pipeline0/audioconvert4.src: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)1, endianness=(int)1234, width=(int)32
/pipeline0/audioconvert4.sink: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)1, endianness=(int)1234, width=(int)32
/pipeline0/audioconvert1.src: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)1, endianness=(int)1234, width=(int)32
/pipeline0/audioconvert1.sink: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)1, endianness=(int)1234, width=(int)32
/pipeline0/audioamplify1.src: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)1, endianness=(int)1234, width=(int)32
/pipeline0/audioamplify1.sink: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)1, endianness=(int)1234, width=(int)32
/pipeline0/audioamplify0.src: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)1, endianness=(int)1234, width=(int)32
/pipeline0/audioamplify0.sink: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)1, endianness=(int)1234, width=(int)32
/pipeline0/mix1.sink1: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)1, endianness=(int)1234, width=(int)32
/pipeline0/mix2.sink1: caps = audio/x-raw-float, rate=(int)16000,
channels=(int)1, endianness=(int)1234, width=(int)32
... where it then appears to not do anything, so I CTRL-C it, and this appears
next:
Caught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 2597964000 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
/pipeline0/mix2.sink1: caps = NULL
/pipeline0/mix2.sink0: caps = NULL
/pipeline0/mix2.src: caps = NULL
/pipeline0/mix1.sink1: caps = NULL
/pipeline0/mix1.sink0: caps = NULL
/pipeline0/mix1.src: caps = NULL
/pipeline0/audioamplify1.src: caps = NULL
/pipeline0/audioamplify1.sink: caps = NULL
/pipeline0/audioamplify0.src: caps = NULL
/pipeline0/audioamplify0.sink: caps = NULL
/pipeline0/audioconvert4.src: caps = NULL
/pipeline0/audioconvert4.sink: caps = NULL
/pipeline0/audioconvert1.src: caps = NULL
/pipeline0/audioconvert1.sink: caps = NULL
/pipeline0/d1.sink: caps = NULL
/pipeline0/d0.sink: caps = NULL
/pipeline0/audioconvert3.src: caps = NULL
/pipeline0/audioconvert3.sink: caps = NULL
/pipeline0/audioconvert0.src: caps = NULL
/pipeline0/audioconvert0.sink: caps = NULL
/pipeline0/mad1.src: caps = NULL
/pipeline0/mad0.src: caps = NULL
Setting pipeline to NULL ...
FREEING pipeline ...
Is there anything obvious that I'm not doing?
Any help is gratefully appreciated,
Nick
More information about the gstreamer-devel
mailing list