Skip to content

Commit

Permalink
Merge pull request #278 from charlielee/issue-277
Browse files Browse the repository at this point in the history
Fix spaces in export path causes error #277
  • Loading branch information
charlielee committed Dec 16, 2020
2 parents 4bfe14e + cf349bb commit f495f14
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/main/ExportVideo/ExportVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,14 @@
global.projectInst.currentTake.confirmTake(false)
.then(() => {
Loader.hide();
ExportVideo.render(customArgumentsInput.value.split(" "), outputPath);

// The render method expects an array so convert input from string into array
// Regexes are to handle arguments in quotes
// https://stackoverflow.com/a/56119602
let argumentsArray = customArgumentsInput.value.match(/[^\s"']+|"([^"]*)"/gmi);
argumentsArray = argumentsArray.map((arg) => arg.replace(/"|'/g, ""));

ExportVideo.render(argumentsArray, outputPath);
});
}
});
Expand Down Expand Up @@ -222,13 +229,13 @@
"-y", // Overwrite output file if it already exists
"-framerate", frameRate,
"-start_number", startFrameNo,
"-i", framePath,
"-i", `\"${framePath}\"`,
"-frames:v", endFrameNo,
"-c:v", "libx264",
"-preset", preset,
"-crf", "17",
"-vf", "format=yuv420p",
exportPath,
`\"${exportPath}\"`,
"-hide_banner", // Hide FFmpeg library info from output
].join(" ");
}
Expand Down

0 comments on commit f495f14

Please sign in to comment.