Use log crate for logging instead of println
All checks were successful
Core Repos/ImageApi/pipeline/head This commit looks good
Core Repos/ImageApi/pipeline/pr-master This commit looks good

This commit is contained in:
Cameron Cordes
2021-02-24 21:26:11 -05:00
parent 8b5ba9d48c
commit f9983240df
7 changed files with 86 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ use std::path::Path;
use std::process::{Child, Command, ExitStatus, Stdio};
use actix::prelude::*;
use log::{debug, trace};
// ffmpeg -i test.mp4 -c:v h264 -flags +cgop -g 30 -hls_time 3 out.m3u8
// ffmpeg -i "filename.mp4" -preset veryfast -c:v libx264 -f hls -hls_list_size 100 -hls_time 2 -crf 24 -vf scale=1080:-2,setsar=1:1 attempt/vid_out.m3u8
@@ -23,11 +24,11 @@ impl Handler<ProcessMessage> for StreamActor {
type Result = Result<ExitStatus>;
fn handle(&mut self, msg: ProcessMessage, _ctx: &mut Self::Context) -> Self::Result {
println!("Message received");
trace!("Message received");
let mut process = msg.1;
let result = process.wait();
println!(
debug!(
"Finished waiting for: {:?}. Code: {:?}",
msg.0,
result
@@ -40,7 +41,7 @@ impl Handler<ProcessMessage> for StreamActor {
pub fn create_playlist(video_path: &str, playlist_file: &str) -> Result<Child> {
if Path::new(playlist_file).exists() {
println!("Playlist already exists: {}", playlist_file);
debug!("Playlist already exists: {}", playlist_file);
return Err(std::io::Error::from(std::io::ErrorKind::AlreadyExists));
}