Dynamically set `width` and `height` & FPS #808
tomByrer posted onGitHub
Edit by @JonnyBurger:
š This issue is part of our Hacktoberfest campaign! š Read more about Hacktoberfest here ā This issue is currently assigned to @exitflynn!
Hacktoberfest acceptance criteria:
- Should introduce new
height
andwidth
flags forrenderMediaOnLambda()
andrenderStillOnLambda()
(it is not required forrenderMedia()
andrenderStill()
since you can override thecomposition
object) - Should introduce a new
--height
and--width
flag to be used for thenpx remotion render
,npx remotion still
,npx remotion lambda render
andnpx remotion lambda still
commands. - These flags will override the width and height of the render regardless of what was passed to
<Composition>
. - Some restrictions apply: For h264 videos, the dimensions must be even (divisible by 2), must be integer and not negative. This is currently validated and one should not be able to bypass that validation
- Document the feature in all API pages where those options can be passed
Original issue:
Use Case
Rapidly changing FPS & video size for:
- local development vs final product
- multiple hosting target sizers (eg Social media)
- dynamic <Player> playback (Responsive, keep in sync with imbedded video)
- Changing FPS when source data is in seconds (eg WebVTT)
Problem
While it is clear Remotion uses Frames and FramesPerSecond for time, & pixels for size, these are inconvenient standards for dynamic situations. For example, the movie producer, SEO professional, etc who wants to change the video size & rate easily can not when the components hard-coded.
While everyone could hard-code their own way of handling translations, it would hinder sharing components & complicate development.
Possible Solutions
Unsure best way forward; here is a brainstorm of easiest to complex implementation:
- Document better, with more examples of dynamic sizes/FPS
- Standardized helper functions, eg
secondsToFrames()
,viewhightToPixels()
(I'm about to try this) - Remotion bakes in automatic conversions similar to CSS units (
interpolate(frame, [0, 2sec], [15vw, 50vw])
)
Fund this Issue
Rewarded pull request
Click to copy link
Recent activities