Raspberry Pi 4 Bookworm
Prepare SD card
- Device: Raspberry Pi 4 (Models B, 400, and compute Modules 4, 4S)
- OS: Raspberry Pi OS (64-bit) (tested with release 2025-05-13)
Connect CSI2 camera
In this picture camera is connected to cam0 port. Only port exposed in Raspberry Pi 4
OS Prepare
Login to your Raspberry device and update it first.
sudo apt update
sudo apt upgrade -y
IMX462
Camera 462x-CSI-M12x, with 687.0832.10A 15 to 22pin FFC cable.
Setup camera
Edit config file:
sudo nano /boot/firmware/config.txt
# camera_auto_detect=1 --- Find camera_auto_detect=1 and comment it out.
# Paste these lines at the end of the config file
dtoverlay=imx462,clock-frequency=37125000
camera_auto_detect=0
Default camera port is cam1
Reboot
Test camera
Check if camera is detected
libcamera-hello --list-cameras
Available cameras
-----------------
0 : imx462 [1920x1080 12-bit RGGB] (/base/soc/i2c0mux/i2c@0/imx290@1a)
Modes: 'SRGGB10_CSI2P' : 1280x720 [60.00 fps - (320, 180)/1280x720 crop]
1920x1080 [60.00 fps - (0, 0)/1920x1080 crop]
'SRGGB12_CSI2P' : 1280x720 [60.00 fps - (320, 180)/1280x720 crop]
1920x1080 [60.00 fps - (0, 0)/1920x1080 crop]
Capture picture to /tmp/test.jpg
libcamera-jpeg -o /tmp/test.jpg -n
[0:00:22.397023744] [1717] INFO Camera camera_manager.cpp:326 libcamera v0.5.0+59-d83ff0a4
[0:00:22.443947725] [1721] WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[0:00:22.445317429] [1721] WARN CameraSensor camera_sensor_legacy.cpp:501 'imx462 10-001a': No sensor delays found in static properties. Assuming unverified defaults.
[0:00:22.446424374] [1721] INFO RPI vc4.cpp:447 Registered camera /base/soc/i2c0mux/i2c@1/imx290@1a to Unicam device /dev/media1 and ISP device /dev/media2
[0:00:22.446880392] [1721] INFO RPI pipeline_base.cpp:1121 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Mode selection for 960:540:12:P
SRGGB10_CSI2P,1280x720/0 - Score: 1125
SRGGB10_CSI2P,1920x1080/0 - Score: 1375
SRGGB12_CSI2P,1280x720/0 - Score: 125
SRGGB12_CSI2P,1920x1080/0 - Score: 375
Stream configuration adjusted
[0:00:22.449191874] [1717] INFO Camera camera.cpp:1205 configuring streams: (0) 960x540-YUV420 (1) 1280x720-SRGGB12_CSI2P
[0:00:22.449765966] [1721] INFO RPI vc4.cpp:622 Sensor: /base/soc/i2c0mux/i2c@1/imx290@1a - Selected sensor format: 1280x720-SRGGB12_1X12 - Selected unicam format: 1280x720-pRCC
Mode selection for 1920:1080:12:P
SRGGB10_CSI2P,1280x720/0 - Score: 3000
SRGGB10_CSI2P,1920x1080/0 - Score: 1000
SRGGB12_CSI2P,1280x720/0 - Score: 2000
SRGGB12_CSI2P,1920x1080/0 - Score: 0
Stream configuration adjusted
[0:00:27.706623667] [1717] INFO Camera camera.cpp:1205 configuring streams: (0) 1920x1080-YUV420 (1) 1920x1080-SRGGB12_CSI2P
[0:00:27.708885648] [1721] INFO RPI vc4.cpp:622 Sensor: /base/soc/i2c0mux/i2c@1/imx290@1a - Selected sensor format: 1920x1080-SRGGB12_1X12 - Selected unicam format: 1920x1080-pRCC
Still capture image received