RaspberryPi/USB Camera
From charlesreid1
Motivation
I'm done trying to get this cheap-o Pi camera, with the clumsy ribbon cable, to try and work. The whole design, all of it reeks of cheaply-manufactured hardware incapable of anything but the most inane projects. (Hence the plethora of "how to photograph your cat" videos, and nothing more interesting or heavy-duty.)
The Hardware
I ordered a USB camera (1080 P, 2 MP?) from Amazon:
Setup/Usage
The camera didn't come with instructions, but controlling it was insanely easy [1]:
$ apt-get install fswebcam $ fswebcam image.jpg $ python -m SimpleHTTPServer 8000
Then point browser to 192.168.0.111:8000, and voila, the image is there and ready:
Better Pictures
For best quality, use:
fswebcam -r 1280x720 --no-banner image.jpg
this results in a better image resolution without the obnoxious timestamp banner:
Motion program for camera stream
You can also stream from your camera using the motion program.
$ apt-get install motion
Now modify the motion config file to allow for webcam streaming:
$ sudo vim /etc/motion/motion.conf
change these lines:
stream_localhost on webcontrol_localhost on stream_port 8081
to these lines:
stream_localhost off webcontrol_localhost off stream_port 8080
You don't have to change the port, just make sure you know what port it's on.
Flags
