Skip to content

Commit 0557bab

Browse files
committed
fiiiiixed
1 parent 2098ba9 commit 0557bab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/server/compositor/compositor.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ async function zipDir(dir:string, out:string) {
4343
})
4444
}
4545

46-
async function framesToMp4(loc:string, format:string, framerate:number) {
46+
async function framesToMp4(id:string, format:string, framerate:number) {
4747
console.log("ffmpeg frame converting");
4848
return new Promise((resolve, reject) => {
4949
const ffmpeg = spawn("ffmpeg", ["-framerate", `${framerate}`,
50-
"-i", `"${path.join(loc, "raw", `frame-%d.${format}`)}"`,
51-
path.join(loc, "finished", "final.mp4")]);
52-
50+
`-i`, `data/renders/${id}/raw/frame-%d.PNG`,
51+
`data/renders/${id}/finished/out.mp4`]);
52+
5353
ffmpeg.stdout.on("data", data => {
5454
console.log(data.toString());
5555
});
@@ -96,7 +96,7 @@ export async function compositeRender(ctx:Context, projectid:string | number) {
9696
if(renderdata.animation) { // if it is an animation
9797
// we need to combine the frames into a video now
9898
let [fps, fpsbase] = fs.readFileSync(path.join(constants.DATA_DIR, constants.RENDERS_DIR, `${project.id}`, "renderdata")).toString().split("\n").map(s => parseInt(s));
99-
await framesToMp4(path.join(constants.DATA_DIR, constants.RENDERS_DIR, `${project.id}`), format, fps * fpsbase); // ok lets stitch
99+
await framesToMp4(`${project.id}`, format, fps * fpsbase); // ok lets stitch
100100
} else {
101101
// rename image and dump it in
102102
fs.renameSync(path.join(constants.DATA_DIR, constants.RENDERS_DIR, `${project.id}`, "raw", `frame-${renderdata.framestart}.${format}`), path.join(finishedPath, `final.${format}`));

0 commit comments

Comments
 (0)