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.
This commit is contained in:
looksg00d 2026-07-26 09:26:42 +03:00 committed by juancarlos.cavero
parent d83e0dddbf
commit b8816b2db5

View file

@ -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,
})}
/>
</>
);