From b8816b2db5385320a03c0ac0c61ac77005a41d79 Mon Sep 17 00:00:00 2001 From: looksg00d Date: Sun, 26 Jul 2026 09:26:42 +0300 Subject: [PATCH] fix(remotion): honor per-render duration/fps/dimensions via calculateMetadata The ShortVideo Composition hardcoded durationInFrames/fps/width/height from DEFAULT_PROPS. Since there was no calculateMetadata callback, selectComposition()/renderMedia() in render-service ignored whatever durationInFrames/fps/width/height was actually passed in inputProps at render time, always producing a fixed 900-frame (30s) 1080x1920 output regardless of the real clip length. Verified: rendered with durationInFrames=300 (10s) before this fix produced a 30s file (base video frozen on its last frame for the remaining ~20s). After adding calculateMetadata, output duration matches the requested frame count exactly. --- remotion/src/Root.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/remotion/src/Root.tsx b/remotion/src/Root.tsx index f45bee0..839e5cc 100644 --- a/remotion/src/Root.tsx +++ b/remotion/src/Root.tsx @@ -84,6 +84,12 @@ export const RemotionRoot: React.FC = () => { width={DEFAULT_PROPS.width} height={DEFAULT_PROPS.height} defaultProps={DEFAULT_PROPS} + calculateMetadata={({ props }) => ({ + durationInFrames: props.durationInFrames, + fps: props.fps, + width: props.width, + height: props.height, + })} /> );