🎥 Make videos programmatically with React
Focus motion blur skill on HTML-in-canvas
JonnyBurgerc984d3ac6029
diff --git a/packages/skills/skills/remotion-markup/SKILL.md b/packages/skills/skills/remotion-markup/SKILL.mdindex 1b2ef9ded7..db3434ff03 100644--- a/packages/skills/skills/remotion-markup/SKILL.md+++ b/packages/skills/skills/remotion-markup/SKILL.md@@ -248,7 +248,7 @@ See [transitions.md](transitions.md) for scene transition patterns.## Motion blur-When adding motion blur or a movement trail, read [motion-blur.md](motion-blur.md) to choose the right component and handle preview support.+When adding motion blur or a movement trail, read [motion-blur.md](motion-blur.md) for the preferred HTML-in-canvas approach, preview requirements, and alternatives.## Visual and pixel effectsdiff --git a/packages/skills/skills/remotion-markup/motion-blur.md b/packages/skills/skills/remotion-markup/motion-blur.mdindex 7a54ba58f2..14b98c5b67 100644--- a/packages/skills/skills/remotion-markup/motion-blur.md+++ b/packages/skills/skills/remotion-markup/motion-blur.md@@ -1,25 +1,23 @@# Motion blur-Use `@remotion/motion-blur` for frame-driven motion blur. Install it with `npx remotion add @remotion/motion-blur`.+Use `@remotion/motion-blur` for frame-driven motion blur.+Install it with `npx remotion add @remotion/motion-blur`.-## Choose an approach--| Component | Use when | Tradeoff |-| -------------------------- | ----------------------------------------------------- | ------------------------------------------------ |-| `<HtmlInCanvasMotionBlur>` | You want the best result from sampled HTML pixels | Experimental Chrome support; more work per frame |-| `<CameraMotionBlur>` | You need camera-like blur in regular browser previews | Translucent layers can change colors and opacity |-| `<Trail>` | You want visible echoes or a stylized streak | It is a trail, not a camera exposure |--`<HtmlInCanvasMotionBlur>` is the state of the art in Remotion for blurring animated HTML. It captures the content at fractional frames and averages its pixels in a canvas. Prefer it when the preview browser supports HTML-in-canvas; use `<CameraMotionBlur>` when broader browser preview support matters.--All three components render multiple versions of their children at different times. Put the animation and its `useCurrentFrame()` call **inside** the blur component. Do not calculate the animated position in a parent and pass an already computed style into it. Use frame-driven animation, not CSS `animation` or `transition`.+`<HtmlInCanvasMotionBlur>` is the state of the art in Remotion for blurring animated HTML. It captures the content at fractional frames and averages its pixels in a canvas.## `<HtmlInCanvasMotionBlur>`-Available from Remotion 4.0.528. Supply the canvas `width` and `height`, usually from `useVideoConfig()`. `shutterAngle` defaults to `180` and accepts `0` to `360`; `0` disables blur. `samples` defaults to `8` and must be an integer from `1` to `64`. More samples can smooth the blur but increase preview and render cost.+Available from Remotion 4.0.529.+Supply the canvas `width` and `height`, usually from `useVideoConfig()`.+`shutterAngle` defaults to `180` and accepts `0` to `360`.+`0` disables blur. `samples` defaults to `8` and must be an integer from `1` to `64`. More samples can smooth the blur but increase preview and render cost.++Call `useCurrentFrame()` inside the child component so each sample receives its own frame.```tsx-import {HtmlInCanvasMotionBlur} from '@remotion/motion-blur';+import {+ HtmlInCanvasMotionBlur,+} from '@remotion/motion-blur';import {useCurrentFrame, useVideoConfig} from 'remotion';const MovingBox = () => {@@ -42,43 +40,21 @@ export const HtmlInCanvasBlur = () => {const {width, height} = useVideoConfig();return (- <HtmlInCanvasMotionBlur width={width} height={height} samples={8} shutterAngle={180}>+ <HtmlInCanvasMotionBlur+ width={width}+ height={height}+ samples={8}+ shutterAngle={180}+ ><MovingBox /></HtmlInCanvasMotionBlur>);};```-For live preview, use Chrome 149 or later and enable `chrome://flags/#canvas-draw-element`. Remotion's bundled Chrome enables the feature during rendering. Do not nest this component with another `<HtmlInCanvas>` component; nested HTML-in-canvas is unsupported. Tell the user about the preview requirement when choosing this variant.--The next examples reuse `MovingBox` from above.--## `<CameraMotionBlur>`--`shutterAngle` controls exposure length, from `0` to `360` degrees; the default is `180`. `samples` controls smoothness; the default is `10`. Start with 5 to 10 samples and inspect colors because this component blends translucent DOM layers. Absolutely position its children.--```tsx-import {CameraMotionBlur} from '@remotion/motion-blur';--export const CameraBlur = () => (- <CameraMotionBlur shutterAngle={180} samples={8}>- <MovingBox />- </CameraMotionBlur>-);-```--## `<Trail>`+For live preview, enable HTML-in-canvas in Chrome 149 or later with `chrome://flags/#canvas-draw-element`.+No configuration for rendering is necessary.-`layers` is the number of past copies, `lagInFrames` is the delay between copies and `trailOpacity` controls their strength. Absolutely position the content so copies do not affect each other's layout.--```tsx-import {Trail} from '@remotion/motion-blur';--export const MyComposition = () => (- <Trail layers={12} lagInFrames={0.15} trailOpacity={0.8}>- <MovingBox />- </Trail>-);-```+Do not nest `<HtmlInCanvas>` or `<HtmlInCanvasMotionBlur>` components; nested HTML-in-canvas is unsupported.-See the [motion blur guide](https://www.remotion.dev/docs/motion-blur-guide) and the [`<HtmlInCanvasMotionBlur>` reference](https://www.remotion.dev/docs/motion-blur/html-in-canvas-motion-blur).+If HTML-in-canvas is unavailable, see the [motion blur guide](https://www.remotion.dev/docs/motion-blur-guide) for other options. See the [`<HtmlInCanvasMotionBlur>` reference](https://www.remotion.dev/docs/motion-blur/html-in-canvas-motion-blur) for API details.