0

I am currently using picam software to stream audio and video from Raspberry Pi using a NOIR camera and a microphone. One way audio and video is working fine. I need a two way audio connection but picam only establishes one way . Any ideas on how to establish two way audio without disturbing the video streaming that is happening?

  • It's not particularly normal for audio streams to run in duplex mode. The simplest approach is to set up a brand new audio stream originating from the machine currently receiving your audio/video stream. If you've already got a working picam command string it shouldn't be too complicated to yank bits out of it for running audio only. – goobering Apr 2 '17 at 11:56
  • Thanks.Yeah it looks like simplest set up is to start a new stream from the machine currently receive audio. – Apoorv Apr 7 '17 at 10:40
0

If you want to live stream audio from a transmitter to a receiver, then you can use avtools. You can also use avtools to stream your video+audio.

The simplest approach is to use rtp (real time protocol). One example is to use ffmpeg or avconv like so ...

First install avtools from the command line (open a terminal and type the following) :

sudo apt-get install libav-tools 

Next, we have to create the rtp stream on the transmitter, which needs to know the receiver's IP address so that it can blindly stream audio data to it.

avconv -f alsa -ac 2 -ar 48000 -i hw:0,0 -acodec mp2 -f rtp rtp://targetIP:port

Here the target IP is the static IP of the receiver. You could use anything reasonable for the port, such as 1234.

To playback you need to use a player, such as VLC or other. Here is an example using avplay :

avplay -i rtp://127.0.0.1:port

So for example if your receiver has the IP address 192.168.0.10 then you would use this on the transmitter :

avconv -f alsa -ac 2 -ar 48000 -i hw:0,0 -acodec mp2 -f rtp rtp://192.168.0.10:1234

Then on the receiver you would use :

avplay -i rtp://127.0.0.1:1234

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.