mediamtx-rpicamera
June 7, 2026 · View on GitHub
Raspberry Pi Camera component for MediaMTX.
This is a C-based executable that pulls the Raspberry Camera video feed, encodes it and makes the compressed video available to the server, while listening for incoming commands.
This embeds libcamera and some other dependencies, that are listed in meson.build.
This is embedded into all MediaMTX releases and shouldn't be downloaded unless you want to recompile it.
Compile
-
You must be on a Raspberry Pi, running one of the following operating systems:
- Raspberry Pi OS Trixie
- Raspberry Pi OS Bookworm
- Raspberry Pi OS Bullseye
-
Install build dependencies:
sudo apt install -y \ g++ \ xxd \ wget \ git \ cmake \ meson \ pkg-config \ python3-jinja2 \ python3-yaml \ python3-ply -
Build:
meson setup build && DESTDIR=./prefix ninja -C build installThis will produce the
build/mtxrpicam_32orbuild/mtxrpicam_64folder (depending on the architecture).
Compile against an external libcamera
-
You must be on a Raspberry Pi, running one of the following operating systems:
- Raspberry Pi OS Trixie
- Raspberry Pi OS Bookworm
- Raspberry Pi OS Bullseye
The external libcamera must have version ≥ 0.5.0 and ≤ 0.70.
-
Install build dependencies:
sudo apt install -y \ g++ \ xxd \ wget \ git \ cmake \ meson \ pkg-config \ python3-jinja2 \ python3-yaml \ python3-ply -
Make sure that the development package of your libcamera is installed, otherwise install the default one:
sudo apt install -y \ libcamera-dev -
Build with
--wrap-mode=default(that disables embedded libraries):meson setup --wrap-mode=default build && DESTDIR=./prefix ninja -C build installThis will produce the
build/mtxrpicam_32orbuild/mtxrpicam_64folder (depending on the architecture).
Cross-compile
-
You can be on any machine you like
-
Install Docker and
make -
Build for every supported architecture:
make -f utils.mk buildThis will produce the
build/mtxrpicam_32andbuild/mtxrpicam_64folders.
Install
Check MediaMTX documentation for instructions on how to use the compiled component.
License
All the code in this repository is released under the MIT License. Compiled binaries include or make use of some third-party dependencies:
- libcamera, released under the LGPL-2.1 License
- freetype, released under the FreeType License
- libjpeg-turbo, released under a Modified BSD 3-clause License
- openh264, released under the BSD 2-clause License