PiWebCam is an old school webcam script, that will upload an image from a webcam, to a web server.
-
Follow setup bellow.
-
Let the camera do it's thing.
-
install fswebcam
-
plugin your webcam and run
lsusb
, and look for some text only used by the webcam (i.e. "Webcam C920").
Replace <CAM TEXT> with your elected text.
- Fill out server info
Replace <USER> with your server's username, <DOMAIN> with your server's domain/ip, and <PATH ENDING WITH /> with were you want the file to go on your server's disk (i.e. /var/www/html/ (it must end with a /)).
- Do something cool
Now make a webpage that calls cam.jpg and boom, you now have a old school webcam. You'll want to set up a cronjob to run the script every now and then.
Running shutdown.sh
will upload offline.jpg
, and shutdown the pi.
If the script does not detect the webcam, it will upload offline.jpg
. Plugging the webcam back in, will resume normal operation. A USB hub with on/off switches can be handy for this.
The uploaded image is a .jpg, the microphone is not accessed. The webcam only fires up for a brief moment to take the image, it is not always on.
Don't point the webcam at anything you don't want to be seen.