• v0.1.0 43759f7e00

    v0.1.0
    validate / validate (push) Successful in 59m14s
    Stable

    cristhian released this 2026-09-15 09:22:31 +00:00 | 1 commits to main since this release

    First release.

    Captures frames from a V4L2 camera and publishes them as std/media/v1/Image: an Arrow
    struct of width: UInt32, height: UInt32, encoding: Utf8 and data: LargeBinary.
    The payload describes itself, so nothing about the frame's shape has to be agreed
    through message metadata. For a compressed encoding the recorded dimensions are the
    image's, not the length of data, so a receiver can size a buffer without decoding
    first.

    Wiring it

    nodes:
      - id: camera
        git: ssh://git@gitea.liria.cl:5001/liria/dora-webcam.git
        tag: v0.1.0
        build: uv pip install .
        path: dora-webcam
        env:
          CAMERA_ID: usb-Acme_Webcam
          ENCODING: jpeg
        inputs:
          tick: dora/timer/millis/33
        outputs:
          - image
    

    Run with --uv: the build command is uv pip install ., so the node gets its own
    managed environment and never installs into an ambient one.

    What it does

    • Encodings: bgr8, rgb8, yuv420, jpeg/jpg/jpe, png, bmp, webp.
    • Camera discovery: with neither CAMERA_ID nor CAPTURE_PATH set, the first
      /dev/video* that actually delivers a frame is used. Opening is not evidence — a UVC
      camera also exposes a metadata node that opens happily and never captures, so the
      lowest device number is wrong about as often as it is right.
    • Stable selection: CAMERA_ID matches an entry in /dev/v4l/by-id/, which
      survives a reboot and a change of USB port. Neither an index nor discovery order does.
    • Local preview: PREVIEW=true opens a window of the frames as they are published,
      after the flip and the resize, so a camera, an encoding or a flip can be checked
      without wiring a consumer. Press q to stop.
    • Runs without hardware: CI=true substitutes a labelled black frame for a failed
      read instead of raising, which is what lets the dataflow run on a machine with no
      camera.
    • Configuration in the dataflow: settings can be a node's env: map rather than the
      environment of whatever starts the run. A node's env: wins over the shell; variables
      it does not set still pass through.

    Notes

    Based on opencv-video-capture
    from dora-hub, with three deliberate differences: the typed image struct instead of a
    flat buffer plus metadata, Linux-only camera selection (the upstream macOS and Windows
    enumeration is not carried), and CAPTURE_FRAMES to bound a run in place of upstream's
    ten-second CI cutoff.

    This repository names no consumer of its output. It is a source; documenting itself
    through a specific downstream node would be a cycle, since that node depends on this one
    for frames. Wire image into anything that takes std/media/v1/Image.

    Requirements: dora 1.0+ (verified with dora-cli 1.0.1), Python 3.11+, uv, and a
    V4L2 camera. PREVIEW also needs a display. On a bare Linux image opencv-python needs
    libgl1 and libglib2.0-0, which it links at import time.

    Downloads