validate / validate (push) Successful in 59m12s
ssh:// cannot authenticate under dora-cli 1.0.1, which fetches through libgit2 with no credential callback, so a consumer wiring this node by `git:` needs the anonymous https URL.
94 lines
3.3 KiB
YAML
94 lines
3.3 KiB
YAML
# Node manifest: the typed contract a consumer wires against.
|
|
#
|
|
# No source package is shared between node repositories, so this file and its
|
|
# type URNs are the only contract a consumer has. `dora validate` checks a
|
|
# dataflow against it without running the node, so CI needs neither a camera nor
|
|
# OpenCV.
|
|
apiVersion: 1
|
|
name: dora-webcam
|
|
namespace: liria
|
|
description: Captures frames from a webcam and publishes them as std/media/v1/Image
|
|
categories: [sensor]
|
|
keywords: [opencv, camera, webcam, video, capture, image, v4l2]
|
|
|
|
runtime: python
|
|
entrypoint: dora-webcam
|
|
# Run the dataflow with --uv, which gives the node its own managed venv under
|
|
# `.dora/python-envs/`, so what it imports at runtime is what was installed
|
|
# here. Without --uv this needs a virtualenv to install into.
|
|
build: uv pip install .
|
|
dora: ">=1.0"
|
|
|
|
inputs:
|
|
tick:
|
|
required: true
|
|
description: >-
|
|
Reads and publishes one frame. Wire to dora/timer/millis/N. The node stops
|
|
when this input closes.
|
|
|
|
outputs:
|
|
image:
|
|
type: std/media/v1/Image
|
|
description: >-
|
|
Captured frame as an Arrow struct {width, height, encoding, data}. For a
|
|
compressed encoding, width and height are the image's dimensions rather
|
|
than the length of data, so a receiver can size a buffer without decoding
|
|
first.
|
|
|
|
env:
|
|
CAMERA_ID:
|
|
description: >-
|
|
Substring of an entry in /dev/v4l/by-id/. Stable across reboots and across
|
|
which USB port the camera is in, unlike an index, so it takes precedence
|
|
over CAPTURE_PATH. Linux only.
|
|
CAPTURE_PATH:
|
|
description: >-
|
|
Device path such as /dev/video1, or an index. A numeric string is read as
|
|
an index. When unset, the first /dev/video* that actually delivers a frame
|
|
is used -- a UVC camera also exposes a metadata node that opens and never
|
|
captures, so the lowest device number is not a safe default.
|
|
IMAGE_WIDTH:
|
|
type: int
|
|
description: Requested capture width; frames are also resized to it. Defaults to the camera's native width.
|
|
IMAGE_HEIGHT:
|
|
type: int
|
|
description: Requested capture height; frames are also resized to it. Defaults to the camera's native height.
|
|
ENCODING:
|
|
default: bgr8
|
|
description: One of bgr8, rgb8, yuv420, jpeg/jpg/jpe, png, bmp, webp.
|
|
JPEG_QUALITY:
|
|
type: int
|
|
default: 95
|
|
description: Quality 0-100, used only by the JPEG encodings.
|
|
FLIP:
|
|
description: Flip the frame. One of VERTICAL, HORIZONTAL or BOTH. Unset means no flip.
|
|
PREVIEW:
|
|
type: bool
|
|
description: >-
|
|
Open a local window showing the frames as they are published, so a camera
|
|
can be checked without wiring a viewer. Press q to stop the node. Ignored
|
|
under CI, where there is no display.
|
|
CAPTURE_FRAMES:
|
|
type: int
|
|
default: 0
|
|
description: >-
|
|
Stop after this many frames. 0, the default, runs until the tick input
|
|
closes. A positive count is what lets a test run the dataflow to
|
|
completion rather than killing it on a timeout.
|
|
CI:
|
|
type: bool
|
|
description: >-
|
|
When true, a failed read publishes a labelled black frame instead of
|
|
raising, which is what lets the dataflow run on a machine with no camera.
|
|
|
|
example: |
|
|
- id: camera
|
|
git: https://gitea.liria.cl/liria/dora-webcam.git
|
|
tag: v0.1.0
|
|
build: uv pip install .
|
|
path: dora-webcam
|
|
inputs:
|
|
tick: dora/timer/millis/33
|
|
outputs:
|
|
- image
|