From e74fa87103e252c7e1c110252fc439c64a634e2b Mon Sep 17 00:00:00 2001 From: devdesk Date: Sat, 17 Feb 2024 16:59:29 +0200 Subject: [PATCH] fourcc wip --- examples/live.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/live.rs b/examples/live.rs index 2ff2c42..6f6e311 100644 --- a/examples/live.rs +++ b/examples/live.rs @@ -28,15 +28,15 @@ fn main() -> anyhow::Result<()> { const WIDTH: usize = 288; const HEIGHT: usize = 384; - + let fourcc_repr = [ + b'Y', // | 0b10000000 + b'1', b'6', b' ', + ]; + let fourcc = v4l::format::FourCC { repr: fourcc_repr }; let mut out = v4l::Device::with_path(output)?; // To find the fourcc code, use v4l2-ctl --list-formats-out /dev/video0 // (or read the source :) - let format = v4l::Format::new( - WIDTH as u32, - HEIGHT as u32, - v4l::format::FourCC::new(b"Y16 "), - ); + let format = v4l::Format::new(WIDTH as u32, HEIGHT as u32, fourcc); Output::set_format(&out, &format)?; // Setup Capture