Scripted by Rik Goldman based on web resources (below), and with integral testing and feedback by Paul and Delonte, high-school students at Chelsea School in Silver Spring, MD. Consider using in conjunction with Zoneminder (scripted for installation on Raspbian at https://github.com/ghoulmann/rpi-zoneminder.
Objective
Install and configure streaming web video for Raspberry Pi running Raspbian. Read about it at
Adafruit.
Assumptions
- Using a Raspberry Pi
- Running Raspbian "Wheezy"
- Have access to the internet without a proxy
- Access to root privileges
- Have a webcam on /dev/video0
What it Does
In verbose bashish,
- Exit if it's not executed with root privileges
- Updates repo information
- Installs from repos: libv4l-0 and v4l-utils
- Downloads MJPG-streamer-rpi.tar.gz to /tmp/MJPG-streamer-rpi.tar.gz (source can be changed)
- Untar and decompress to directory in /opt (/opt is default, can be changed to suit taste)
- Changes default values for YUV and Port (defaults: YUV="false" and port=8080)
To Do
- alias in /usr/bin (perhaps)
- option to run as service from init.d
- echo url to stream on start? http://$ipaddr:$port/?action=stream
- detect yuv v mjpeg and configure as appropriate(?)
- Run as root, service for /etc/init.d (fork)
Sources
Based on links at Adafruit:
http://www.adafruit.com/blog/2012/11/02/pieye-streaming-webcam-piday-raspberrypi-raspberry_pi"
Use
- Download directly or use git clone.
- Edit to customize target directory, enable YUV, or change the download source as you see fit: (using nano from the command line) nano /path/to/pi-face.sh
- Run the script as root: sudo /path/to/pi-face.sh