Generate mp4 thumbnails

This commit is contained in:
Cameron Cordes
2020-07-16 21:24:10 -04:00
parent a49619c98c
commit 7dbd93cedc
2 changed files with 23 additions and 2 deletions

View File

@@ -32,3 +32,18 @@ pub fn create_playlist(video_path: &str, playlist_file: &str) {
println!("{:?}", result);
println!("Status: {}", String::from_utf8(result.stdout).unwrap())
}
pub fn generate_video_thumbnail(path: &Path, destination: &Path) {
Command::new("ffmpeg")
.arg("-ss")
.arg("3")
.arg("-i")
.arg(path.to_str().unwrap())
.arg("-vframes")
.arg("1")
.arg("-f")
.arg("image2")
.arg(destination)
.output()
.expect("Failure to create video frame");
}