Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
egui-cameras is the egui integration for the cameras cross-platform camera library. It owns the thin glue between a running cameras::pump::Pump and an egui::TextureHandle, so you can render live camera frames as an egui::Image with a few lines of code.
Every camera-side primitive (pause / resume pump, single-frame capture, unified CameraSource, hotplug monitor) lives upstream in cameras itself and is re-exported from this crate for convenience.
Quick Start
[]
= "0.1"
= "0.1"
= "0.32"
use ;
use egui;
What's in the box
| Item | Purpose |
|---|---|
Stream |
Bundle of a Pump + Sink + TextureHandle. Holds everything one live camera needs. |
Sink |
Shared slot the pump writes each frame into. Cheap to clone. |
spawn(camera) -> Stream |
Convenience: spawn a pump and wire it to a fresh Stream with a default texture name. |
spawn_named(camera, name) -> Stream |
Like spawn, but lets you name the texture (useful for multi-camera apps). |
spawn_pump(camera, sink) -> Pump |
Lower-level: spawn a pump that writes into your own Sink. |
publish_frame(sink, frame) |
Write a frame into a sink (for custom pump code). |
take_frame(sink) -> Option<Frame> |
Pull the latest frame out of a sink. |
frame_to_color_image(frame) |
Convert a cameras Frame into an egui::ColorImage. |
update_texture(stream, ctx) |
Upload the latest frame to the stream's texture. Call each update tick. |
show(stream, ui) |
Draw the texture as an egui::Image scaled to fit the available area. |
Pump controls (set_active, capture_frame, stop_and_join) are re-exported directly from cameras::pump.
Pause + snapshot
The same pattern as dioxus-cameras: pause the pump when the user isn't looking, grab fresh frames on demand without closing the camera.
use ;
#
Features
| Feature | Default | Description |
|---|---|---|
rtsp |
off | Forwards to cameras/rtsp; enables CameraSource::Rtsp on macOS and Windows. |
Versioning
egui-cameras ships in lockstep with cameras and dioxus-cameras. All three crates share the same major + minor version (0.1.x). Match your Cargo.toml versions accordingly.
Demo
The egui-demo app in the parent repo exercises the full API: live preview, pause toggle, take-picture button.
License
Dual-licensed under MIT or Apache-2.0 at your option.