| Crates.io | bevy_webcam |
| lib.rs | bevy_webcam |
| version | 0.4.0 |
| created_at | 2025-07-08 02:31:47.801304+00 |
| updated_at | 2026-01-15 18:25:45.9509+00 |
| description | bevy webcam plugin |
| homepage | https://github.com/mosure/bevy_webcam |
| repository | https://github.com/mosure/bevy_webcam |
| max_upload_size | |
| id | 1741977 |
| size | 167,337 |
bevy camera input, using the nokhwa crate
app.add_plugins((
DefaultPlugins,
BevyWebcamPlugin::default(),
));
app.add_systems(
Update,
setup_ui,
);
// ...
fn setup_ui(
mut commands: Commands,
stream: Res<WebcamStream>,
) {
commands.spawn(Camera2d);
commands.spawn((
ImageNode {
image: stream.frame.clone(),
..default()
},
Node {
width: Val::Percent(100.0),
height: Val::Percent(100.0),
..default()
},
));
}
nokhwa's native backendsUpdate stage stays responsiveMediaStreamTrackProcessor feeding pixels into the exported frame_input bindingwww/index.html acquires the webcam stream with getUserMedia, processes frames with MediaStreamTrackProcessor, and forwards RGBA pixels into the wasm module via frame_input. The Bevy plugin simply consumes those frames each Update, so there is no blocking nokhwa path on the browser.CameraIndex setting currently applies to native builds only.