Hardware Reference
In-Depth Information
Knowing your camera module
Once you've connected the camera module, you need to enable support for the camera
and its V4L interface in Raspbian. Use the following steps to enable the camera:
1.
Start raspi-config with the following command:
pi@raspberrypi ~ $ sudo raspi-config
2.
Select Enable Camera and Enable , then Finish and reboot the Pi.
3.
Record a 10 second test video to verify that the camera is operational:
pi@raspberrypi ~ $ raspivid -o camtest.h264 -t 10000
Then play it back:
pi@raspberrypi ~ $ omxplayer camtest.h264
4.
The last thing we need to do is to make our camera module accessible
to other applications via a standardised V4L interface. We need to make
sure that a certain kernel module gets loaded at boot time. Open up /etc/
modules for editing:
pi@raspberrypi ~ $ sudo nano /etc/modules
Make a new line under snd-bcm2835 (the Pi sound core module) and add
this line:
bcm2835_v4l2
Now press Ctrl + X to exit and select y when prompted to save the modified
buffer, then press the Enter key to confirm the filename to write to.
5. Reboot your Pi and use the following commands to confirm that your camera
module is now accessible through a V4L interface:
pi@raspberrypi ~ $ v4l2-ctl --list-devices
The output should show a mmal service accessible through /dev/video0 .
Type this command to enable a preview video overlay on your monitor:
pi@raspberrypi ~ $ v4l2-ctl --overlay=1
If your camera is upside down, just flip it with the following command:
pi@raspberrypi ~ $ v4l2-ctl -c vertical_flip=1
Explore the cool camera effects by supplying a number from 1 to 15:
pi@raspberrypi ~ $ v4l2-ctl -c color_effects=5
 
Search WWH ::




Custom Search