🎥 Make videos programmatically with React
`@remotion/renderer`: Fix render progress going backwards in encoding stage
Jonny Burgerc166adaa7ea6
diff --git a/packages/renderer/src/render-media.ts b/packages/renderer/src/render-media.tsindex effc40ccc1..bc44144b80 100644--- a/packages/renderer/src/render-media.ts+++ b/packages/renderer/src/render-media.ts@@ -253,6 +253,7 @@ export const internalRenderMedia = ({let stitcherFfmpeg: ExecaChildProcess<string> | undefined;let preStitcher: Await<ReturnType<typeof prespawnFfmpeg>> | null = null;let encodedFrames = 0;+ let muxedFrames = 0;let renderedFrames = 0;let renderedDoneIn: number | null = null;let encodedDoneIn: number | null = null;@@ -355,16 +356,15 @@ export const internalRenderMedia = ({const callUpdate = () => {onProgress?.({encodedDoneIn,- encodedFrames,+ encodedFrames: Math.round(0.5 * encodedFrames + 0.5 * muxedFrames),renderedDoneIn,renderedFrames,stitchStage,- progress:- Math.round(- ((0.7 * renderedFrames + 0.3 * encodedFrames) /- composition.durationInFrames) *- 100- ) / 100,+ progress: Math.round(+ (70 * renderedFrames + 15 * encodedFrames + 15 * muxedFrames) /+ 100 /+ composition.durationInFrames+ ),});};@@ -586,7 +586,12 @@ export const internalRenderMedia = ({assetsInfo,onProgress: (frame: number) => {stitchStage = 'muxing';- encodedFrames = frame;+ if (preEncodedFileLocation) {+ muxedFrames = frame;+ } else {+ encodedFrames = frame;+ }+callUpdate();},onDownload,