Generate mp4 thumbnails
This commit is contained in:
15
src/video.rs
15
src/video.rs
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user