BabyMonitor - broadcast mic audio via network

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

BabyMonitor - broadcast mic audio via network

#1 Post by greengeek »

I wanted to use Puppy to send an audio stream from one laptop to another across my home network so that I could use it as a baby monitor.

This means that the microphone in one laptop will send the stream to be played through the speakers in the second laptop (Edit: or multiple computers - not just one).
(I am hoping I might eventually be able to extend this to be usable as an audio/PA system for a party).
I guess you could also use this as a "bug" to find out what your kids are saying about you.
Edit: Or you could use it to broadcast your own radio station in your home or workplace.


Notes:
- you will need both PCs to be connected to your home router (Mine is a wireless connection)
- the router will (in theory) keep the audio transmissions within your home network. This babymonitor does not require use of the internet.
- The commands below work correctly with the default microphone on my machine (and many others). If it doesn't work for you it should be simple to adjust the command to access the correct soundcard/mic

Here is how to do it:

1) Turn off the firewall on both machines (don't worry - your router will still have a functional firewall between you and the internet)

2) On the "Sender" machine (in the babies room) open a terminal and type the following:

Code: Select all

ffmpeg -re -f alsa -i hw:0,0 -acodec mp2 -f rtp rtp://234.5.5.5:4444
3) On the "Receiver" machine (the one you are typing your homework on in the lounge) open a terminal and type the following:

Code: Select all

ffplay rtp://234.5.5.5:4444
EDIT : I forgot to mention that this was tested on my Slacko 5.6 derivative but I expect it should work on a lot of different pups.

As shown in the last couple of lines of this terminal screenshot you can use the "q" key to stop the transmission.
.
Attachments
Sender.jpg
(94.71 KiB) Downloaded 415 times
Last edited by greengeek on Thu 03 Mar 2016, 06:19, edited 1 time in total.

gcmartin

#2 Post by gcmartin »

Nice example for streaming audio from one PC over the LAN to another. THX @GreenGeek!

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#3 Post by Ted Dog »

Cool if you have a camera then a vlc in server mode would stream both audio and video. If you can only get software to change them and feed them you would never have to spend any time with them.. :twisted:

partsman
Posts: 363
Joined: Wed 06 Jun 2012, 19:00
Location: OHIO,USA

#4 Post by partsman »

Pretty Cool greengeek :)

Thanks for sharing ! :wink:
I now am wondering if Ted Dog's answer would work ?
Anyone done this with video too ?
[color=red]Anyone can build a fast processor. The trick is to build a fast system. (Seymour Cray)[/color] :wink:

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#5 Post by greengeek »

Ted Dog wrote:If you can only get software to change them and feed them you would never have to spend any time with them.. :twisted:
Amen. Lookin' forward to it... :-)
if you have a camera then a vlc in server mode would stream both audio and video.
It appears that ffmpeg is able to handle video streams too. It is more lightweight than VLC and should have significantly less latency too. I haven't tried it yet though as I wanted to start small.

Some useful links here:

https://trac.ffmpeg.org/wiki/StreamingGuide

https://sonnati.wordpress.com/2011/07/1 ... ng-part-i/

and the info I used as background for the baby monitor is here:
http://ubuntuforums.org/showthread.php?t=1544946

gcmartin

#6 Post by gcmartin »

Actually, @Ted Dog's recommendation for VLC works rather well. VLC has been streaming for years. You do NOT have to target a specific PC to stream to. Just turn it on, go elsewhere on your LAN and access the stream.

Hope this helps

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#7 Post by greengeek »

gcmartin wrote:Actually, @Ted Dog's recommendation for VLC works rather well. VLC has been streaming for years. You do NOT have to target a specific PC to stream to. Just turn it on, go elsewhere on your LAN and access the stream.
It's true that VLC is useful for streaming, but the latency was greater when I tried VLC. It also wouldn't run on a pup that didnt have QT. Maybe there are other VLC pets that are more flexible.

If anyone could post a tutorial for simple VLC streaming that would be great.

Also - my ffmpeg solution does not target a specific PC - it broadcasts on a multicast address to any PC that wants to tap into the RTP stream so it's very versatile.
(You can use it to run your own radio station within your home or office if you want...)

RTP info here
.

gcmartin

#8 Post by gcmartin »

Looking for some official documentation. I know you know this, but, be aware that ALL streaming products will have some dependencies that may deter you. (I dont have the problem as I have ample RAM for my uses)Hope this is helpful.

partsman
Posts: 363
Joined: Wed 06 Jun 2012, 19:00
Location: OHIO,USA

#9 Post by partsman »

Thanks greengeek :D

Thank you all for useful links !

Now I know how to keep an eye on the kids ! :lol:
Very useful info all !
[color=red]Anyone can build a fast processor. The trick is to build a fast system. (Seymour Cray)[/color] :wink:

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#10 Post by greengeek »

gcmartin wrote:Looking for some official documentation. I know you know this, but, be aware that ALL streaming products will have some dependencies that may deter you.
I don't think that is strictly true. My example above did not require anything extra to be added - it just uses the standard ffmpeg built into my puppy. I should really try it on some other puppies once i get off this infernal android tablet and back on a real pc.

Post Reply