Server / Chipsets / Raspberry Pi

CameraStack on
Raspberry Pi.

Ready-made camera software for Raspberry Pi: capture, hardware encode, RTSP streaming and a standards-compliant ONVIF interface, turning a Pi with a camera module into a network camera.

Available reference platform Class / Embedded Linux

On this silicon

What runs today.

  • 01 Sensor capture through libcamera, one shared graph feeding every branch
  • 02 Multi-profile hardware H.264 encode on the VideoCore
  • 03 The full RTSP transport family: TCP, UDP, HTTP tunnelling, WebSocket and multicast
  • 04 ONVIF Device, DeviceIO, Media, Media2, Events, Imaging, Analytics and Advanced Security services
  • 05 TLS: HTTPS management and snapshots, RTSP over HTTPS, secure WebSocket and rtsps:// streaming, with camera-held certificates managed through the ONVIF TLS Configuration Add-on
  • 06 Polygon motion detection: ONVIF MotionRegionDetector rules on a compact activity grid
  • 07 JPEG snapshots and multi-slot text OSD
  • 08 Demand-driven encoding: each encoder runs only while clients consume its profile
  • 09 Metadata streaming and events, including the ONVIF ImageTooDark tampering event

How this port works

Raspberry Pi has a vendor GStreamer stack, and that makes this the quickest kind of port: the CameraStack plugin is a description of the platform’s capture and encode elements, and the portable core builds and runs the pipelines in-process, from multi-profile encoding to the snapshot, OSD and analysis branches. Everything that is not platform-specific, RTSP delivery, the ONVIF services, events, tracking and configuration, runs in the same portable core as every other platform. Porting to a new GStreamer platform mostly means writing that description.

Delivery is flexible on GStreamer platforms too: streams can be served through GStreamer’s own RTSP server, or through the portable core’s delivery engine, the same one used on every platform, which supports the full RTSP transport family, including TLS, RTSP-over-HTTP tunnelling and RTSP-over-WebSocket. On the Pi the two differ in one concrete way: the core’s delivery engine uses the VideoCore hardware encoder, while the GStreamer RTSP server pairs with software x264, because it attaches to the pipeline later than the Pi’s V4L2 encoder can accept. Both paths serve the same profiles and the same ONVIF services.

Snapshots, OSD and motion

The camera is a single-acquirer device under libcamera, so the port builds one shared capture graph and tees it into the encoder, snapshot, OSD and analysis branches. JPEG snapshots are proven on the live camera: the snapshot branch pulls a current frame, encodes it and closes again, without touching the video encoders.

The shared GStreamer tier brings the portable text OSD: four slots per source with plain text, date and time modes, standard and custom positions, and full transparency from the software compositor. A live create, set or delete changes element properties rather than rebuilding the camera graph.

The Analytics service runs ONVIF MotionRegionDetector rules: up to four named polygons with per-rule sensitivity and damping, evaluated in Go on a compact 32x18 activity grid sampled from a small thumbnail at 5 frames per second. This is deliberately not NPU inference: it is a bounded CPU analysis branch that never scans full video frames, and it runs only while a rule is armed. The same thumbnail supplies mean luminance for the ONVIF ImageTooDark event. Encoding is demand-driven: idle encoder work stops while snapshots, events and metadata stay available, and a resumed stream starts on a fresh keyframe.

pi3 / live stream probe
$ ffprobe rtsp://<user>:<pass>@pi3.lan:8554/onvif/Profile_1
ffprobe version 7.1.1-1ubuntu4.2 Copyright (c) 2007-2025 the FFmpeg developers
  ...
Input #0, rtsp, from 'rtsp://<user>:<pass>@pi3.lan:8554/onvif/Profile_1':
  Metadata:
    title           : CameraStack Server (rPi3B)
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 1280x720, 15 fps, 15 tbr, 90k tbn
  Stream #0:1: Data: none

The probe's second track is the ONVIF metadata stream, where analytics and events travel alongside the video.

Build on it

Designing a
Pi-based product?

Plenty of real products ship on Pi compute modules. If yours needs to be a camera, the stack is already ported. Use it as the complete camera stack or as a drop-in ONVIF interface.

Talk to us about Raspberry Pi