picam is a Meson-based project for Raspberry Pi CSI / MIPI cameras. It ships camview, a Cheese-style tool for live preview, still capture, and timed video recording, built on GStreamer (libcamerasrc) and GTK 4.
The repository also builds a small shared library libpicam (src/lib.c) used as a project base.
- Preview: graphical window (
gtk4paintablesink). P saves a JPEG under your Pictures directory; Q quits. - Still (headless):
-s/--still— JPEG or PNG; optional resolution; autofocus settle delay. - Video (headless):
-d/--duration— H.264 in MP4, MOV, or MKV; hardware encoder preferred (v4l2h264encon Pi when available). - Dual CSI:
-i/--deviceuses a 1-based index (2= second camera). Camera paths are resolved viarpicam-hello --list-camerasorlibcamera-hello --list-cameras, or set explicitly with--camera-name.
# Live preview (needs a display)
camview
# Second camera, preview
camview -i 2
# One JPEG, default name camview_YYYYMMDD_HHMMSS.jpg
camview -s
# PNG, explicit path, 1920x1080
camview -s -f png -o shot.png -r 1920x1080
# 15 seconds of MP4
camview -d 15s -o clip.mp4
# Quick test clip, MOV
camview -d 500ms -f mov -o short.mov| Path | Purpose |
|---|---|
src/camview*.c, src/camview*.h |
camview CLI and GStreamer glue |
src/lib.c |
Shared libpicam helpers |
tests/*_test.c |
Check-based tests (e.g. duration_test, lib_test) |
debian/ |
Debian packaging |
po/ |
gettext catalogs |
meson.build |
Build definition |
Debian / Raspberry Pi OS (typical):
sudo apt install meson ninja-build pkg-config gcc \
libbas-c-dev \
libglib2.0-dev libgtk-4-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev \
checkRuntime (for the installed camview binary): GStreamer libcamera plugin, GTK 4 plugin (gstreamer1.0-gtk4), good/bad/base plugins, and libgtk-4-1. See debian/control for the exact package list. Listing multiple cameras is easier if rpicam-hello or libcamera-hello is installed (Recommends in packaging).
Project hints use an absolute build dir /build when you have it; otherwise any directory works:
meson setup build
ninja -C buildmeson test -C build- Man:
camview(1)is generated fromcamview.1.inat build time. - Bash: install ships
camviewcompletion undershare/bash-completion/completions/(sourcecamview.bashwhen developing).
camview strings live under po/; POTFILES lists sources for extraction. The Meson gettext domain is picam.
Refresh the template and merge new/changed msgid entries into every *.po:
ninja -C build picam-pot picam-update-po
ninja -C build picam-gmoThen fill in msgstr in each language (or use a PO editor). Validate with msgfmt -c po/<lang>.po.
Note: a CLI named poedit on some systems is a batch TSV applier (poedit --help), not the Poedit GUI and not a substitute for msgmerge. For template updates, use the ninja targets above.
LANGUAGE=zh_CN ./build/camview -hmeson install -C build
ninja -C build install-symlinks # dev symlinks into configured prefix
ninja -C build uninstall-symlinksdpkg-buildpackage -us -ucGST_DEBUG: e.g.GST_DEBUG=libcamera:4 camview -s -o test.jpgfor pipeline issues.- No frame / timeout: still capture waits for
PLAYING, AF settle, then up to 30s for a frame; ensure no other process holds the camera. - Encoder: on non-Pi dev machines you may get x264enc / openh264enc instead of
v4l2h264enc.
Copyright (C) 2026 Lenik picam@bodz.net
Licensed under AGPL-3.0-or-later. This project explicitly opposes AI exploitation and AI hegemony, and rejects mindless MIT-style licensing and politically naive BSD-style licensing. See LICENSE for the full text and supplemental terms.