I've been trying to figure out GStreamer for "audio only" for a couple of days now, but with different instructions between 1.0 and 0.10, and most instructions are to do with video, I'm having difficulty understanding how it all fits together and talks over a network (same subnet range). Most examples also seem to want to send audio to a destination instead of waiting for something to connect to it, and I don't think this is what I need.
Basically, I am using the BlueIris camera recording system which talks to IP cameras. Unfortunately, my cameras do not have microphones so I would like to use a spare RaspberryPI with a USB microphone to serve the audio, and BlueIris will connect to it to get the audio. Apparently I can specify alternate audio sources with an rtsp or other streaming source.
The cameras are working great, so gstreamer will just be my audio source.
So my progress so far:
I have figured out how to play audio from the USB microphone to the speakers using:
gst-launch-1.0 alsasrc device=hw:1 ! audioconvert ! autoaudiosink
This is working great.
Then I tried setting up a TCP Sever session to wait for something to connect to it:
gst-launch-1.0 alsasrc device=hw:1 ! audioconvert ! audioresample ! speexenc ! rtpspeexpay ! tcpserversink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstAudioSrcClock
Redistribute latency...
Redistribute latency...
(The server seems to start up without problems.)
And then have a client connect:
gst-launch-1.0 tcpclientsrc ! speexdec ! autoaudiosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstTCPClientSrc:tcpclientsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstTCPClientSrc:tcpclientsrc0:
streaming task paused, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
...and that's a big NOPE!
So I'm hoping for testing that I can go to my Windows machine and start up VLC and try to connect to the Raspberry PI with something like rtsp://192.168.0.123 but this is where it all gets fuzzy, especially when I can't even get gstreamer to connect to itself on the same box.
Can someone please help?
GST_DEBUG=4 gst-launch-1.0 ...
to debug whats happening.. now you payloaded the stream with rtp so on the reciever you need to depayload with rtp element.. its always symetrical on the server and client side (well of course on client its in a opposite direction than on server), try addingrtpspeexdepay
before speexdec.. when you have some progress write me a comment if you wish – nayanagst-launch-1.0 alsasrc device=hw:1,0 ! mulawenc ! rtppcmupay ! udpsink host=224.1.1.1 auto-multicast=true port=5000
So as you can see I went for the multicast approach. I'm on a small private network anyway. This way I can have my camera recording application record the audio, and I can even load up VLC on my Windows PC and listen in directly by going tortp://224.1.1.1:5000
and it works! – Jon Thurgood