Hi rust community! Well I am using rscam crate for capturing images.
It works well, here is the code;
use rscam::{Camera, Config};
use std::fs;
use std::io::Write;
fn main() {
let mut camera = rscam::new("/dev/video2").unwrap();
camera.start(&rscam::Config {
interval: (1, 30), // 30 fps.
resolution: (1280, 720),
format: b"MJPG",
..Default::default()
}).unwrap();
for i in 0..100 {
let frame = camera.capture().unwrap();
let mut file = fs::File::create(&format!("frame-{}.jpg", i)).unwrap();
file.write_all(&frame[..]).unwrap();
}
}
this capture images and saves them in my directory. Now i have a question.
Is there any crate which can help me collect all this images into a slideshow,or how can i make a 'video' with my capture images? (I was thinking to make a gif at first but maybe this is not the correct way).. any help ?