Added ability to configure the transcoding job with some parameters in dragoon.toml
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2022-05-02 23:46:21 -04:00
parent 12ab510224
commit 21ea8b3caf
2 changed files with 9 additions and 8 deletions

View File

@ -34,8 +34,9 @@ If you were paying attention to Dragoon's output, you would have noticed that it
# This example transcodes footage to DNxHD 1080p60 for use in video editors like DaVinci Resolve.
[transcoder]
repo_path = '~/videos' # location of the videos to transcode
video_format = 'mov' # video container format
video_codec = 'dnxhd' # video codec to use
video_format = 'scale=1920x1080,fps=60,format=yuv422p' # video format flag - this will be broken later into separate attributes
video_parameters = 'scale=1920x1080,fps=60,format=yuv422p' # video extra format parameters flag - this will be broken later into separate attributes
video_profile = 'dnxhr_hq' # DNxHD has multiple presets for various video qualities
audio_codec = 'pcm_s16le' # audio codec to use
```

View File

@ -24,9 +24,9 @@ public class Transcoder {
// only define the working directory; use default FFMPEG path
public Transcoder(Config config) {
this.config = config;
this.repo_dir = IOUtils.resolveTilda(config.getString("transcoder.repo_path"));
this.repo_dir = IOUtils.resolveTilda(this.config.getString("transcoder.repo_path"));
if (this.config.contains("transcoder.ffmpeg_path")) {
this.ffmpeg_path = config.getString("transcoder.ffmpeg_path");
this.ffmpeg_path = this.config.getString("transcoder.ffmpeg_path");
}
this.initDirectory();
}
@ -48,11 +48,11 @@ public class Transcoder {
String cmd = String.format("%s -i %s -y -f %s -c:v %s -vf %s -profile:v %s -c:a %s %s",
this.ffmpeg_path, // FFMPEG binary path
f.toString(), // input file
"mov",
"dnxhd", // video codec
"scale=1920x1080,fps=60,format=yuv422p", // video format
"dnxhr_hq", // video profile
"pcm_s16le", // audio codec
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
this.config.getString("transcoder.video_profile"), // video profile
this.config.getString("transcoder.audio_codec"), // audio codec
outputPath // output file path
);