Skip to main content

Interactive Textual TUI for building and running rpicam-still/rpicam-vid commands

Project description

rpicam-tui

TL;DR

TUI for controlling an Raspberry Pi Camera module. Uses rpicam-still and rpicam-vid under the hood. Run on your Raspberry Pi with:

uvx run rpicam-tui

An interactive terminal UI for building and running rpicam-still / rpicam-vid commands on the Raspberry Pi Camera Module 3, without hand-typing long CLI invocations every time.

This is a guided wrapper around the real CLI, not an abstraction that hides it. Every control in the settings form is labeled with the actual flag it maps to (--awb, --autofocus-mode, ...), and the command preview pane always shows the exact command that will run. Runs are executed with asyncio.create_subprocess_exec against the real rpicam-still/rpicam-vid binaries — argv in, argv out, no picamera2 abstraction layer in between.

Layout

  • Left pane — the settings form, grouped into collapsible sections (common/capture, autofocus, exposure, white balance/color, still-specific, video-specific).
  • Top-right pane — a live, syntax-highlighted preview of the exact command that will run.
  • Bottom-right pane — tabs for streamed process output and run history. Select a history row to reload its settings back into the form.

Running on the Pi

Dependencies are managed with uv:

# Install uv (recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh   # if uv isn't installed yet
# Then:
uv sync
uv run python -m rpicam_tui
# Or, if you just want to use it:
uvx rpicam-tui

uv sync creates a .venv and installs exactly what's pinned in uv.lock. rpicam-still/rpicam-vid must be on PATH (they ship with rpicam-apps on Raspberry Pi OS with a Camera Module 3 attached).

Developing off-Pi (dry-run mode)

The app runs fine on a laptop with no camera attached:

  • If rpicam-still/rpicam-vid isn't found on PATH, the runner automatically falls back to logging the command instead of executing it — you'll see a warning notification on startup and a note in the command preview.
  • You can also force this at any time with Ctrl+D (toggle dry-run), or by launching with uv run rpicam-tui --dry-run.
  • In dry-run, "running" a capture just prints [dry-run] would run: ... to the output log and records a (fake, zero-duration) entry in run history, so the whole picking-settings → preview → run → history loop is exercisable without hardware.

Keybindings

Key Action
Ctrl+R Run capture
Ctrl+X Cancel running capture (SIGINT)
Ctrl+T Toggle still/video mode
Ctrl+S Save current settings as a preset
Ctrl+L Load a preset
Ctrl+Y Copy the current command to clipboard
Ctrl+D Toggle dry-run mode
Ctrl+Q Quit (cancels any running capture)

Presets

Presets are JSON snapshots of the full settings form, stored at ~/.rpicam_tui/presets/*.json. A few are seeded on first run (copied from rpicam_tui/presets/ in the package):

  • default-still — general-purpose full-resolution still capture.
  • default-video — general-purpose 1080p30 video capture.
  • vehicle-mount — manual focus at ~10m (--lens-position 0.1), a fast --shutter 8000 to fight rolling-shutter blur from vibration, and a higher --bitrate 10000000.

Run history

Every run (including dry runs) is appended to ~/.rpicam_tui/history.json with its timestamp, full command, exit code, duration, and output path. Selecting a row in the History tab reloads that run's settings back into the form so you can tweak and rerun.

Project layout

rpicam_tui/
  command_builder.py   # pure Settings -> argv logic, unit-testable, no I/O
  runner.py            # async subprocess execution + cancellation
  field_specs.py        # declarative form schema (flags, help text, groups)
  presets.py            # preset save/load
  history.py            # run history persistence
  widgets.py             # reusable Textual form/preview widgets
  app.py                 # the Textual App tying it all together
  presets/                # seed preset JSON files
tests/
  test_command_builder.py
run.py                    # `python3 run.py` / `uv run python run.py` convenience entry point
pyproject.toml             # uv/PEP 621 project + dependency metadata
uv.lock                     # pinned dependency versions

Tests

uv sync                # installs the `dev` dependency group (pytest) too
uv run pytest

command_builder.py has no Textual or subprocess dependency, so its tests run instantly and cover the argv-building logic directly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpicam_tui-0.1.1.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rpicam_tui-0.1.1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file rpicam_tui-0.1.1.tar.gz.

File metadata

  • Download URL: rpicam_tui-0.1.1.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rpicam_tui-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cde5b2b721f10a97068d5486cec09ef22684d9b104ccaab4f9ddd88effab3c48
MD5 08dace03fb43ea5733dfc5678573571f
BLAKE2b-256 78ebdbcbaa9aa1a8384c2586293e19afc8263097547e04ad74b9f0c94effbf27

See more details on using hashes here.

Provenance

The following attestation bundles were made for rpicam_tui-0.1.1.tar.gz:

Publisher: python-publish.yml on markosnarinian/rpicam-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rpicam_tui-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: rpicam_tui-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rpicam_tui-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e586f7d4342a0b39478622a264b26d0166f77f5e80e46ce7a2570e57c5c482d5
MD5 c23366b6c6bdb66d0fb7f067686d83cb
BLAKE2b-256 35e6f9809a228f5a37a3647b04c24438a06dd87858986bdfe83b04c888684bc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rpicam_tui-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on markosnarinian/rpicam-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page