Repository navigation
@remotion/media: Add effect output size to <Video> - #11436
alec-watts wants to merge 4 commits into
Conversation
Avoid redraws from inline size objects and make internal absence explicit with nullable parameters. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the nullable default on the before composition so the comparison remains accurate. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
ℹ️ No critical issues — one minor simplification inline.
Reviewed changes
- New
effectsOutputSize?prop —<Video>accepts{width, height}; the public prop is optional, while the internal inputs (InnerVideoProps,MediaPlayer,videoIteratorManager,VideoForRendering) are required and nullable, matching the repo's convention. resolveEffectsOutputSize()— resolves the effect canvas size from the prop, defaulting to the source frame dimensions, rounding to whole pixels, and throwing on non-finite / non-positive values.- Effect canvas is now sized to the resolved output —
paintFrameresizes the preview canvas and passes the resolved size torunEffectChain; the rendering extraction callback resizes the canvas and runs the chain at that size. Wheneffectsis empty both paths keep the frame dimensions, so the prop is inert as documented. - Preview redraw wiring —
getEffectsOutputSizeis read through a ref, and the redraw effect depends oneffectsOutputSize?.width/heightso changing the prop repaints the retained frame. - Docs, example, tests — new docs section with before/after images, an
EffectsTestbedcomposition, a unit test forresolveEffectsOutputSize, a preview browser test, and a web-renderer test asserting effectapplyreceives the requested size. AllMediaPlayer/videoIteratorManagercall sites (including the CI-failingpremount-arm-kicks-schedulerfixture) were updated.
DeepSeek Flash | 𝕏
| effectsOutputSize: | ||
| effectsOutputSize?.width === undefined || | ||
| effectsOutputSize?.height === undefined | ||
| ? null | ||
| : { | ||
| width: effectsOutputSize.width, | ||
| height: effectsOutputSize.height, | ||
| }, |
There was a problem hiding this comment.
This conditional is unreachable for typed callers: effectsOutputSize is declared EffectsOutputSize | null with required width/height, so it is either null or a complete object. Passing it straight through is equivalent.
Worth noting it also creates a split behavior: a malformed JS value like {width: 100} is silently treated as omitted here, while the preview path (videoIteratorManager → resolveEffectsOutputSize) throws for the same input. Simplifying here keeps the two paths aligned (both validate via resolveEffectsOutputSize).
| effectsOutputSize: | |
| effectsOutputSize?.width === undefined || | |
| effectsOutputSize?.height === undefined | |
| ? null | |
| : { | |
| width: effectsOutputSize.width, | |
| height: effectsOutputSize.height, | |
| }, | |
| effectsOutputSize, |
|
Validation update: all build matrices, lint/formatting, monorepo tests, web-renderer tests, Lambda integration, SSR, template integration and both Vercel deployments passed. The remaining failure is Browser tests, specifically the existing I attempted a failed-job rerun, but GitHub rejected it with “Must have admin rights to Repository.” A maintainer needs to rerun this apparent CI-only flake; Required CI remains red until then. I have not changed the test or CI configuration to conceal it. @JonnyBurger: this is non-draft and includes the original review fixes. The formal reviewer request was also denied by repository permissions. |
|
@alec-watts This seems like a reasonable option, but I think this should not be Would you be willing to do these other parts as well? |
|
I don't think this should (only) live on |
@remotion/media: Add effect output size to <Video>remotion: Add effectsOutputSize to all effect-capable components
remotion: Add effectsOutputSize to all effect-capable components@remotion/media: Add effect output size to <Video>

Superseded by #12178, which implements the maintainer-requested
effectsOutputSizeAPI across all effect-capable components and documents it on the shared effects page.This closed PR's recorded diff is the earlier Video-only implementation. GitHub rejected reopening it after the branch was updated, so the revised work is published on a new feature branch in #12178. That replacement includes current main, native multi-component render/export verification, WebGL orientation checks, paused-preview resizing without decoder restart, and cancellation/resource cleanup coverage.