RaspberryPi/USB Camera: Difference between revisions
From charlesreid1
| Line 49: | Line 49: | ||
<pre> | <pre> | ||
$ sudo vim /etc/motion/motion.conf | $ sudo vim /etc/motion/motion.conf | ||
</pre> | |||
change these lines: | change these lines: | ||
| Line 57: | Line 58: | ||
</pre> | </pre> | ||
to | to these lines: | ||
<pre> | <pre> | ||
Revision as of 18:45, 17 August 2016
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
to these lines:
stream_localhost off webcontrol_localhost off
Flags
