1
votes

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?

1
+1 its good to see someone really trying out before asking question :) now.. dont worry you are very near of your solution.. first thing to give you some knowledge: use 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 adding rtpspeexdepay before speexdec.. when you have some progress write me a comment if you wishnayana
Thank you so much @otopolsky for replying. I've been trying many things since (and some RPI problems), and I finally found something that worked. Here is my final command-line: gst-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 to rtp://224.1.1.1:5000 and it works!Jon Thurgood
perfect, you may add your own answer and accept it as correct one - it will help others, glad to hear that you solved it after all the struggle :)nayana

1 Answers

1
votes

This did it for me:

gst-launch-1.0 alsasrc device=hw:1,0 ! mulawenc ! rtppcmupay ! udpsink host=224.1.1.1 auto-multicast=true port=5000

Now VLC works going to rtp://224.1.1.1:5000 and has the correct codec that I wanted.

On to the next problem...