diff --git a/src/main.rs b/src/main.rs index ae4bb94..0fc5437 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,8 @@ use crossterm::{ execute, terminal::{disable_raw_mode, enable_raw_mode, Clear, ClearType}, }; + +use std::env; use std::io; fn map_range(from_range: (i32, i32), to_range: (i32, i32), s: i32) -> i32 { @@ -46,11 +48,6 @@ fn find_colors(frame: &Mat, gray: &Mat, table: &str, table_len: usize) -> Result } fn main() -> Result<()> { - enable_raw_mode().unwrap(); - - let mut stdout = io::stdout(); - - execute!(stdout, terminal::EnterAlternateScreen).unwrap(); let mut is_paused = false; let mut time_multiplier = 1.0; @@ -61,16 +58,30 @@ fn main() -> Result<()> { let term_size = crossterm::terminal::size().unwrap(); - let mut cam = videoio::VideoCapture::from_file("baby-shark.webm", videoio::CAP_ANY)?; + let args: Vec = env::args().collect(); + + if args.len() < 2 { + println!("Usage: {}