SkyLok/camera_example
2026-05-21 15:23:13 +02:00
..
camera.cpp cleanup and fixes 2026-05-21 15:23:13 +02:00
deploy.sh camera deploy script and makefile and readme 2026-05-21 12:31:08 +02:00
event_loop.cpp camera example from libcamera git 2026-05-20 12:22:09 +02:00
event_loop.hpp camera example from libcamera git 2026-05-20 12:22:09 +02:00
flake.nix camera example from libcamera git 2026-05-20 12:22:09 +02:00
Makefile camera deploy script and makefile and readme 2026-05-21 12:31:08 +02:00
README.md readmes and gps changes 2026-05-21 14:11:06 +02:00

camera_example

libcamera viewfinder (XRGB8888) → libjpeg-turbo → TCP. One client at a time.

Wire format: [uint32 BE size][jpeg_bytes] repeating.

Knobs (fps, quality, AF, lens, port, resolution) are constexpr at the top of camera.cpp.

Build on the Pi

apt install g++ pkg-config libcamera-dev libevent-dev libjpeg-turbo8-dev
make

Receive

nc <pi-ip> 5000 | ffplay -f mjpeg -

Cross-build (Nix, x86 → armv6l)

nix build

Binary links against /nix/store so it only runs on a Pi with Nix installed. For plain Pi OS: use make on the device, or ./deploy.sh user@host to rsync+build.