-
Notifications
You must be signed in to change notification settings - Fork 114
Adding a webcam
Peter Uithoven edited this page Jan 27, 2015
·
8 revisions
VisiCam does perspective correction but take a bit more processing power. https://github.com/t-oster/VisiCam/wiki
Stream a regular webcam using MJPG-streamer. http://freecode.com/projects/mjpg-streamer
Update: Someone created a more direct method: http://elinux.org/RPi-Cam-Web-Interface
Create a raspistill timelapse to a single file and stream this file using MJPG-streamer.
Because the raspistill timelapse has a limited time you have to create a script that keeps restarting it.
#!/bin/sh
# keep raspistill timelapses running for an hour
timelapseDuration=3600000
# Prepare Raspistill captures
cd ~
mkdir /tmp/stream
touch /tmp/stream/pic.jpg
# Start MJPG Streamer
/usr/local/bin/mjpg_streamer -i "/usr/local/lib/input_file.so -f /tmp/stream -n pic.jpg" -o "/usr/local/lib/output_http.so -w /usr/local/www -p 8081" > /tmp/stream/mjpg_streamer.log 2>&1 &
while true; do
raspistill --nopreview -w 1280 -h 960 -q 75 -o /tmp/stream/pic.jpg -tl 1000 -t $timelapseDuration -th 0:0:0 -vf -hf > /dev/null 2> /tmp/stream/raspistill.log
done
On Debian based systems (like Raspbian) you enable it by:
- Placing the file in
/etc/init.d
. - Make script executable:
sudo chmod +x /etc/init.d/{filename}
- Register script to be run at start-up:
sudo update-rc.d {filename} defaults
More info: http://www.stuffaboutcode.com/2012/06/raspberry-pi-run-program-at-start-up.html