Skip to main content

pi-camera

Capture photos and video from Raspberry Pi Camera module (CSI and USB webcams).

Overview

The pi-camera node captures photos and video from Raspberry Pi Camera modules (CSI ribbon cable) and USB webcams. It supports still image capture, video recording, and basic motion detection with configurable resolution, quality, and camera adjustments.

1080p
Max Resolution
3
Capture Modes
CSI
& USB Support
JPEG
PNG & BMP

Properties

Property Type Default Description
mode select "photo" Capture mode: "photo", "video", or "detect"
width number 1920 Image/video width in pixels
height number 1080 Image/video height in pixels
quality number 85 JPEG compression quality (1-100)
format select "jpeg" Output format: "jpeg", "png", or "bmp"
rotation select "0" Image rotation: "0", "90", "180", or "270" degrees
hflip boolean false Horizontal flip (mirror image)
vflip boolean false Vertical flip (upside down)
exposure select "auto" Exposure mode: "auto", "short", or "long"
awb select "auto" Auto white balance: "auto", "daylight", "cloudy", "tungsten", "fluorescent"
duration number 5 Video recording duration in seconds
outputDir string "/tmp/edgeflow-camera" Directory to save captured files

Inputs

msg.payload

Any incoming message triggers a capture. Optionally override settings via payload.

{
  "payload": {
    "mode": "photo",
    "width": 1280,
    "height": 720,
    "quality": 90
  }
}

Outputs

Capture Result
{
  "payload": {
    "filepath": "/tmp/edgeflow-camera/img_001.jpeg",
    "filename": "img_001.jpeg",
    "size": 245760,
    "width": 1920,
    "height": 1080,
    "format": "jpeg",
    "mode": "photo",
    "timestamp": 1707734400000
  }
}

Example Flows

Timelapse Photography

Capture a photo every 60 seconds for timelapse sequences.

[
  {
    "id": "timelapse-timer",
    "type": "inject",
    "repeat": "60",
    "payload": ""
  },
  {
    "id": "camera-capture",
    "type": "pi-camera",
    "mode": "photo",
    "width": 1920,
    "height": 1080,
    "quality": 95,
    "format": "jpeg",
    "outputDir": "/home/pi/timelapse"
  },
  {
    "id": "log-capture",
    "type": "debug",
    "name": "Timelapse Frame"
  }
]

Motion-Triggered Security Camera

Capture a photo when PIR sensor detects motion and send notification.

[
  {
    "id": "pir-sensor",
    "type": "gpio-in",
    "pin": 17,
    "edge": "rising"
  },
  {
    "id": "camera-snap",
    "type": "pi-camera",
    "mode": "photo",
    "width": 1280,
    "height": 720,
    "quality": 85,
    "rotation": "0",
    "outputDir": "/home/pi/security"
  },
  {
    "id": "send-alert",
    "type": "email",
    "to": "admin@example.com",
    "subject": "Motion Detected!"
  }
]

Record Video Clip on Demand

Trigger a 10-second video recording via dashboard button.

[
  {
    "id": "record-btn",
    "type": "ui-button",
    "label": "Record Clip"
  },
  {
    "id": "set-video-mode",
    "type": "change",
    "rules": [
      { "t": "set", "p": "payload.mode", "to": "video" },
      { "t": "set", "p": "payload.duration", "to": 10 }
    ]
  },
  {
    "id": "video-capture",
    "type": "pi-camera",
    "mode": "video",
    "width": 1280,
    "height": 720,
    "duration": 10,
    "outputDir": "/home/pi/clips"
  }
]

Common Use Cases

Security Monitoring

Capture images on motion detection and store or send alerts with attached photos.

Timelapse Recording

Schedule periodic captures for plant growth, weather, or construction monitoring.

Quality Inspection

Photograph products on an assembly line and feed images to AI vision models.

Remote Observation

Monitor wildlife, pets, or remote sites with on-demand photo and video capture.

Related Nodes