Home » DEVELOPERS » Tutorials » Use the camera with Raspberry Pi

Developers>Tutoriels>Use the camera with Raspberry Pi

 

Enable the camera

  • Open raspi-config tool :
$ sudo raspi-config

img1

  • Select ‘Enable Camera’ :

img2

Then the main menu appears.

  • Select ‘Finish’ with the Tab key :

img3

  • Choose to restart the  Raspberry Pi board :

img4

Photography

$ cd /home/pi/Pictures/

img5

  • Take a simple photo :
$ raspistill -o img1.jpg
 The raspistill command to take a simple photo. The photo is saved in the JPEG image img1.jpg.
  •  Check the creation of the image :
$ ls

img7

Exemple :

img1

In this example the image is upside down, here is the command to flip the image:

$ raspistill -vf -hf -o img1.jpg

The result :

img1Video

  • Command for record a  video :
$ raspivid -o video.h264 -t 10000

This will save 10 seconds of video.

  • If the video is in the wrong direction :
$ raspivid -vf -hf -o video.h264 -t 10000

10000 : 10 seconds.