Linux (28) Python (13) Raspberry Pi (5) Bugs (3) Install (3) C (2) Brainf**k (1) HTML (1) Maths (1) Sorts (1)

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.

No comments:

Post a comment