Expand description
Fast wrapper for v4l2.
use rscam::{Camera, Config};
let mut camera = Camera::new("/dev/video0").unwrap();
camera.start(&Config {
interval: (1, 30), // 30 fps.
resolution: (1280, 720),
format: b"MJPG",
..Default::default()
}).unwrap();
for i in 0..10 {
let frame = camera.capture().unwrap();
let mut file = fs::File::create(&format!("frame-{}.jpg", i)).unwrap();
file.write_all(&frame[..]).unwrap();
}The wrapper uses v4l2 (e.g. v4l2_ioctl() instead of ioctl()) until feature no_wrapper is
enabled. The feature can be useful when it’s desirable to avoid dependence on libv4l2.
Modules§
Structs§
Enums§
Constants§
- Camera controls. Details.
- Motion or object detection controls. Details.
- Digital Video controls. Details.
- Flash device controls. Details.
- FM Receiver controls. Details.
- FM Transmitter controls. Details.
- Image processing controls. Details.
- low-level controls of image source. Details.
- JPEG compression controls. details.
- MPEG compression controls. Details.
- RF tuner controls. Details.
- User controls. Details.
- Both fields alternating into separate buffers.
- None, top, bottom or interplaced depending on whatever it thinks is approximate.
- Bottom field only.
- Both fields interplaced.
- Both fields interplaced, top field first and the bottom field is transmitted first.
- Both fields interplaced, top field first and the top field is transmitted first.
- This device has no fields.
- Both fields sequential into one buffer, bottom-top order.
- Both fields sequential into one buffer, top-bottom order.
- Top field only.
- This control is permanently disabled and should be ignored by the application.
- The value provided to the control will be propagated to the driver even if it remains constant. This is required when the control represents an action on the hardware. For example: clearing an error flag or triggering the flash.
- This control is temporarily unchangeable (e.g. another application controls resource).
- This control has a pointer type.
- This control is not applicable to the current configuration.
- This control is permanently readable only.
- A hint that this control is best represented as a slider-like element in a user interface.
- Changing this control may affect the value of other controls within the same control class.
- This control is volatile, which means that the value of the control changes continuously. A typical example would be the current gain value if the device is in auto-gain mode.
- This control is permanently writable only.
Traits§
Functions§
- Alias for
Camera::new().