rscam
rscam copied to clipboard
Failing to create camera with EINVAL in mmap
I'm trying to use a PS Eye with a Raspberry pi, and when I try to run the example script in the docs, the mmap returns an OS Error (EINVAL
). The exact code adapted for acceptable framerates, resolutions, etc. is:
extern crate rscam;
use rscam::{Camera, Config};
fn main() {
let mut camera = Camera::new("/dev/video0").unwrap();
camera.start(&Config {
interval: (1, 30),
resolution: (320, 240),
format: b"RGB3",
..Default::default()
}).unwrap();
for i in 0..10 {
let frame = camera.capture().unwrap();
}
}
@porglezomp I know this is an old issue, but I just ran into #18, which seems like the same issue. Did you ever find a resolution to this?
Got it! See https://github.com/loyd/rscam/pull/31