π₯ Make videos programmatically with React
documentation and skills updates
JonnyBurger545089225117
diff --git a/packages/docs/docs/light-leaks/light-leak.mdx b/packages/docs/docs/light-leaks/light-leak.mdxindex 36ef8ad05e..55149a9e76 100644--- a/packages/docs/docs/light-leaks/light-leak.mdx+++ b/packages/docs/docs/light-leaks/light-leak.mdx@@ -36,7 +36,7 @@ Apart from the props listed below, all props from [`<Sequence>`](/docs/sequence)The duration of the light leak effect in frames. The effect reveals during the first half and retracts during the second half.During the midpoint, the light leak will cover most of the canvas.-If not specified, defaults to the duration of the composition (from `useVideoConfig()`).+If not specified, defaults to the duration of the composition or sequence, reading from [`useVideoConfig()`](/docs/use-video-config).### `seed?`diff --git a/packages/docs/docs/use-video-config.mdx b/packages/docs/docs/use-video-config.mdxindex c6ec620895..b1de8ce776 100644--- a/packages/docs/docs/use-video-config.mdx+++ b/packages/docs/docs/use-video-config.mdx@@ -42,7 +42,8 @@ The frame rate of the composition, in frames per seconds.### `durationInFrames`-The duration of the composition in frames or the `durationInFrames` of a [`<Sequence>`](/docs/sequence) if the component that calls `useVideoConfig()` is a child of a [`<Sequence>`](/docs/sequence) that defines a `durationInFrames`.+If inside a [`<Sequence>`](/docs/sequence), the duration of the sequence in frames.+If not inside a [`<Sequence>`](/docs/sequence), the duration of the composition in frames.### `id`diff --git a/packages/skills/skills/remotion/rules/light-leaks.md b/packages/skills/skills/remotion/rules/light-leaks.mdnew file mode 100644index 0000000000..d2d386a2bc--- /dev/null+++ b/packages/skills/skills/remotion/rules/light-leaks.md@@ -0,0 +1,71 @@+---+name: light-leaks+description: Light leak overlay effects for Remotion using @remotion/light-leaks.+metadata:+ tags: light-leaks, overlays, effects, transitions+---++## Light Leaks++`<LightLeak>` from `@remotion/light-leaks` renders a WebGL-based light leak effect. It reveals during the first half of its duration and retracts during the second half.++Typically used inside a `<TransitionSeries.Overlay>` to play over the cut point between two scenes. See the **transitions** rule for `<TransitionSeries>` and overlay usage.++## Prerequisites++```bash+npx remotion add @remotion/light-leaks+```++## Basic usage with TransitionSeries++```tsx+import { TransitionSeries } from "@remotion/transitions";+import { LightLeak } from "@remotion/light-leaks";++<TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={60}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Overlay durationInFrames={30}>+ <LightLeak />+ </TransitionSeries.Overlay>+ <TransitionSeries.Sequence durationInFrames={60}>+ <SceneB />+ </TransitionSeries.Sequence>+</TransitionSeries>;+```++## Props++- `durationInFrames?` β defaults to the parent sequence/composition duration. The effect reveals during the first half and retracts during the second half.+- `seed?` β determines the shape of the light leak pattern. Different seeds produce different patterns. Default: `0`.+- `hueShift?` β rotates the hue in degrees (`0`β`360`). Default: `0` (yellow-to-orange). `120` = green, `240` = blue.++## Customizing the look++```tsx+import { LightLeak } from "@remotion/light-leaks";++// Blue-tinted light leak with a different pattern+<LightLeak seed={5} hueShift={240} />;++// Green-tinted light leak+<LightLeak seed={2} hueShift={120} />;+```++## Standalone usage++`<LightLeak>` can also be used outside of `<TransitionSeries>`, for example as a decorative overlay in any composition:++```tsx+import { AbsoluteFill } from "remotion";+import { LightLeak } from "@remotion/light-leaks";++const MyComp: React.FC = () => (+ <AbsoluteFill>+ <MyContent />+ <LightLeak durationInFrames={60} seed={3} />+ </AbsoluteFill>+);+```diff --git a/packages/skills/skills/remotion/rules/transitions.md b/packages/skills/skills/remotion/rules/transitions.mdindex dcdae08c3e..91ef8bd859 100644--- a/packages/skills/skills/remotion/rules/transitions.md+++ b/packages/skills/skills/remotion/rules/transitions.md@@ -1,25 +1,26 @@---name: transitions-description: Fullscreen scene transitions for Remotion.+description: Scene transitions and overlays for Remotion using TransitionSeries.metadata:- tags: transitions, fade, slide, wipe, scenes+ tags: transitions, overlays, fade, slide, wipe, scenes----## Fullscreen transitions+## TransitionSeries-Using `<TransitionSeries>` to animate between multiple scenes or clips.-This will absolutely position the children.+`<TransitionSeries>` arranges scenes and supports two ways to enhance the cut point between them:-## Prerequisites+- **Transitions** (`<TransitionSeries.Transition>`) β crossfade, slide, wipe, etc. between two scenes. Shortens the timeline because both scenes play simultaneously during the transition.+- **Overlays** (`<TransitionSeries.Overlay>`) β render an effect (e.g. a light leak) on top of the cut point without shortening the timeline.++Children are absolutely positioned.-First, the @remotion/transitions package needs to be installed.-If it is not, use the following command:+## Prerequisites```bashnpx remotion add @remotion/transitions```-## Example usage+## Transition example```tsximport { TransitionSeries, linearTiming } from "@remotion/transitions";@@ -39,32 +40,71 @@ import { fade } from "@remotion/transitions/fade";</TransitionSeries>;```-## Overlays+## Overlay example-`<TransitionSeries.Overlay>` renders children on top of the junction between two sequences **without** shortening the timeline. The overlay is centered on the cut point by default.+Any React component can be used as an overlay. For a ready-made effect, see the **light-leaks** rule.```tsx+import { TransitionSeries } from "@remotion/transitions";+import { LightLeak } from "@remotion/light-leaks";+<TransitionSeries><TransitionSeries.Sequence durationInFrames={60}><SceneA /></TransitionSeries.Sequence><TransitionSeries.Overlay durationInFrames={20}>- <LightLeakEffect />+ <LightLeak />+ </TransitionSeries.Overlay>+ <TransitionSeries.Sequence durationInFrames={60}>+ <SceneB />+ </TransitionSeries.Sequence>+</TransitionSeries>;+```++## Mixing transitions and overlays++Transitions and overlays can coexist in the same `<TransitionSeries>`, but an overlay cannot be adjacent to a transition or another overlay.++```tsx+import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { fade } from "@remotion/transitions/fade";+import { LightLeak } from "@remotion/light-leaks";++<TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={60}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Overlay durationInFrames={30}>+ <LightLeak /></TransitionSeries.Overlay><TransitionSeries.Sequence durationInFrames={60}><SceneB /></TransitionSeries.Sequence>-</TransitionSeries>+ <TransitionSeries.Transition+ presentation={fade()}+ timing={linearTiming({ durationInFrames: 15 })}+ />+ <TransitionSeries.Sequence durationInFrames={60}>+ <SceneC />+ </TransitionSeries.Sequence>+</TransitionSeries>;```-Props:+## Transition props-- `durationInFrames`: How long the overlay is visible (positive integer).-- `offset?`: Shifts the overlay relative to the cut point center. Positive = later, negative = earlier. Default: `0`.+`<TransitionSeries.Transition>` requires:-Overlays do **not** subtract from the total duration. An overlay cannot be adjacent to a transition or another overlay.+- `presentation` β the visual effect (e.g. `fade()`, `slide()`, `wipe()`).+- `timing` β controls speed and easing (e.g. `linearTiming()`, `springTiming()`).-## Available Transition Types+## Overlay props++`<TransitionSeries.Overlay>` accepts:++- `durationInFrames` β how long the overlay is visible (positive integer).+- `offset?` β shifts the overlay relative to the cut point center. Positive = later, negative = earlier. Default: `0`.++## Available transition typesImport transitions from their respective modules:@@ -76,9 +116,7 @@ import { flip } from "@remotion/transitions/flip";import { clockWipe } from "@remotion/transitions/clock-wipe";```-## Slide Transition with Direction--Specify slide direction for enter/exit animations.+## Slide transition with direction```tsximport { slide } from "@remotion/transitions/slide";@@ -91,7 +129,7 @@ import { slide } from "@remotion/transitions/slide";Directions: `"from-left"`, `"from-right"`, `"from-top"`, `"from-bottom"`-## Timing Options+## Timing options```tsximport { linearTiming, springTiming } from "@remotion/transitions";@@ -105,14 +143,14 @@ springTiming({ config: { damping: 200 }, durationInFrames: 25 });## Duration calculation-Transitions overlap adjacent scenes, so the total composition length is **shorter** than the sum of all sequence durations.+Transitions overlap adjacent scenes, so the total composition length is **shorter** than the sum of all sequence durations. Overlays do **not** affect the total duration.For example, with two 60-frame sequences and a 15-frame transition:- Without transitions: `60 + 60 = 120` frames- With transition: `60 + 60 - 15 = 105` frames-The transition duration is subtracted because both scenes play simultaneously during the transition.+Adding an overlay between two other sequences does not change the total.### Getting the duration of a transition