Camera capture
Takes pictures or a video with a camera plugged into the worker (USB, built-in, or a network stream), with a live preview.
How it works
Camera: 0 for the first camera of the worker, 1 for the next, a device path (/dev/video2) or a stream address (rtsp://…, http://…/video). Modes: one picture; pictures every few seconds; a video; or Until stopped, which shows the camera live and takes a picture each time a message asks for one.
While it runs it shows a live preview (connect its live telemetry to an Images view), and it answers messages on the channel named below: {"control": "picture"} takes a picture now, {"control": "stop"} ends. On Windows, a worker installed as a service may not be allowed to use cameras: run it in a window (esasim-worker run) for this block.
Outputs
| Output | Gives | What it is |
|---|---|---|
Picturespictures | Files jpg, png | picture_0001.jpg … |
Videovideo | Files mp4 | |
Live telemetrytelemetry | Live telemetry | What the block sends while it runs, for views such as Chart or 3D view. |
Settings
| Setting | Default | What it does |
|---|---|---|
Cameracamera |
0 | 0, 1 … a device path, or rtsp:// / http:// address |
Modemode |
one picture | One of: one picture, pictures, video, until stopped |
Picturescount |
10 | From 1 to 100000 |
Every (seconds)every |
1 | From 0 to 86400 |
Video length or longest wait (seconds)duration |
10 | From 1 to 86400 |
Width (pixels)width |
1280 | From 160 to 4096 |
Height (pixels)height |
720 | From 120 to 3072 |
Frames per second (video)fps |
30 | From 1 to 120 |
Pictures asformat |
jpg | One of: jpg, png |
Live preview every (seconds, 0 = none)preview |
0.5 | From 0 to 60 |
Channel for messageschannel |
camera |
Where it runs
On one of your computers with the EsaSim worker: Any worker.
The worker installs the Python packages it needs when they are missing: opencv-python-headless.
In its code, settings are ctx.params["key"], inputs ctx.inputs["id"] and outputs ctx.output("id", "name.ext"); see Custom blocks.