Handle unbalanced quotes in ffmpeg arguments (fixes #119)

This commit is contained in:
Jonas Herzig
2018-06-10 13:12:42 +02:00
parent 62d2ce4b37
commit 1b9d430176

View File

@@ -66,7 +66,13 @@ public class VideoWriter implements FrameConsumer<RGBFrame> {
String executable = settings.getExportCommand().isEmpty() ? findFFmpeg() : settings.getExportCommand();
LOGGER.info("Starting {} with args: {}", executable, commandArgs);
String[] cmdline = new CommandLine(executable).addArguments(commandArgs).toStrings();
String[] cmdline;
try {
cmdline = new CommandLine(executable).addArguments(commandArgs).toStrings();
} catch (IllegalArgumentException e) {
LOGGER.error("Failed to parse ffmpeg command line:", e);
throw new FFmpegStartupException(settings, e.getLocalizedMessage());
}
try {
process = new ProcessBuilder(cmdline).directory(outputFolder).start();
} catch (IOException e) {