Skip to main content

universal_screencast 0.3.1 copy "universal_screencast: ^0.3.1" to clipboard
universal_screencast: ^0.3.1 copied to clipboard

Declarative frame pipeline for automation targets: FrameSource (CDP screencast, paced polling) to FrameSink (binary WebSocket, MJPEG HTTP, file recorder) with fail-closed composition validation and au [...]

universal_screencast #

Declarative frame pipeline: FrameSource → FrameSink with fail-closed composition validation and audience policies. Frames are read-only observations — frames != semantics.

Part of the universal_automation_* family (ADR 0037). The invariants encode production-proven discipline (media-plane separation, SDK/product boundaries):

  • pacing and single-flight at the source;
  • per-sink isolation: a failing sink degrades alone (SinkDegraded);
  • source failure fails the pipeline and closes every sink with the error — error-frame-then-close, never silence;
  • slow sinks drop oldest frames instead of backpressuring the source.

Sources #

  • CdpScreencastFrameSource — damage-driven CDP frames with screencastFrameAck flow control.
  • PollingFrameSource — paced screenshot polling over any driver, single-flight by construction.

Sinks #

  • WebSocketFrameServer — binary frames (text meta + binary payload) with ?token= auth and error-frame-then-close semantics.
  • MjpegHttpSink — multipart MJPEG any browser can render in <img>.
  • FileRecorderSink — payload file + JSONL receipts (offset, revision, capturedAt) aligned with the recording/receipts contracts.

Audiences #

ScreencastAudience {agent, human, recorder} caps the pacing floor — agents get ≤5 fps keyframes, humans and recorders get up to 30 fps — and compositions that pair incompatible sinks with sources are rejected at construction.

Usage #

final pipeline = await ScreencastPipeline.start(
  ScreencastComposition(
    source: PollingFrameSource(() => grabJpeg(), interval: Duration(milliseconds: 250)),
    sinks: [wsServer, FileRecorderSink(directory: '/tmp/frames')],
    audiences: [ScreencastAudience.agent, ScreencastAudience.recorder],
  ),
);
pipeline.events.listen(print);
await pipeline.stop();

Non-claims #

  • No WebRTC transport yet — it arrives behind the same FrameSink interface in wave 3 (universal_webrtc), with the media plane separated from signaling from day one.
  • Frames are not semantic snapshots; use a driver's snapshot() for structure and frames for pixels only.
0
likes
0
points
934
downloads

Documentation

Documentation

Publisher

unverified uploader

Weekly Downloads

Declarative frame pipeline for automation targets: FrameSource (CDP screencast, paced polling) to FrameSink (binary WebSocket, MJPEG HTTP, file recorder) with fail-closed composition validation and audience policies.

Repository (GitHub)
View/report issues

Topics

#screencast #frames #pipeline #mjpeg

License

unknown (license)

Dependencies

meta, universal_automation_interface, universal_browser_cdp

More

Packages that depend on universal_screencast