2 Commits

Author SHA1 Message Date
12f81cb014 Version bump to v0.3.10
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2023-03-24 11:09:20 -04:00
8c0c52c736 Changed how the input and output files get added to the command array to better handle spaces in file names
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2023-02-18 22:49:18 -05:00
2 changed files with 9 additions and 6 deletions

View File

@ -6,7 +6,7 @@
<groupId>tech.bitgoblin</groupId> <groupId>tech.bitgoblin</groupId>
<artifactId>dragoon</artifactId> <artifactId>dragoon</artifactId>
<version>0.3.9</version> <version>0.3.10</version>
<name>Dragoon</name> <name>Dragoon</name>
<url>https://www.bitgoblin.tech</url> <url>https://www.bitgoblin.tech</url>

View File

@ -63,18 +63,21 @@ public class Transcoder {
String filename = Paths.get(filePath).getFileName().toString(); String filename = Paths.get(filePath).getFileName().toString();
String outputPath = Paths.get(this.repo.getOutputPath(), String.format("%s.mov", filename)).toString(); String outputPath = Paths.get(this.repo.getOutputPath(), String.format("%s.mov", filename)).toString();
String cmd = String.format("%s -i %s -y -f %s -c:v %s -vf %s -profile:v %s -c:a %s %s", 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.ffmpeg_path, // FFMPEG binary path
sourceFile.toString(), // input file
this.config.getString("transcoder.video_format"), // video container format this.config.getString("transcoder.video_format"), // video container format
this.config.getString("transcoder.video_codec"), // video codec this.config.getString("transcoder.video_codec"), // video codec
this.config.getString("transcoder.video_parameters"), // video format this.config.getString("transcoder.video_parameters"), // video format
this.config.getString("transcoder.video_profile"), // video profile this.config.getString("transcoder.video_profile"), // video profile
this.config.getString("transcoder.audio_codec"), // audio codec this.config.getString("transcoder.audio_codec") // audio codec
outputPath // output file path
); );
ProcessBuilder pb = new ProcessBuilder(cmd.split("\\s+")); String[] cmdArr = cmd.split("\\s+");
cmdArr[2] = sourceFile.toString();
cmdArr[cmdArr.length - 1] = outputPath;
System.out.println(String.join(" ", cmdArr));
ProcessBuilder pb = new ProcessBuilder(cmdArr);
pb.inheritIO(); // use the java processes' input and output streams pb.inheritIO(); // use the java processes' input and output streams
try { try {
Process process = pb.start(); Process process = pb.start();