@@ -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