Fixed output file naming; adding debug line so user knows that transcoding is taking place
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
3f71767acb
commit
3bcbabf1b6
@ -57,13 +57,20 @@ impl Transcoder {
|
|||||||
|
|
||||||
fn transcode(&self, file: &str) {
|
fn transcode(&self, file: &str) {
|
||||||
let ingest_file = Path::new(&self.repository.ingest_dir).join(file);
|
let ingest_file = Path::new(&self.repository.ingest_dir).join(file);
|
||||||
let output_file = Path::new(&self.repository.output_dir).join(file);
|
let video_format = &self.config.get_string("transcoder.video_format").unwrap();
|
||||||
|
let output_stem = Path::new(file).file_stem().unwrap();
|
||||||
|
let output_bits = vec![output_stem.to_str().unwrap(), &video_format];
|
||||||
|
let output_name = output_bits.join(".");
|
||||||
|
let output_file = Path::new(&self.repository.output_dir).join(output_name);
|
||||||
|
|
||||||
|
let video_codec = &self.config.get_string("transcoder.video_codec").unwrap();
|
||||||
|
info!("Transcoding {} to {} with the {} encoder.", ingest_file.display(), output_file.display(), video_codec);
|
||||||
|
|
||||||
let cmd_output = process::Command::new("/usr/bin/ffmpeg")
|
let cmd_output = process::Command::new("/usr/bin/ffmpeg")
|
||||||
.arg("-i") .arg(&*ingest_file.to_string_lossy())
|
.arg("-i") .arg(&*ingest_file.to_string_lossy())
|
||||||
.arg("-y")
|
.arg("-y")
|
||||||
.arg("-f") .arg(&self.config.get_string("transcoder.video_format").unwrap())
|
.arg("-f") .arg(&video_format)
|
||||||
.arg("-c:v") .arg(&self.config.get_string("transcoder.video_codec").unwrap())
|
.arg("-c:v") .arg(&video_codec)
|
||||||
.arg("-s") .arg(&self.config.get_string("transcoder.video_resolution").unwrap())
|
.arg("-s") .arg(&self.config.get_string("transcoder.video_resolution").unwrap())
|
||||||
.arg("-r") .arg(format!("{}", self.config.get_string("transcoder.video_framerate").unwrap()))
|
.arg("-r") .arg(format!("{}", self.config.get_string("transcoder.video_framerate").unwrap()))
|
||||||
.arg("-vf") .arg(format!("format={}", &self.config.get_string("transcoder.video_color").unwrap()))
|
.arg("-vf") .arg(format!("format={}", &self.config.get_string("transcoder.video_color").unwrap()))
|
||||||
|
Loading…
Reference in New Issue
Block a user