
ä
13
Code Examples
Now that you have a great way to mount your camera module, it’s time to do
something cool with it!
The camera module has lots of fun functions and modes to try out, as well as a
whole host of settings to get creative with.
Taking Pictures
To take a picture, we use the ‘raspistill’ application.
A simple photo can be taken and saved by using:
raspistill -o picture.jpg
Shooting Video
To shoot a 20-second video, we use the ‘raspivid’ application:
raspivid -o video.h264 -t 20000
To shoot a 5 second slow motion video, we use the same command with some
additional parameters. This example is a 5 second clip at 640x480 resolution:
raspivid -w 640 -h 480 -fps 90 -t 5000 -o slowmotion.h264
Advanced Settings
There is an incredible amount of settings that can be changed with the camera
module, from ISO level, white balance, video stabilisation, effects and more.
A full list of available commands can be found over on the Raspberry Pi
Foundation’s website:
https://www.raspberrypi.org/documentation/raspbian/applications/camera.md