Separated the resolution, color, and frame rate options in the config file
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2024-04-19 14:53:59 -04:00
parent 3e50146f5e
commit 73b15ce781

View File

@ -63,11 +63,18 @@ public class Transcoder {
String filename = Paths.get(filePath).getFileName().toString();
String outputPath = Paths.get(this.repo.getOutputPath(), String.format("%s.mov", filename)).toString();
// build the custom video parameters string
String videoParameters = String.format("scale=%s,fps=%s,format=%s",
this.config.getString("transcoder.video_resolution"), // video resolution
this.config.getString("transcoder.video_framerate"), // video frame rate
this.config.getString("transcoder.video_color") // video color format
);
String cmd = String.format("%s -i INPUT_FILE -y -f %s -c:v %s -vf %s -profile:v %s -c:a %s OUTPUT_FILE",
this.ffmpeg_path, // FFMPEG binary path
this.config.getString("transcoder.video_format"), // video container format
this.config.getString("transcoder.video_codec"), // video codec
this.config.getString("transcoder.video_parameters"), // video format
videoParameters, // custom video parameters
this.config.getString("transcoder.video_profile"), // video profile
this.config.getString("transcoder.audio_codec") // audio codec
);