Electronics with passion: amplifiers and power supplies, FET's and vacuum tubes..
computer

VLC Babyphone: a webcam baby monitor – quick solution

Our baby started to crawl and he did it fast: he would fall from a bed or such before one can hear him. Hearing him crying afterwards was no joy at all, thus an audio-only baby-phone was definitely not a solution. I wanted to get something up very quickly, w/o purchasing extra h/w or spending much time. VLC came at resque. Nevertheless it took me some time to get it right - that's why here's yet another "webcam streaming server how-to".

Note: I did it all on Linux machines. But Windows adepts must not be discouraged: VLC runs there very well too, and it's a truly free software!

My video-surveillance streaming client-server set-up

First of all get yourself a web-camera that runs Ok under Linux (I would not recall one that would not).
Install VLC (pls let me know if anyone needed help on this).

Check that everything is fine with VLC
Launch VLC, then:
"Media" -> "Open Capture Device" -> "Play" (button at the bottom right)
You should see a nice scene on the screen 😉
If it does not show anything - then search for a solution elsewhere or write me up.

The server gets started by the following 2-liner script:

#!/bin/bash
cvlc v4l2:// --file-caching=300 --sout '#transcode{vcodec=mp4v,vb=1600}:duplicate{dst=display,dst=std{access=mmsh,mux=asfh,dst=0.0.0.0:8090}}'

For the convenience of my better half I created a desktop "launcher" that calls the script:

gnome-terminal -x /home/anyuser/vlc_webstream.sh

With this setup there's a terminal window where vlc puts its comments about what's going on + there's a picture on the screen so one can check that there's no adult content being broadcasted.

The client-side script was even simpler:

cvlc mmsh://192.168.1.227:8090 :mms-caching=700

Sure you'll put there an actual IP address of the surveillance server you just created.

iPhone (and such) users would probably be good to go with similar setup. May be an http broadcast would be more appropriate in such cases. RT*M on VLC: http://www.videolan.org/doc/streaming-howto/en/ch04.html

Some learnings from this exercise:

1) Transcoding proved to be necessary in order to reduce the traffic, for ex. if one wanted to watch the picture over a wireless lan. Without it VLC at the client side was throwing some hard to swallow errors like corrupt buffers etc. and often refused to show anything.

2) Default network stream buffering set in VLC is way too long for this particular application (it was 6s in total). Hence the mms-caching=700 (ms). That gives us about 1s delay if you sum server's and client's caching up.

Please drop me a note about your experience!

2 Comments

  1. Denny Huitink

    Nice blog here! Also your web site loads up fast! What web host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as quickly as yours lol

  2. Agustin Clower

    My brother recommended I might like this website. He was totally right. This post actually made my day. You cann’t imagine just how much time I had spent for this info! Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.