Handle unbalanced quotes in ffmpeg arguments (fixes #119)
This commit is contained in:
@@ -66,7 +66,13 @@ public class VideoWriter implements FrameConsumer<RGBFrame> {
|
|||||||
|
|
||||||
String executable = settings.getExportCommand().isEmpty() ? findFFmpeg() : settings.getExportCommand();
|
String executable = settings.getExportCommand().isEmpty() ? findFFmpeg() : settings.getExportCommand();
|
||||||
LOGGER.info("Starting {} with args: {}", executable, commandArgs);
|
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 {
|
try {
|
||||||
process = new ProcessBuilder(cmdline).directory(outputFolder).start();
|
process = new ProcessBuilder(cmdline).directory(outputFolder).start();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user