Media Actors

Reflow provides native media actors for handling image, audio, and video input in workflows. These actors accept media data (raw bytes or URLs), extract metadata, and pass the enriched data downstream.

Actors

ImageInputActor (tpl_image_input)

Handles image input with metadata extraction.

Template ID: tpl_image_input

Ports:

  • Input: In — image data (binary or URL)
  • Output: Out — image with extracted metadata, Error

Extracted metadata:

  • Dimensions (width, height)
  • Format (JPEG, PNG, WebP, etc.)
  • File size
  • EXIF data (when available)

AudioInputActor (tpl_audio_input)

Handles audio input with metadata extraction.

Template ID: tpl_audio_input

Ports:

  • Input: In — audio data (binary or URL)
  • Output: Out — audio with extracted metadata, Error

Extracted metadata:

  • Duration
  • Format (MP3, WAV, OGG, etc.)
  • Sample rate
  • Channels
  • File size

VideoInputActor (tpl_video_input)

Handles video input with metadata extraction.

Template ID: tpl_video_input

Ports:

  • Input: In — video data (binary or URL)
  • Output: Out — video with extracted metadata, Error

Extracted metadata:

  • Duration
  • Resolution (width, height)
  • Format/codec
  • Frame rate
  • File size

CameraCaptureActor (tpl_camera_capture)

Produces a live video/raw-rgba stream from either a deterministic test-pattern source or, when compiled with native camera support, a platform camera device.

Template ID: tpl_camera_capture

Ports:

  • Input: start, stop
  • Output: stream, metadata, error

Common config:

  • backend: mock by default; use native or nokhwa when the camera-native feature is enabled
  • deviceId: camera index or device identifier
  • width, height, fps: requested capture format
  • frameCount: number of frames to emit; 0 means continuous capture
  • bufferSize: stream backpressure buffer size

Usage in Workflows

Media actors are registered as Zeal templates and appear in the Zeal IDE palette under the "reflow" category. They can be connected to other actors in a workflow graph:

[CameraCaptureActor] → [VideoStreamToFramesActor] → [ImageToTensorActor] → [RunInferenceActor]

Template Registration

Media actors are registered alongside other native actors during ZIP session startup. Each gets a template entry with:

#![allow(unused)]
fn main() {
NodeTemplate {
    id: "tpl_image_input",
    type_name: "tpl_image_input",
    title: "image input",
    category: "reflow",
    icon: "cpu",
    runtime: Some(RuntimeRequirements {
        executor: "reflow",
        // ...
    }),
}
}

Next Steps