
Picamera2 is the libcamera-based replacement for Picamera which was a Python interface to the Raspberry Pi’s legacy camera stack. Picamera2 also presents an easy to use Python API.
The following content is a quick tutorial on using picamera2 and our Pi camera series.
Note: Make sure you are running Raspberry Pi OS bullseye (20220128 & later releases)
Picamera2
Make sure libcamera is already installed:
dpkg -l | grep libcamera
Installing Picamera2
sudo apt install -y python3-kms++
sudo apt install -y python3-pyqt5 python3-prctl libatlas-base-dev ffmpeg
sudo pip3 install numpy --upgrade
sudo pip3 install picamera2
Source: GitHub
Running Picamera2 Examples
git clone https://github.com/raspberrypi/picamera2.git
cd picamera2/examples
python3 app_capture.py