mindracer
Posts: 8
Joined: Sat Mar 02, 2013 12:43 am

Real-time streaming mic audio, ffmpeg ssh and persistently?

Sat Mar 02, 2013 1:04 am

Goal: Stream microphone input (using Daffodil USB sound) 24/7 to another box, using ffmpeg (ad even ssh if possible without ffserver (shows to lag alot)

Tutorial which has guided me so far: http://ubuntuforums.org/showthread.php?t=1544946

- I'm not clear how the RTP part works as i tried connecting with vlc from another box and it didn't work.
- I'd like for my Raspberry Pi to transmit audio to another box which will play it live on i's audio out
- Preferably my raspberry would be initiating the connection automatically when eth0 is up, instead of the reverse typical situation where i client connects to a radio station for example.
- Re-connects if internet/power drops.
- Also, is it possible to do this over SSH? (and have the SSH reconnect too?)

So i have ffmpeg and openssh installed on my raspberry, what would I need on the other box aside from OpenSSH to play live to sound card and persistently using what commands?

The ffmpeg part i found resembles this:
ffmpeg -f oss -i /dev/dsp -acodec libmp3lame -ab 32k -ac 1 -re -f rtp rtp://234.5.5.5:1234
but im still not sure how the RTP works exactly. The commands works, but dont know how to connect and from where.

Using this comand (from this tutorial http://mutsuda.com/2012/09/07/raspberry ... ng-device/):
arecord -D plughw:1,0 -f dat | ssh -C user@remoteip aplay -f dat

I was able to play the live audio through SSH, but the audio was choppy and cracking a bit (i know theres issues, i have to correct that).

So basically i want to combine those two commands and do it over a SSH tunnel, and put safeguards for it to reconnect when it goes down. Sorry I wish i had structured this better.

Awaiting a ffmpeg/ssh god to show me the way (exactly preferably) hehe

apoth
Posts: 13
Joined: Mon Jul 30, 2012 12:37 pm

Re: Real-time streaming mic audio, ffmpeg ssh and persistent

Sun Mar 24, 2013 8:14 am

The ffmpeg part i found resembles this:
ffmpeg -f oss -i /dev/dsp -acodec libmp3lame -ab 32k -ac 1 -re -f rtp rtp://234.5.5.5:1234
but im still not sure how the RTP works exactly. The commands works, but dont know how to connect and from where.
The 234.x.x.x is a multicast IP address - feel free to read up on that.

The key thing though is just to run the command, then on a client machine open up something like VLC, choose to open a network stream, choose rtp, multicast and enter the 234.x.x.x IP with the 1234 port. Hopefully that just works.

Return to “General discussion”