Hi There
i am trying to run it on window 10 and i get an error
Here is it the code
// first camera in system
let index = CameraIndex::Index(0);
// request the absolute highest resolution CameraFormat that can be decoded to RGB.
let requested = RequestedFormat::new::<RgbFormat>(RequestedFormatType::AbsoluteHighestFrameRate);
// make the camera
let mut camera = Camera::new(index, requested).unwrap();
// get a frame
camera.stop_stream().unwrap();
camera.open_stream().unwrap();
let frame = camera.frame().unwrap();
camera.stop_stream().unwrap();
println!("Captured Single Frame of {}", frame.buffer().len());
// decode into an ImageBuffer
let decoded = frame.decode_image::<RgbFormat>().unwrap();
println!("Decoded Frame of {}", decoded.len());
decoded.save("cam.jpeg").unwrap(); <-- this is the line that causes the error
The error is
thread 'main' panicked at src\main.rs:24:34:
called `Result::unwrap()` on an `Err` value: Unsupported(UnsupportedError { format: Unknown, kind: Format(Name("Jpeg")) })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\rscam.exe` (exit code: 101)
i have traced it down to this part of the code...
Where its does not match the format...
#[allow(unused_variables)]
// Most variables when no features are supported
pub(crate) fn write_buffer_impl<W: std::io::Write + Seek>(
buffered_write: &mut W,
buf: &[u8],
width: u32,
height: u32,
color: ExtendedColorType,
format: ImageFormat,
) -> ImageResult<()> {
match format {
Hi There i am trying to run it on window 10 and i get an error Here is it the code
The error is
i have traced it down to this part of the code... Where its does not match the format...
Hope this help :-)