Raspberry Pi High Quality Camera – First Pictures and Videos

Updated 16 February 2023

[Note - Terminal Commands talked about here have been superseded with the new 'Bullseye' Raspberry Pi OS. Link here for new 'Bullseye' camera commands.

If you want to use the commands found on this page download and flash the old 'Buster' OS to your Micro-SDOfficial link to download the 'Buster' image here] 

Introducing the Raspberry Pi High-Quality Camera, the third-generation camera module designed by Raspberry Pi. If you are raring to go with this technology then this guide will get you taking pictures and videos asap (even record video in slow motion and time-lapse photography). This will be the most up-to-date resource and also show you how to take advantage of all the photography and video settings that are available with this technology.

A first for the Raspberry Pi ecosystem, there is now an official camera with a fully adjustable focus and aperture. Another first is the C-, CS-mount and an on-device tripod mount. This camera module can output images at a resolution of 4056x3040, default video resolution at 1080P30, and can output RAW12/10/8 COMP8 data files. The C- and CS-mount means all security camera lenses will work with this module. You can even use more exotic lenses like telescopic lenses or microscope lenses if you want to zoom in really close. The contents of this guide can be found below.

What You Need
Assembly
Focusing the Lens
Take Pictures
Take Videos
Where To Now

There are truly many types of cameras modules and lenses that are plug-and-play for Raspberry Pi Single Board Computers and that number is steadily increasing. From day to night, you can keep track, photograph, and record your surroundings with the Raspberry Pi palm-sized computers. If you want a comparison run-down on a whole bunch of camera modules and lenses this guide is the place for you

It is important to note, for the High-Quality Camera to work correctly you will need to attach a lens to it. You won't be able to capture images otherwise. See below for the set-up created.

HQ Camera Set Up

 

As always if you have any questions, queries, or things to add please let us know your thoughts! 


What You Need

Below is a list of the components you will need to get this system up and running real fast.6mm Wide Angle Lens

- Raspberry Pi High-Quality Camera (this come with ribbon cable)
- Camera Lens, in this guide I use the Wide Angle Camera Lens
Raspberry Pi 4 Model B
Micro SD Card 
Power Supply 
Monitor
HDMI Cord 
Mouse and Keyboard

In this guide, I used a Camera Mount from the top of a Tripod. The HQ Camera module can screw very securely directly into this. The Raspberry Pi High-Quality Camera has a screw hole that can be used to mount it directly to a tripod.


Assembly

Start by attaching the lens securely to the CS-mount (if required). Make sure to remove the protective caps when screwing the camera modules and lens together. Screw that CS-mount with lens finger tight into the HQ camera module. Screw both parts into the HQ camera's Back Focus Ring and then tighten the locking screw in place. This will prevent the CS-mount and the Back Focus Ring from rotating around when you are trying to pull focus with the Focus Ring. You can loosen the Back Focus Ring to extend it out if a closer minimum focus is desired. The image below goes through this process. 

Assembly of Lens to HQ Mount

 

Connect the Ribbon Cable to the CSI (Camera Serial Interface) connector on the Raspberry Pi board and to the Camera module. From there you can install the whole module onto a tripod stand.  This will allow you to place it, target it, and focus it much more securely. You can see all these assembly steps in the images below. To connect the ribbon cables, lift up the edges of the CSI connector gently, slip the ribbon cable in till it bottoms out, then push down the edges of the CSI connector.

Ribbon Cable and lens mounting 

With the Micro-SD Card flashed you can install it into your Raspberry Pi. Now connect all the peripheries and plug in the USB C to turn on the Raspberry Pi. Then open up the Raspberry Pi Configuration menu (found using the top left menu and scrolling over preferences) and enable the Camera found under the Interfaces tab. After enabling reset the Raspberry Pi to lock in the changes. See the image below for the setting location.

Enable Camera in Configuration


Focusing The Lens

These lenses focus manually so the easiest way is to set up a preview menu running on your monitor and then find the focus using that preview menu as a guide. Make sure the CS-mount has been screwed finger tight and has been locked into place with the locking screw. Then set the Aperture to about the halfway point by rotating the ring with Open-Close on it and looking directly into the lens to see the Aperture change size/dilate. The Aperture on a lens is like a pupil in the human eye, it decides how much light enters into the camera. Halfway open is a good level to start for a reasonably well-lit-up room. Open up a new terminal window using the black console button on the top left of the screen on Raspberry Pi OS and type the following and press enter. 

raspistill -t 0 

This will open up a new window on your monitor showing exactly what the High-Quality Camera is seeing. Use this window to give you feedback on the manual adjustment that you will now do on the lens until you get a good colour and a sharp focus. The image below shows exactly where these fine adjustments are on your lens. 

Adjustment sections
 

Sometimes you will not be able to pull focus no matter how much you adjust the focus ring. If this is the case it is because the back focal length does not match the specifications for the lens. To solve this, adjust the Back Focus Ring. Then once that has been extended a couple of millimetres lock it in position using the locking screw. You can then adjust the focus ring to try to pull focus like before. Some lenses will require a longer back focus than the 6mm back focus length the normal Back Focus Ring can supply. In that case, you will need the C-CS adapter.


Take Pictures

To start off let us take some pictures. Type the following into the terminal opening the terminal using the same method as before.

raspistill -o image.jpg

Once you press enter on your keyboard the camera will take a photo after a couple of seconds and save it in the /home/pi directory providing it with the name image and formatting it as a JPG file. See below for an image taken using this exact method with the Raspberry Pi HQ camera. The image taken by the High-Quality camera is uploaded to this page at full resolution. Right-click and open it in a new window or save it to zoom in and see the fine details.

Image using this camera

 
There are heaps of additions you can add to this terminal line to alter all kinds of settings like exposure time, ISO settings, image rotation, change the directory location, isolating just a section of the image to be captured to name only a few. If you want to see all the available options the official Raspberry Pi Documentation for it here is the place to check out.

An example of some of these additions can be seen below. If you typed and entered below into the console it would take a picture after a two-second wait (represented by the -t 2000 where 2000 is in milliseconds) and capture it at a 640x480 resolution. It will also flip the image both horizontally and vertically.

raspistill -t 2000 -o image.jpg -w 640 -h 480 -hf -vf

An example of using a single terminal line to create a time-lapse can be seen below. This line below will take a time-lapse over 10 days with an image taken every 2 seconds. The resolution will be 1920x1080, all images will be JPEG format and be named image followed by an increasing number. You can then compile these images into a video using FFmpeg or any good time-lapse application. 

raspistill -t 864000000 -tl 2000 -o imaged.jpg -w 1920 -h 1080


Take Video

Now, let's take some videos with the High-Quality Camera. Type the following into the terminal opening it using the same method as before.

raspivid -t 5000 -o video.h264

Once you press enter on that the high-quality camera will take a video for 5 seconds and save it in the /home/pi directory providing it with the name video and turning it into an h264 format. The video will be recorded at the default for this camera which is 1080p30. Below is a snippet from this video.

Snippet from Video
 

Much like before there are heaps of additions you can add to this terminal line to get the exact result you desire, check them out here. An example of some of these additions can be seen below. If you typed and entered below into the console it would take a video captured at 640x480 resolution at 90 frames per second for 10 seconds. It would then name the file test90fps as a .h264 format. As more frames per second are being captured you can create slow-motion footage with the captured video.

raspivid -w 640 -h 480 -fps 90 -t 10000 -o test90fps.h264

Another useful tip is an easy way to turn the h264 files into MP4 (which are a more commonly used format type). Enter the following into the terminal. If prompted press and enter Y to confirm the installation.

sudo apt-get install gpac

Then to convert files type and enter the following into terminal (replacing YourFileName with the name of the h264 formatted file to be converted. This command will then produce an MP4 file from the h264 file. This will leave you with an MP4 file and an h264 file.

MP4Box -add YourFileName.h264 YourFileName.mp4


Where To Now

Want your Raspberry Pi camera to take an image when it sees the movement of a potential thief or have your Raspberry Pi 4 be able to identify you based on your face we have tutorials for you to explore. If you want to use Python to control your Raspberry Pi Camera the place to check out is here.

Attachment - Video_Close_up_Less_Light.mp4

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.