fixing undefined edges

This commit is contained in:
Sam Lavigne 2023-09-01 16:52:16 -04:00
parent 4552ff5b51
commit 8c345c6e63
1 changed files with 13 additions and 14 deletions

View File

@ -150,22 +150,21 @@ export const previewCommand = derived([edges, nodes], ([$edges, $nodes]) => {
}) })
.filter((m) => m !== null); .filter((m) => m !== null);
console.log(mediaMaps);
if (filtergraph.length > 0) { if (filtergraph.length > 0) {
let fg = `"${filtergraph.join(";")}"`; let fg = `"${filtergraph.join(";")}"`;
// this crazy thing replaces stuff like [1];[1] with a comma! // this crazy thing replaces stuff like [1];[1] with a comma!
fg = fg.replaceAll(/(\[\d+\]);\1(?!\[)/g, ","); fg = fg.replaceAll(/(\[\d+\]);\1(?!\[)/g, ",");
hasVid = fg.includes(":v]");
hasAud = fg.includes(":a]");
finalCommand.push("-filter_complex", fg); finalCommand.push("-filter_complex", fg);
if (hasAud) { if (fg.includes("[out_a]")) {
finalCommand.push("-map", '"[out_a]"'); finalCommand.push("-map", '"[out_a]"');
} }
if (hasVid) { if (fg.includes("[out_v]")) {
finalCommand.push("-map", '"[out_v]"'); finalCommand.push("-map", '"[out_v]"');
} }