diff --git a/src-lib/src/video.rs b/src-lib/src/video.rs index 6ca64f9..deef8e8 100644 --- a/src-lib/src/video.rs +++ b/src-lib/src/video.rs @@ -1,12 +1,12 @@ use std::str::FromStr; use core::cmp::Ordering; use std::fs; +use std::path::Path; pub fn clipify(input: &String) -> Result, String> { match inspect(input) { Ok(inspection) => { let output_d = format!("{}.d", input); - fs::create_dir_all(&output_d).unwrap(); let ext = input.split(".").last().unwrap(); let mut result = vec![]; for i in 0..inspection.len() { @@ -21,6 +21,7 @@ pub fn clipify(input: &String) -> Result, String> { } pub fn clip(output: &String, input: &String, content_span: ContentSpan) -> Result<(), String> { + fs::create_dir_all(Path::new(output).parent().unwrap()).unwrap(); match std::process::Command::new("ffmpeg") .args([ "-y",