top of page

How to Stream MIPI Monochrome Cameras on Raspberry Pi 5

High-speed MIPI CSI-2 cameras are widely used in embedded vision, industrial imaging, robotics, and edge AI systems, where low-latency image acquisition and deterministic data transfer are critical. With the release of the Raspberry Pi 5, the platform provides improved CSI bandwidth, enhanced ISP processing, and higher overall system throughput compared to earlier Raspberry Pi generations. These improvements make it suitable for high-performance MIPI camera integration in embedded applications.

Raspberry Pi 5 with a mono MIPI camera module connected via CSI cable

This article explains how to stream video from the Bolt-900MGS MIPI Monochrome Camera using Raspberry Pi 5. The guide covers:

  • Hardware Test Setup

  • System Architecture Overview

  • Driver and Device Tree Integration

  • V4L2-Based Streaming

  • GStreamer Pipeline Execution

  • OpenCV-Based Streaming

  • Camera Control Using V4L2 and IOCTL

The content is based on practical validation of the Bolt-900MGS streaming pipeline on Raspberry Pi 5 and is intended for developers building production-ready embedded vision systems.


Hardware Test Setup for Bolt-900MGS MIPI Monochrome Camera on Raspberry Pi 5

The following hardware configuration was used to validate streaming of the Bolt-900MGS MIPI Monochrome Camera using the Raspberry Pi 5 over a MIPI CSI-2 interface.

Component 

Specification 

Host Board 

Raspberry Pi 5 

Storage 

8/16/32 GB SD Card 

Power Supply 

Official Raspberry Pi 5 Adapter 

Camera 

Bolt-900MGS Monochrome 

Interface 

MIPI CSI-2 

Adapter 

4 Lane MIPI Adapter Board 

Connector 

22 Pin CSI Connector 

Cable 

15 cm FFC Cable 

The camera connects via a 4-lane MIPI CSI-2 interface, enabling higher data bandwidth suitable for high-resolution monochrome streaming applications. Proper cable orientation and stable power delivery are critical to ensure reliable CSI pipeline initialization during system boot.


System Architecture Overview of MIPI Camera Streaming on Raspberry Pi 5

The Bolt-900MGS MIPI Monochrome Camera integrates with the Raspberry Pi 5 using the Linux media controller framework. The streaming pipeline involves multiple layers, from the physical MIPI CSI-2 interface to user-space applications.

Bolt-900MGS camera connected to Raspberry Pi 5 with V4L2 streaming pipeline

Interfacing Bolt-900MGS MIPI Camera with Raspberry Pi 5

Before streaming the Bolt-900MGS MIPI Monochrome Camera, the required Device Tree overlays must be installed and the system configuration updated to enable proper CSI interface initialization.

Download DTBO files  

Download and then copy DTB/BOLT_900MGS_CAM0_VX_xx.dtbo to the /boot/overlays directory:

sudo cp BOLT_900MGS_CAM0_VX_xx.dtbo /boot/overlays 

Update the Configuration File 

Edit the config.txt file to include the newly added overlay:

cd /boot/firmware/ 
sudo nano config.txt 

Add the following lines under the [all] section: 

dtoverlay=BOLT_900MGS_CAM0_VX_xx 
dtoverlay=BOLT_900MGS_CAM1_VX_xx 
dtoverlay=raspi-gpio 
dtparam=cam0_reg=off 
dtparam=cam1_reg=off 
dtparam=uart0=on 

Press Ctrl+S to save and Ctrl+X to exit the editor. 

These parameters enable the camera overlays, configure GPIO behavior, and disable regulator conflicts for CAM-0 and CAM-1 interfaces.

Reboot the Raspberry Pi

Reboot the Raspberry Pi 5 to apply the configuration changes:

reboot

After reboot, the overlays will be loaded during system initialization, allowing the media controller framework to detect the connected Bolt-900MGS camera module.


Streaming Bolt-900MGS on Raspberry Pi 5

This section describes the procedure for streaming video from the Bolt-900MGS MIPI Monochrome Camera connected to the Raspberry Pi 5.

The Raspberry Pi 5 provides two camera interfaces: CAM-0 and CAM-1. Both interfaces use the same driver architecture, and the driver loading process remains identical regardless of which CSI port is used.

Streaming can be performed using:

  • GStreamer (for pipeline-based video streaming)

  • OpenCV (for frame-level access and processing)

Prerequisites

Before proceeding with streaming, ensure that the required multimedia and camera utilities are installed.

GStreamer Installation

sudo apt install -y gstreamer1.0-tools 
sudo apt install -y gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav 

These packages provide support for video capture, format handling, and display sinks required for real-time streaming.

OpenCV and Supporting Tools Installation

Install Python, OpenCV, and V4L2 utilities:

sudo apt install -y python3-pip 
sudo apt install -y python3-opencv 
sudo apt install -y v4l-utils 

OpenCV enables programmatic access to frames and image processing.

v4l-utils provides V4L2 control and debugging tools such as v4l2-ctl.


Load Bolt-900MGS Kernel Module

Before configuring resolution or initiating streaming, the Bolt-900MGS driver module must be inserted into the Linux kernel.

Download the provided kernel object file:

KO_FILE/BOLT_900MGS_VX_xx.ko

Insert the module using:

sudo insmod BOLT_900MGS_VX_xx.ko

This loads the Bolt-900MGS driver into the kernel and registers the sensor within the media controller framework.

Streaming via CAM-0 Port

This section explains how to configure resolution and stream video from the CAM-0 CSI interface on the Raspberry Pi 5.

Configure Resolution (CAM-0)

To configure resolution and media entities, execute the resolution setup script:

CONFIG_RES/CONFIG_CAM0_RES_VX_xx.sh

Step 1: Make Script Executable

$ sudo chmod +x CONFIG_CAM0_RES_VX_xx.sh

Step 2: Execute Script with Desired Resolution

Example for <WIDTH> <HEIGHT>: 1920 1080:

$ sudo ./CONFIG_CAM0_RES_VX_xx.sh <WIDTH> <HEIGHT>
Note: Change the resolution as required

Expected Output

Selected Video-device : /dev/video0 
Selected Sub-device : /dev/v4l-subdev2 
Configuring resolution: 1920x1080 
Resolution 1920x1080 configured and ready to stream.
Note: Always pass the correct width and height to the CONFIG_CAM0_RES_VX_xx.sh script to stream at the desired resolution.

Streaming Using GStreamer

To stream it using GStreamer, follow the command below.

gst-launch-1.0 v4l2src device=<video_device> ! video/x-raw,format=GRAY8,width=1920,height=1080 ! videoconvert! 
fpsdisplaysink text-overlay=true video-sink=autovideosink 
sync=false 

Streaming Using OpenCV (Python)

To stream it using OpenCV, download the Python file below and follow the command.

python stream_vX_xx.py <video_device> <Sub-device> <WIDTH> <HEIGHT> <brightness_value> <exposure_value>
Note: To stream it using OpenCV, enter video_device and sub_device 

Understanding Video Device vs Sub-Device

This script (CONFIG_RES/CONFIG_CAM0_RES_VX_xx.sh) automatically finds the correct video device (like /dev/video0, /dev/video2, etc.) by checking the media graph and matching it to the camera sensor.

Video-Device:

The video device is used for streaming video, such as capturing frames using tools like v4l2-ctl, ffmpeg, or OpenCV in Python.

Since the video device name can also change after each reboot, always use this script to find the current video device. The script will print the correct /dev/videoX path for use in your application.

Sub-device:

This script (CONFIG_RES/CONFIG_CAM0_RES_VX_xx.sh) automatically finds the correct sub-device (like /dev/v4l-subdev2) by checking the media device. The sub-device is used to control settings like exposure and brightness using tools such as v4l2-ctl or Python OpenCV.

Since the sub-device name can change after each reboot, always use this script to find it. The script will print the correct sub-device.

Streaming via CAM-1 Port

This section explains how to configure resolution and stream video from the CAM-1 CSI interface on the Raspberry Pi 5.

The workflow is identical to CAM-0, with a dedicated configuration script for CAM-1.

Configure Resolution (CAM-1)

Run the resolution configuration script located in:

CONFIG_RES/CONFIG_CAM1_RES_VX_xx.sh

Step 1: Make the Script Executable

$ sudo chmod +x CONFIG_CAM1_RES_VX_xx.sh 

Step 2: Execute Script with Desired Resolution

Example for <WIDTH> <HEIGHT>: 1920 1080:

$ sudo ./CONFIG_CAM1_RES_VX_xx.sh <WIDTH> <HEIGHT>
Note: Change the resolution as required

Expected Output for the above command

Selected Video-device : /dev/video1
Selected Sub-device : /dev/v4l-subdev3
Configuring resolution: 1920x1080 
Resolution 1920x1080 configured and ready to stream. 
Note: Always pass the correct width and height to the CONFIG_CAM1_RES_VX_xx.sh script to stream at the desired resolution.

Streaming Using GStreamer (CAM-1)

After resolution configuration, use:

gst-launch-1.0 v4l2src device=<video_device> ! video/x-raw,format=GRAY8,width=1920,height=1080 ! videoconvert! 
fpsdisplaysink text-overlay=true video-sink=autovideosink 
sync=false 

Streaming Using OpenCV (Python)

Execute the provided Python streaming file:

python stream_v1_8.py <video_device> <Sub-device> <WIDTH> <HEIGHT> <brightness_value> <exposure_value>
Note- To stream it using OpenCV, enter video_device and sub_device

Understanding Video Device vs Sub-Device

Video-device:

This script (CONFIG_RES/CONFIG_CAM1_RES_VX_xx.sh) automatically finds the correct video device (like /dev/video0, /dev/video2, etc.) by checking the media graph and matching it to the camera sensor.

The video device is used for streaming video, such as capturing frames using tools like v4l2-ctl, ffmpeg, or OpenCV in Python.

Since the video device name can also change after each reboot, always use this script to find the current video device. The script will print the correct /dev/videoX path for use in your application.

Sub-device:

This script (CONFIG_RES/CONFIG_CAM1_RES_VX_xx.sh) automatically finds the correct sub-device (like /dev/v4l-subdev2) by checking the media device. The sub-device is used to control settings like exposure and brightness using tools such as v4l2-ctl or Python OpenCV.

Since the sub-device name can change after each reboot, always use this script to find it. The script will print the correct sub-device.


Camera Controls

The Bolt-900MGS camera supports configuration through two control interfaces:

  1. V4L2 (Video4Linux2)

  2. IOCTL-based control

For most application-level adjustments, V4L2 control via the detected sub-device is recommended.

Note: Always use the correct <Sub-device> path identified by the configuration script (e.g., /dev/v4l-subdev5).

Controlling Camera via V4L2

Camera parameters can be modified using the v4l2-ctl utility.

  1. BRIGHTNESS:

The brightness can be adjusted by providing values from ‘1' to '50’ to the following command.

v4l2-ctl --device <Sub-device> --set-ctrl brightness=val 

In the above command, in the place of ‘val,' the user must provide a value within the range of '1' to '50'. The default value for Brightness is '1’.

Example: v4l2-ctl -device <Sub-device> --set-ctrl brightness=1

  1. EXPOSURE:

The exposure can be adjusted by providing values from ‘1' to '10000’ to the following command.

v4l2-ctl --device <Sub-device> --set-ctrl exposure_time_absolute=val 

In the above command, in the place of "val", the user must provide a value within the range of '1' to '10000'. The default value for Manual Exposure is '156’. 

Example: v4l2-ctl --device /dev/v4l-subdev2 --set-ctrl exposure_time_absolute=156 

  1. HORIZONTAL FLIP:

To enable or disable Horizontal Flip, use the following command:

v4l2-ctl --device <Sub-device> --set-ctrl horizontal_flip=val

In the above command, val is the boolean value to enable and to disable the horizontal flip

0 → Disable horizontal flip (default)

1 → Enable horizontal flip

Example: v4l2-ctl --device <Sub-device>--set-ctrl horizontal_flip=1 enables Horizontal flip

  1. VERTICAL FLIP:

To enable or disable Horizontal Flip, use the following command:

v4l2-ctl --device <Sub-device> --set-ctrl vertical_flip=val 

In the above command, val is the Boolean value to enable and to disable the vertical flip

0 → Disable vertical flip (default)

1 → Enable vertical flip

Example: v4l2-ctl --device <Sub-device> --set-ctrl vertical_flip=1 enables vertical flip

IOCTL Controls (Python-Based Interface)

This section explains how to control camera image parameters using the provided Python IOCTL script.

The IOCTL interface allows interactive configuration of image controls for both connected cameras (CAM-0 and CAM-1).

Running the IOCTL Script

Download the file:

IOCTL/ioctl_vx_xx.py

Then execute:

sudo python3 ioctl_vx_xx.py 

When the Python script is executed, the following prompt will appear: 

Available Controls: 

1. Brightness (Range: 1–50) 
2. Exposure (Range: 1–1000) 
3. Horizontal Flip [0 = Disable, 1 = Enable] 
4. Vertical Flip [0 = Disable, 1 = Enable] 
0. Exit 
Select a control (0–4):  

Enter a number between 0 and 4.

Invalid inputs will prompt the menu again.

Enter 0 to exit the program.

  1. BRIGHTNESS CONTROL:

To control the Brightness, enter 1. You will then see the following prompt, where you can enter the camera ID and desired Brightness level, separated by a single space.

Enter Camera ID (0-1) and value for Brightness (Range: 1-50), or -1 to return to main menu:

Example Input: 0 10

Sets Brightness to 10 for Camera 0

To exit the brightness control and return to the main menu, press -1

  1. EXPOSURE CONTROL:

To control the Exposure, enter 2. You will then see the following prompt, where you can enter the camera ID and desired Exposure level separated by a single space.

Enter Camera ID (0-1) and value for Exposure (Range: 1-1000), or -1 to return to main menu:

Example Input: 1 10

Sets Exposure to 10 for Camera 1

To exit the exposure control and return to the main menu, press -1

  1. HORIZONTAL FLIP CONTROL:

To control the horizontal flip, enter 3. You will then see the following prompt, where you can enter the camera ID and desired Horizontal flip level, separated by a single space.

Enter Camera ID (0-1) and value for Horizontal Flip (Range: 0-1), or -1 to return to main menu:

Example Input: 1 1

Sets Horizontal Flip for Camera 1 

To exit the horizontal flip control and return to the main menu, press -1 

  1. VERTICAL FLIP CONTROL:

To control the vertical flip, enter 4. You will then see the following prompt, where you can enter the camera ID and desired Vertical flip level, separated by a single space.

Enter Camera ID (0-1) and value for Vertical Flip (Range: 0-1), or -1 to return to main menu:

Example Input: 0 1

Sets Vertical Flip for Camera 0

To exit the vertical flip control and return to the main menu, press -1


Scalable MIPI CSI-2 Integration on Raspberry Pi 5

This implementation demonstrates a clean and reliable method for integrating the Bolt-900MGS with the Raspberry Pi 5 using native MIPI CSI-2 interfaces. Through proper Device Tree configuration, kernel module loading, and media pipeline setup, the camera is fully accessible within the Linux V4L2 framework for real-time streaming and control.

Support for dual CSI ports, along with GStreamer and OpenCV compatibility, enables low-latency image capture suitable for embedded vision, robotics, and edge AI deployments where stable performance and direct sensor control are required.


Vadzo Imaging Bolt MIPI Camera Portfolio

Vadzo Imaging offers a range of Bolt MIPI CSI-2 cameras engineered for seamless integration with embedded platforms such as the Raspberry Pi 5. Built with native Linux driver support and media controller compliance, the Bolt series enables stable high-speed streaming, deterministic performance, and direct sensor-level control for embedded vision deployments.

Designed for compact edge systems, robotics, and industrial automation, the Bolt portfolio supports scalable single- and dual-camera configurations without requiring external bridge hardware.

Recommended Bolt Cameras for Raspberry Pi 5:

AR1335 Monochrome 4K MIPI Camera
Buy Now
IMX900 Monochrome Global Shutter MIPI Camera
Buy Now
AR2020 NIR Monochrome 20MP MIPI Camera
Buy Now

contact form camera image.webp
Reach Vadzo Team for the Customization

Vadzo team shall be able to assist you with the details on this.

Talk to our Camera Expert

bottom of page