C++DriversRaspberry PiV4L2

Overview

rpicam-mjpeg is a C++ camera driver for the Raspberry Pi, written as an extension of the rpicam-apps suite. It replicates and improves on the functionality of RaspiMJPEG — the legacy MMAL-based driver that became unsupported from the Raspberry Pi 4 onwards, when MMAL was replaced by the V4L2 camera API and libcamera.

The driver supports simultaneous multi-stream capture — a preview MJPEG stream, a high-resolution image stream, and a RAW Bayer stream — controlled via a named FIFO pipe, making it a drop-in backend for the RPi Cam Web Interface. It also implements motion detection through a custom post-processing stage, matching the behaviour users relied on in the old MMAL pipeline.

Background

In 2013, Robert Tidey developed RaspiMjpeg, a software package capable of outputting multiple simultaneous data streams from the camera. It supported four core functionalities: full-resolution video recording; a resized preview stream; single image capture; and motion vector generation for motion detection.

Over time however, RaspiMjpeg became incompatible with newer Raspberry Pi models, and as a result, I, along with 5 other teammates undertook the task of learning about RaspiMjpeg and restoring its capabilities by creating rpicam-mjeg, an extension of the rpicam-apps suite.

We were also asked to address a known pain point among Raspberry Pi users — the slow capture time for still images — by improving the overall speed of the camera software. Compatibility with the Raspberry Pi web interface was an additional requirement.

rpicam-mjpeg works best when in combination with silvanmelchior's RPi_Cam_Web_Interface, but can also work as a standalone app.

Grant DongComputer Science & Finance Student @ USYD

© 2026 Grant Dong. All rights reserved.

Sydney, Australia