log ffmpeg output and cleanup video creation
This commit is contained in:
52
src/video.rs
52
src/video.rs
@@ -1,7 +1,7 @@
|
||||
use crate::is_video;
|
||||
use actix::prelude::*;
|
||||
use futures::TryFutureExt;
|
||||
use log::{debug, info, trace, warn};
|
||||
use log::{debug, error, info, trace, warn};
|
||||
use std::io::Result;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::{Child, Command, ExitStatus, Stdio};
|
||||
@@ -251,60 +251,22 @@ impl Handler<GeneratePlaylistMessage> for PlaylistGenerator {
|
||||
.arg(playlist_file)
|
||||
.stdout(Stdio::null())
|
||||
.stderr(Stdio::piped())
|
||||
.status()
|
||||
.output()
|
||||
.inspect_err(|e| error!("Failed to run ffmpeg on child process: {}", e))
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
|
||||
.await;
|
||||
|
||||
// Hang on to the permit until we're done decoding and then explicitly drop
|
||||
drop(permit);
|
||||
|
||||
if let Ok(ref res) = ffmpeg_result {
|
||||
debug!("ffmpeg output: {:?}", res);
|
||||
}
|
||||
|
||||
ffmpeg_result
|
||||
});
|
||||
|
||||
Ok("meeee".to_string())
|
||||
// .spawn()
|
||||
// .expect("Failed to spawn ffmpeg process");
|
||||
|
||||
// .expect("Failed to spawn child process")
|
||||
// .wait()
|
||||
// .await
|
||||
// .inspect_err(|e| error!("Failed to wait on child process: {}", e));
|
||||
|
||||
/* .map(|exit_status| {
|
||||
debug!(
|
||||
"Finished waiting for playlist generate process for file '{}' with code: {}",
|
||||
video_file,
|
||||
exit_status
|
||||
);
|
||||
|
||||
exit_status.to_string()
|
||||
})
|
||||
*/
|
||||
|
||||
/* if let Some(stderr) = ffmpeg.stderr {
|
||||
tokio::spawn(async move {
|
||||
let mut reader = BufReader::new(stderr).lines();
|
||||
while let Ok(Some(line)) = reader.next_line().await {
|
||||
println!("ffmpeg line: {:?}", line);
|
||||
}
|
||||
});
|
||||
}*/
|
||||
|
||||
/* ffmpeg.wait().await.map(|exit_status| {
|
||||
debug!(
|
||||
"Finished waiting for playlist generate process for file '{}' with code: {}",
|
||||
video_file, exit_status
|
||||
);
|
||||
|
||||
exit_status.to_string()
|
||||
})
|
||||
*/
|
||||
// ffmpeg
|
||||
// .wait_with_output()
|
||||
// .await
|
||||
// .expect("TODO: panic message")
|
||||
//
|
||||
// Ok(video_file)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user