Labels

Arduino (1) Bugs (3) C (1) Install (3) Linux (25) Maths (1) Python (11) Raspberry Pi (4)

Wednesday, 20 January 2016

How to use the camera on the Raspberry Pi

The Raspberry pi is capable of taking pictures in 1080p and its quite easy to once you get it connected.
First off you need to connect the camera and enable using the raspi-configraspistill -o image.jpg
This saves a photo as "image.jpg" in the current directory.
If you get an error like

mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

Change the quality:
raspistill -q 50 -o image.jpg
This saves a photo as "image.jpg" with 50% quality therefore saving size.

Taking a video for 5 seconds:
raspivid -o video.h264
This takes a video for the default time of 5 seconds and saves it as "video.h264".

Taking a video for a different time:
raspivid -t 120 -o video.h264
This takes a video for 120 seconds or 2 mins. Make sure you have enough space on your sd card as these videos can get large very quickly.