Camera ISP & Multi-Lens Capture
camera-ctl drives the Pixel’s internal cameras directly through the GS101 hardware ISP (/dev/lwis-*) by mounting the device’s own /vendor/apex/com.google.pixel.camera.hal.apex read-only in-place inside an isolated mount namespace — with zero Android init, zero servicemanager, and zero proprietary binaries redistributed.
Pixel 6 Pro (raven) Camera Sensors
Section titled “Pixel 6 Pro (raven) Camera Sensors”Run sudo camera-ctl list-cameras to inspect logical and physical lenses on your device:
| Camera ID | Lens / Alias | Sensor | Focal Length / Facing | Max YUV Resolution |
|---|---|---|---|---|
0 |
Rear Logical | Auto-selected multi-cam | Rear | 4080×3072 |
0.2 |
Rear Wide | Samsung GN1 (50 MP) | 6.81 mm / Rear |
4080×3072 |
0.3 |
Rear Ultrawide | Sony IMX386 (12 MP) | 2.35 mm / Rear |
4032×3016 |
0.4 |
Rear 4× Telephoto | Sony IMX586 (48 MP) | 19.00 mm / Rear |
4000×3000 |
1 |
Front | Sony IMX663 (11 MP) | 2.74 mm / Front |
3264×2448 |
Setup, Status & Teardown
Section titled “Setup, Status & Teardown”# Prepare ephemeral /run/headless-camera runtime, binderfs, and RO APEX loop mountsudo camera-ctl setup
# Check status as JSON (unprivileged)camera-ctl status
# List logical & physical cameras + supported YUV_420_888 resolutionssudo camera-ctl list-cameras
# Cleanly unmount APEX and remove ephemeral staging filessudo camera-ctl teardownTop-level options (must precede subcommand): --runtime-dir <PATH> (default /run/headless-camera), --lib-dir <PATH> (default /usr/local/lib/headless-camera).
Snapshots & Continuous NV12 Streaming
Section titled “Snapshots & Continuous NV12 Streaming”Captures one frame atomically to JPEG/PNG (via ffmpeg) or raw .nv12 (no ffmpeg required):
# Capture a 720p JPEG from the ultrawide lenssudo camera-ctl snapshot --camera 0.3 --width 1280 --height 720 -o ultrawide.jpg
# High-quality 4x telephoto snapshotsudo camera-ctl snapshot --camera 0.4 --width 1920 --height 1080 --quality 2 -o tele.jpg
# Raw NV12 frame (zero ffmpeg dependency)sudo camera-ctl snapshot --camera 0.2 --width 1280 --height 720 -o frame.nv12stream writes raw packed NV12 frames straight to stdout so you can pipe directly into mfc-encode with zero CPU color conversion:
# Record 10 seconds (150 frames @ 15 fps) of 720p H.264 on Exynos MFCsudo camera-ctl stream --camera 0.3 --width 1280 --height 720 --fps 15 --frames 150 \ | sudo mfc-encode --raw-nv12 -i - --width 1280 --height 720 --fps 15 --bitrate 2M --codec h264 -o live.h264Pass --frames 0 (the default) for continuous unbounded streaming.
Night Mode, Exposure & Manual Focus Control
Section titled “Night Mode, Exposure & Manual Focus Control”stream, stream-multi, and snapshot all expose slow-shutter color night-vision AE, EV compensation, and manual lens focus control:
# Slow-shutter color night-vision snapshot (auto-waits for night AE convergence)sudo camera-ctl snapshot \ --camera 0.2 \ --width 1280 --height 720 \ --night-mode auto \ --max-exposure-ms 250 \ --max-iso 6400 \ --night-target-luma 85 \ -o night.jpg
# Force night mode continuously + brighten by +1 EV (+6 in 1/6 EV steps)sudo camera-ctl stream \ --camera 0.3 --width 1280 --height 720 --fps 15 \ --night-mode on --max-exposure-ms 200 --max-iso 4800 --ev-comp 6
# Lock focus at infinity (0 diopters) — ideal for fixed security/outdoor camerassudo camera-ctl snapshot --camera 0.2 --focus-distance 0 -o infinity.jpg
# Macro / fixed close focus (~20 cm = 5.0 diopters, where diopters = 1 / meters)sudo camera-ctl snapshot --camera 0.2 --focus-distance 5.0 -o macro.jpgExposure & Focus Flag Reference
Section titled “Exposure & Focus Flag Reference”| Flag | Default | Valid Range & Behavior |
|---|---|---|
--night-mode |
off |
off, auto, or on — enables slow-shutter color night-vision auto-exposure. |
--max-exposure-ms |
200 |
33..500 ms maximum shutter duration (forwarded when --night-mode != off). |
--max-iso |
4800 |
400..10000 maximum sensor ISO gain (forwarded when --night-mode != off). |
--night-target-luma |
75 |
20..180 target frame luminance for night AE (forwarded when --night-mode != off). |
--ev-comp |
0 |
-24..24 in 1/6 EV steps (e.g. 6 = +1.0 EV, -12 = -2.0 EV). |
--focus-distance |
(auto AF) | 0 (infinity) or 0.000001..15.0 diopters (1 / distance_in_meters). Omit for continuous autofocus. |
2-Camera Concurrent Streaming (stream-multi)
Section titled “2-Camera Concurrent Streaming (stream-multi)”Because the GS101 ISP only permits one CameraProvider process to own /dev/lwis-* at a time (enforced via host-wide /run/headless-camera-isp.lock and per-runtime /run/headless-camera/.hw.lock), stream-multi opens up to 2 concurrent camera streams inside a single process and writes each camera’s raw NV12 frames to separate inherited file descriptors (--stream SPEC:FD):
Example Python pattern (must run as root / sudo) spawning stream-multi with simultaneous consumers draining both pipes — reading one pipe sequentially before the other can fill the OS pipe buffer and stall capture (see examples/frigate/camera-mfc-publisher.py for the complete supervised MFC H.264 + RTSP pipeline):
import os, subprocess
r0, w0 = os.pipe()r1, w1 = os.pipe()os.set_inheritable(w0, True)os.set_inheritable(w1, True)
cam = subprocess.Popen( [ "/usr/local/bin/camera-ctl", "stream-multi", "--stream", f"0.3:{w0}", "--stream", f"0.4:{w1}", "--width", "1280", "--height", "720", "--fps", "15", "--frames", "0", ], pass_fds=(w0, w1),)os.close(w0)os.close(w1)
# Drain both pipes concurrently (e.g. one Exynos MFC encoder subprocess per pipe)enc0 = subprocess.Popen( ["/usr/local/bin/mfc-encode", "--raw-nv12", "-i", "-", "--width", "1280", "--height", "720", "--fps", "15", "--codec", "h264", "-o", "ultrawide.h264"], stdin=r0,)enc1 = subprocess.Popen( ["/usr/local/bin/mfc-encode", "--raw-nv12", "-i", "-", "--width", "1280", "--height", "720", "--fps", "15", "--codec", "h264", "-o", "telephoto.h264"], stdin=r1,)os.close(r0)os.close(r1)Full Subcommand Flag Reference
Section titled “Full Subcommand Flag Reference”| Subcommand | Flags & Defaults |
|---|---|
setup |
--force, --boot-device <STR> |
teardown |
(none; refuses to tear down while .hw.lock is held) |
status |
(none; unprivileged JSON output) |
list-cameras |
--verbose |
snapshot |
-o/--output <PATH> (required), --camera 0, --width 1280, --height 720, --warmup <auto|0..240>, --quality 3 (2..31), --skip-cat-types 11, exposure & focus flags, --verbose |
stream |
--camera 0, --width 1280, --height 720, --fps 15 (1..60), --warmup 15, --frames 0, --skip-cat-types 11, exposure & focus flags, --verbose |
stream-multi |
--stream SPEC:FD (required, 1–2 repeatable), --width 1280, --height 720, --fps 15, --warmup 15, --frames 0, --skip-cat-types 11, exposure & focus flags, --verbose |