Skip to content

Dynamic video duration with nextJS and lambda #992

Answered by JonnyBurger
Wtiben asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Wtiben! Sorry for the slow response, I admit it slipped through the cracks!

The answer is that yes, there is a performance penalty since this code is executed in every chunk. Usually it is bearable but if the render needs to be highly optimized, you need to determine the duration of the video by other means. I usually recommend to use the FFMPEG library to do so using ffmpeg -i [video-file].

This can then be passed into the Remotion render using input props https://www.remotion.dev/docs/parametrized-rendering#input-props to avoid having to fetch the asset in every chunk.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Wtiben
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants