Skip to content

Latest commit

 

History

History
102 lines (70 loc) · 2.61 KB

build-from-source.md

File metadata and controls

102 lines (70 loc) · 2.61 KB

Build patched rpicam-apps from source

The reference precompiled runtime is based on rpicam-apps v1.12.0. Building from source is the best option when you need to track a different Raspberry Pi OS/libcamera version or incorporate the DRM behavior into another custom rpicam-apps build.

1. Install build dependencies

On Raspberry Pi OS Lite 64-bit:

sudo apt update
sudo apt install -y \
  git cmake meson ninja-build \
  libcamera-dev libjpeg-dev libpng-dev libtiff-dev \
  libboost-program-options-dev libdrm-dev libexif-dev

Package names can change between Raspberry Pi OS releases. If a dependency name is unavailable, use the current Raspberry Pi rpicam-apps build documentation for that OS release.

2. Clone the matching release

git clone --branch v1.12.0 --depth 1 \
  https://github.com/raspberrypi/rpicam-apps.git
cd rpicam-apps

3. Apply the SeekerHD patch

git apply /path/to/SeekerHD-RaspberryPi-Helper/patches/rpicam-apps-v1.12.0-full-frame-drm.patch

Verify:

git diff -- preview/drm_preview.cpp

4. Configure a headless DRM build

meson setup build \
  -Denable_libav=disabled \
  -Denable_drm=enabled \
  -Denable_egl=disabled \
  -Denable_qt=disabled \
  -Denable_opencv=disabled \
  -Denable_tflite=disabled \
  -Denable_hailo=disabled

5. Build

On a Pi Zero 2 W or another memory-constrained Pi, use one build job:

meson compile -C build -j 1

The equivalent Ninja form is:

ninja -C build -j1

6. Use the build

Two approaches are possible.

A. Install system-wide

sudo meson install -C build
sudo ldconfig

Then use the installed rpicam-hello normally.

B. Package only the SeekerHD runtime

The SeekerHD installer uses a private runtime under /opt/divimath/rpicam instead of replacing Raspberry Pi OS's packaged rpicam-apps.

Copy the matching artifacts from the build tree:

build/apps/rpicam-hello
build/preview/drm-preview.so
build/librpicam_app.so.1.12.0

Preserve the shared-library symlinks:

librpicam_app.so.1 -> librpicam_app.so.1.12.0
librpicam_app.so   -> librpicam_app.so.1

The rpicam-hello binary has a relative runpath to find the private librpicam_app one directory above it. The DRM preview is selected at runtime using --preview-libs.

libcamera compatibility warning

libcamera does not guarantee a stable binary ABI. A precompiled drm-preview.so is linked against the libcamera ABI present when it was built. If Raspberry Pi OS changes libcamera ABI, rebuild rpicam-apps against the installed libcamera-dev rather than mixing incompatible binaries.