Cameras for Raspberry Pi

  1. Home
  2. Docs
  3. Cameras for Raspberry Pi
  4. What is libcamera?

What is libcamera?

what is libcamera and how you cana use it on Raspberry Pi

libcamera is an open-source camera stack, which was used by Raspberry Pi to develop its latest camera software library. It offers users more lower-level access than the old raspistill and is fully open-sourced.

The libcamera-apps that are currently available for Raspberry Pi:

  1. libcamera-hello will give you a preview of the camera module.
  2. libcamera-jpeg will capture still images after showing you a preview window.
  3. libcamea-still offers all the features of raspistill.
  4. libcamera-vid offers all the features of raspivid.
  5. libcamera-raw will get raw frames from the image sensor.
  6. libcamera-detect will work with tensorflow lite to automatically capture JPEG images when certain objects appear in the frame, it needs to be built first.

For more information, please refer to:

The libcamera-Compatible Camera Lists

Below is a complete list of camera modules that work perfectly well with libcamera-apps.

Camera VendorsCamera Models
Raspberry Pi
ArducamV2 Series / HQ Series / Pivariety Series / 16MP Series / 64MP Series

Using Arducam Cameras with Picamera2 >

Supported Resolutions & Frame Rates

Camera Module v1Camera Module v2HQ Camera16MP-AF64MP-AF
Video modes (preview)1080p30, 720p60 and 640 × 480p60/901080p30, 720p60 and 640 × 480p60/901080p30, 720p60 and 640 × 480p60/904656×[email protected], 3840×[email protected], 2328×[email protected], 1920×[email protected], 1280×[email protected]9152×[email protected], 4624×[email protected], 3840×[email protected], 2312×[email protected], 1920×[email protected], 1280×[email protected]


Please make sure your Raspberry Pi OS is downloaded from these two official sources:

Raspberry Pi Buster > (Note: The new version of Buster kernel is no longer supported)

Raspberry Pi Bullseye >

How to install libcamera?

The official Raspberry Pi camera modules (V1/V2/HQ), it’s already built in.

If you are using the Arducam Autofocus Camera for the first time, please follow these steps:

Step 1. Download the bash scripts

wget -O
chmod +x

Step 2. Install libcamra-dev

./ -p libcamera_dev

Step 3. Install libcamera-apps

./ -p libcamera_apps

Advanced usages of libcamera & libcamera-apps

For full details on how to use the libcamera for project-bulding, please refer to this article.

Below are the options that are available for both commands:

-h [ --help ]

Print out the help message.


Displays the build version number.

-v [ --verbose ]

Output extra debug and diagnostics.

-c [ --config ]

Read the options from a file. If no filename is specified, default to config.txt. In case of duplicate options, the ones provided on the command line will be used. Note that the config file must only contain the long form options.


Sets the information string on the title bar. Available values:

%frame (frame number)

%fps (framerate)

%exp (shutter speed)

%ag (analog gain)

%dg (digital gain)

%rg (red color gain)

%bg (blue color gain)

%focus (focus FoM value)

%aelock (AE locked status)


Set the output image width.


Set the output image height.

-t [ --timeout ]

Time (in ms) for which program runs. The default value is 5000.

-o [ --output ]

Set the output file name.


Set the file name for configuring the post-processing.


Force use of full-resolution raw frames.

-n [ --nopreview ]

Do not show a preview window.

-p [ --preview ]

Set the preview window dimensions, given as x,y, width, and height. E.G. 0,0,640,480

-f [ --fullscreen ]

Use a fullscreen preview window.


Use Qt-based preview window (WARNING: causes heavy CPU load, fullscreen not supported)


Request a horizontal flip transform.


Request a vertical flip transform.


Request an image rotation, 0 or 180


Set region of interest (digital zoom) e.g. 0.25,0.25,0.5,0.5


Set a fixed shutter speed.


Set a fixed gain value (synonym for ‘gain’ option).


Set a fixed gain value.


Set the metering mode (center, spot, average, custom).


Set the exposure mode (normal, sport).


Set the EV exposure compensation, where 0 = no change


Set the AWB mode (auto, incandescent, tungsten, fluorescent, indoor, daylight, cloudy, custom).


Flush output data as soon as possible.

When writing multiple output files, reset the counter when it reaches this number.

Adjust the brightness of the output images, in the range -1.0 to 1.0

Adjust the contrast of the output image, where 1.0 = normal contrast.

Adjust the colour saturation of the output, where 1.0 = normal and 0.0 = greyscale.

Adjust the sharpness of the output image, where 1.0 = normal sharpening.

Set the fixed framerate for preview and video modes.

Sets the Denoise operating mode: auto, off, cdn_off, cdn_fast, cdn_hq

Width of viewfinder frames from the camera (distinct from the preview window size.

Height of viewfinder frames from the camera (distinct from the preview window size).

Name of camera tuning file to use, omit this option for libcamera default behaviour.

Width of low resolution frames (use 0 to omit low resolution stream.

Height of low resolution frames (use 0 to omit low resolution stream.

Flush output data as soon as possible.

-k [ --keypress ]
Perform capture when ENTER pressed.

Pause or resume video recording when ENTER pressed.

-s [ --signal ]

Perform capture when the signal received.

Pause or resume video recording when the signal is received.

Options only available for libcamera-still

-q [ --quality ]

Set the JPEG quality parameter.

-x [ --exif ]

Add these extra EXIF tags to the output file.


Time interval (in ms) between timelapse captures.


Initial frame counter value for timelapse captures.


Use date format for output file names.


Use system timestamps for output file names.


Set JPEG restart interval.


Set thumbnail parameters as width:height: quality

-e [ --encoding ]

Set the desired output encoding, either jpg, png, rgb, bmp or yuv420

-r [ --raw ]

Also, save raw files in DNG format.


Create a symbolic link with this name to the most recent saved file


Perform first capture immediately, with no preview phase.

Options only available for libcamera-vid

-b [ --bitrate ]

Set the bitrate for encoding, in bits/second (h264 only).


Set the encoding profile (h264 only).


Set the encoding level (h264 only).

-g [ --intra ]

Set the intra frame period (h264 only).


Force PPS/SPS header with every I frame (h264 only).


Set the codec to use, either h264, mjpeg or yuv420.


Save a timestamp file with this name.

-q [ --quality ]

Set the MJPEG quality parameter (mjpeg only).

-l [ --listen ]

Listen for an incoming client network connection before sending data to the client.

-i [ --initial ]

Use ‘pause’ to pause the recording at startup, otherwise ‘record’ (the default).


Create a new output file every time recording is paused and then resumed.


Break the recording into files of approximately this many milliseconds.


Write output to a circular buffer which is saved on exit.

Was this article helpful to you? Yes No 1