better error messages

This commit is contained in:
Sam Lavigne 2023-08-27 17:42:09 -04:00
parent b6488dcd6d
commit b6eea71e0a
1 changed files with 2 additions and 3 deletions

View File

@ -33,6 +33,7 @@
videoValue = null; videoValue = null;
rendering = true; rendering = true;
try { try {
if (log.trim() != '') log += "\n\n";
for (let vid of $inputs) { for (let vid of $inputs) {
await ffmpeg.writeFile(vid.name, await fetchFile("/" + vid.name)); await ffmpeg.writeFile(vid.name, await fetchFile("/" + vid.name));
} }
@ -44,14 +45,12 @@
.filter((i) => i.trim() != ""); .filter((i) => i.trim() != "");
clist.splice(clist.length - 1, 0, "-pix_fmt"); clist.splice(clist.length - 1, 0, "-pix_fmt");
clist.splice(clist.length - 1, 0, "yuv420p"); clist.splice(clist.length - 1, 0, "yuv420p");
console.log("command", clist);
await ffmpeg.exec(clist, TIMEOUT); await ffmpeg.exec(clist, TIMEOUT);
const data = await ffmpeg.readFile("out.mp4"); const data = await ffmpeg.readFile("out.mp4");
rendering = false; rendering = false;
videoValue = URL.createObjectURL(new Blob([data.buffer], { type: "video/mp4" })); videoValue = URL.createObjectURL(new Blob([data.buffer], { type: "video/mp4" }));
} catch (e) { } catch (e) {
console.log(e); log += e + "\n";
log += "Failed";
} }
rendering = false; rendering = false;
} }