Skip to content

ahmedmaknessi/sum-of-parts / .claude/skills/remotion-best-practices

remotion-best-practices

Verified

Router for all Remotion skills

FileKindSize
SKILL.mdskill md4.1 KB
agents/openai.yamlconfig311 B
assets/remotion-icon.svgother1.3 KB
remotion-captions/REFERENCE.mdmarkdown1.1 KB
remotion-captions/agents/openai.yamlconfig305 B
remotion-captions/assets/remotion-icon.svgother1.3 KB
remotion-captions/display-captions.mdmarkdown3.3 KB
remotion-captions/import-srt-captions.mdmarkdown2.2 KB
remotion-captions/transcribe-captions.mdmarkdown5.1 KB
remotion-create/REFERENCE.mdmarkdown2.9 KB
remotion-create/agents/openai.yamlconfig310 B
remotion-create/assets/remotion-icon.svgother1.3 KB
remotion-create/tailwind.mdmarkdown386 B
remotion-create/video-layout.mdmarkdown498 B
remotion-docs/REFERENCE.mdmarkdown1.3 KB
remotion-docs/agents/openai.yamlconfig307 B
remotion-docs/assets/remotion-icon.svgother1.3 KB
remotion-interactivity/REFERENCE.mdmarkdown18.3 KB
remotion-interactivity/agents/openai.yamlconfig320 B
remotion-interactivity/assets/remotion-icon.svgother1.3 KB
remotion-interactivity/inline-effects.mdmarkdown993 B
remotion-maps/REFERENCE.mdmarkdown1.0 KB
remotion-maps/agents/openai.yamlconfig293 B
remotion-maps/assets/remotion-icon.svgother1.3 KB
remotion-maps/techniques/cesium/TECHNIQUE.mdmarkdown3.8 KB
remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsxother8.7 KB
remotion-maps/techniques/cesium/assets/cesium-path.jsonconfig12.0 KB
remotion-maps/techniques/cesium/assets/city-path.jsonconfig223 B
remotion-maps/techniques/cesium/assets/example-Root.tsxother923 B
remotion-maps/techniques/cesium/assets/flight-path.tsscript1.2 KB
remotion-maps/techniques/cesium/assets/sample-river.geojsonother6.3 KB
remotion-maps/techniques/cesium/references/3d-data-sources.mdmarkdown1.4 KB
remotion-maps/techniques/cesium/references/3d-flyover-architecture.mdmarkdown7.7 KB
remotion-maps/techniques/cesium/references/3d-troubleshooting.mdmarkdown6.6 KB
remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjsscript5.4 KB
remotion-maps/techniques/mapbox/TECHNIQUE.mdmarkdown12.8 KB
remotion-maps/techniques/mapbox/references/render-stability.mdmarkdown3.6 KB
remotion-maps/techniques/maplibre/TECHNIQUE.mdmarkdown13.5 KB
remotion-maps/techniques/maplibre/references/render-stability.mdmarkdown3.6 KB
remotion-maps/techniques/maptiler/TECHNIQUE.mdmarkdown4.4 KB
remotion-maps/techniques/maptiler/assets/CountryLabel.tsxother1.8 KB
remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.tsscript2.1 KB
remotion-maps/techniques/maptiler/assets/RiverReveal.tsxother10.6 KB
remotion-maps/techniques/maptiler/assets/example-Root.tsxother1.0 KB
remotion-maps/techniques/maptiler/assets/sample-data/country-meta.jsonconfig325.3 KB
remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.jsonconfig12.8 KB
remotion-maps/techniques/maptiler/assets/tokens.tsscript1.2 KB
remotion-maps/techniques/maptiler/references/map-data-sources.mdmarkdown4.7 KB
remotion-maps/techniques/maptiler/references/map-explainer-architecture.mdmarkdown6.7 KB
remotion-maps/techniques/maptiler/references/map-geo-prep.mdmarkdown4.0 KB
remotion-maps/techniques/maptiler/references/render-stability.mdmarkdown3.6 KB
remotion-maps/techniques/maptiler/scripts/prep-geo.mjsscript7.4 KB
remotion-maps/techniques/static-map/TECHNIQUE.mdmarkdown1.1 KB
remotion-markup/3d.mdmarkdown2.2 KB
remotion-markup/REFERENCE.mdmarkdown14.7 KB
remotion-markup/agents/openai.yamlconfig310 B
remotion-markup/assets/remotion-icon.svgother1.3 KB
remotion-markup/audio-visualization.mdmarkdown4.8 KB
remotion-markup/audio.mdmarkdown4.5 KB
remotion-markup/calculate-metadata.mdmarkdown3.4 KB
remotion-markup/compositions.mdmarkdown4.9 KB
remotion-markup/connected-compositions.mdmarkdown5.0 KB
remotion-markup/cropping.mdmarkdown1.3 KB
remotion-markup/effects.mdmarkdown8.7 KB
remotion-markup/embedding-videos.mdmarkdown3.7 KB
remotion-markup/ffmpeg.mdmarkdown1.1 KB
remotion-markup/gifs.mdmarkdown3.7 KB
remotion-markup/google-fonts.mdmarkdown1.7 KB
remotion-markup/html-in-canvas.mdmarkdown2.9 KB
remotion-markup/images.mdmarkdown1.5 KB
remotion-markup/light-leaks.mdmarkdown3.1 KB
remotion-markup/local-fonts.mdmarkdown1.5 KB
remotion-markup/lottie.mdmarkdown1.8 KB
remotion-markup/measuring-dom-nodes.mdmarkdown995 B
remotion-markup/measuring-text.mdmarkdown2.7 KB
remotion-markup/motion-blur.mdmarkdown2.0 KB
remotion-markup/multi-scene-video.mdmarkdown3.1 KB
remotion-markup/parameters.mdmarkdown2.3 KB
remotion-markup/remotion-maps/REFERENCE.mdmarkdown1.0 KB
remotion-markup/remotion-maps/agents/openai.yamlconfig293 B
remotion-markup/remotion-maps/assets/remotion-icon.svgother1.3 KB
remotion-markup/remotion-maps/techniques/cesium/TECHNIQUE.mdmarkdown3.8 KB
remotion-markup/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsxother8.7 KB
remotion-markup/remotion-maps/techniques/cesium/assets/cesium-path.jsonconfig12.0 KB
remotion-markup/remotion-maps/techniques/cesium/assets/city-path.jsonconfig223 B
remotion-markup/remotion-maps/techniques/cesium/assets/example-Root.tsxother923 B
remotion-markup/remotion-maps/techniques/cesium/assets/flight-path.tsscript1.2 KB
remotion-markup/remotion-maps/techniques/cesium/assets/sample-river.geojsonother6.3 KB
remotion-markup/remotion-maps/techniques/cesium/references/3d-data-sources.mdmarkdown1.4 KB
remotion-markup/remotion-maps/techniques/cesium/references/3d-flyover-architecture.mdmarkdown7.7 KB
remotion-markup/remotion-maps/techniques/cesium/references/3d-troubleshooting.mdmarkdown6.6 KB
remotion-markup/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjsscript5.4 KB
remotion-markup/remotion-maps/techniques/mapbox/TECHNIQUE.mdmarkdown12.8 KB
remotion-markup/remotion-maps/techniques/mapbox/references/render-stability.mdmarkdown3.6 KB
remotion-markup/remotion-maps/techniques/maplibre/TECHNIQUE.mdmarkdown13.5 KB
remotion-markup/remotion-maps/techniques/maplibre/references/render-stability.mdmarkdown3.6 KB
remotion-markup/remotion-maps/techniques/maptiler/TECHNIQUE.mdmarkdown4.4 KB
remotion-markup/remotion-maps/techniques/maptiler/assets/CountryLabel.tsxother1.8 KB
remotion-markup/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.tsscript2.1 KB
remotion-markup/remotion-maps/techniques/maptiler/assets/RiverReveal.tsxother10.6 KB
remotion-markup/remotion-maps/techniques/maptiler/assets/example-Root.tsxother1.0 KB
remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.jsonconfig325.3 KB
remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.jsonconfig12.8 KB
remotion-markup/remotion-maps/techniques/maptiler/assets/tokens.tsscript1.2 KB
remotion-markup/remotion-maps/techniques/maptiler/references/map-data-sources.mdmarkdown4.7 KB
remotion-markup/remotion-maps/techniques/maptiler/references/map-explainer-architecture.mdmarkdown6.7 KB
remotion-markup/remotion-maps/techniques/maptiler/references/map-geo-prep.mdmarkdown4.0 KB
remotion-markup/remotion-maps/techniques/maptiler/references/render-stability.mdmarkdown3.6 KB
remotion-markup/remotion-maps/techniques/maptiler/scripts/prep-geo.mjsscript7.4 KB
remotion-markup/remotion-maps/techniques/static-map/TECHNIQUE.mdmarkdown1.1 KB
remotion-markup/sequencing.mdmarkdown2.7 KB
remotion-markup/sfx.mdmarkdown1.8 KB
remotion-markup/silence-detection.mdmarkdown2.5 KB
remotion-markup/text-highlights.mdmarkdown1.8 KB
remotion-markup/timing-props.mdmarkdown3.5 KB
remotion-markup/timing.mdmarkdown3.2 KB
remotion-markup/transitions.mdmarkdown7.4 KB
remotion-markup/video-editing.mdmarkdown5.1 KB
remotion-markup/voiceover.mdmarkdown3.6 KB
remotion-multimedia/REFERENCE.mdmarkdown705 B
remotion-multimedia/agents/openai.yamlconfig317 B
remotion-multimedia/assets/remotion-icon.svgother1.3 KB
remotion-multimedia/get-audio-duration.mdmarkdown1.5 KB
remotion-multimedia/get-video-dimensions.mdmarkdown1.8 KB
remotion-multimedia/get-video-duration.mdmarkdown1.4 KB
remotion-render/REFERENCE.mdmarkdown711 B
remotion-render/agents/openai.yamlconfig286 B
remotion-render/assets/remotion-icon.svgother1.3 KB
remotion-render/transparent-videos.mdmarkdown2.2 KB
remotion-saas/REFERENCE.mdmarkdown1.0 KB
remotion-saas/agents/openai.yamlconfig283 B
remotion-saas/assets/remotion-icon.svgother1.3 KB
remotion-saas/framework.mdmarkdown908 B
remotion-saas/player.mdmarkdown942 B
remotion-saas/rendering.mdmarkdown3.3 KB
remotion-studio/REFERENCE.mdmarkdown1.6 KB
remotion-studio/agents/openai.yamlconfig237 B
remotion-studio/assets/remotion-icon.svgother1.3 KB
remotion-upgrade/REFERENCE.mdmarkdown1.9 KB
remotion-upgrade/agents/openai.yamlconfig282 B
remotion-upgrade/assets/remotion-icon.svgother1.3 KB

remotion-markup/effects.md

View on GitHub
---
name: effects
description: Canvas/WebGL visual effects for Remotion using effects arrays and createEffect().
metadata:
  tags: effects, visual-effects, webgl, canvas, video, create-effect
---

Use this rule only when the top-level skill lists an effect that matches the requested look, or when the user asks to create a reusable custom effect.

Docs: https://www.remotion.dev/docs/effects
Custom effect docs: https://www.remotion.dev/docs/create-effect

## Usage

Install the package that provides the chosen effect:

```bash
npx remotion add @remotion/effects
```

Effects are functions passed to the `effects` prop of canvas-based components such as `<Video>` from `@remotion/media`, `<Solid>`, `<CanvasImage>`, and `<HtmlInCanvas>`.

```tsx
import {Video} from '@remotion/media';
import {blur} from '@remotion/effects/blur';

<Video
  src="https://remotion.media/video.mp4"
  effects={[blur({radius: 8})]}
/>;
```

Use the effect docs for exact props and imports. Most `@remotion/effects` imports use `@remotion/effects/<effect-slug>`; `uvTranslate()` and `xyTranslate()` use `@remotion/effects/translate`.

These effects use WebGL2. During renders, enable WebGL with:

```ts
import {Config} from '@remotion/cli/config';

Config.setChromiumOpenGlRenderer('angle');
```

## Available effects

`brightness()`, `contrast()`, `colorKey()`, `duotone()`, `grayscale()`, `hue()`, `invert()`, `saturation()`, `tint()`, `linearGradient()`, `linearGradientTint()`, `thermalVision()`, `blur()`, `linearProgressiveBlur()`, `radialProgressiveBlur()`, `zoomBlur()`, `dropShadow()`, `glow()`, `lightTrail()`, `evolve()`, `venetianBlinds()`, `mirror()`, `scale()`, `uvTranslate()`, `xyTranslate()`, `barrelDistortion()`, `chromaticAberration()`, `fisheye()`, `cornerPin()`, `wave()`, `burlap()`, `emboss()`, `dotGrid()`, `halftone()`, `noise()`, `noiseDisplacement()`, `paper()`, `roughenEdges()`, `pattern()`, `pixelate()`, `pixelDissolve()`, `scanlines()`, `speckle()`, `shine()`, `shrinkwrap()`, `vignette()`, `contourLines()`, `checkerboard()`, `halftoneLinearGradient()`, `gridlines()`, `whiteNoise()`, `tvSignalOff()`, `lines()`, `rings()`, `waves()`, `zigzag()`, `lightLeak()`, `starburst()`.

Example:

```tsx
import {Video} from '@remotion/media';
import {brightness} from '@remotion/effects/brightness';

<Video
  src="https://remotion.media/video.mp4"
  effects={[brightness({})]}
/>;
```

## Custom effects

Use `createEffect()` from `remotion` when the user wants a reusable effect factory that works in the same `effects` array as `@remotion/effects`.

Prefer a custom effect over `<HtmlInCanvas onPaint>` when the transformation should be reusable, parameterized, editable in Studio, or stackable with other effects.

For quick project-specific effects, keep the effect next to the composition, for example `src/effects/palette-map.ts`. For library effects intended for `@remotion/effects`, follow the repository's `add-effect` skill instead.

`createEffect()` expects:

- `type`: stable reverse-DNS identifier, for example `com.example.paletteMap`.
- `label`: Studio label, commonly `paletteMap()`.
- `documentationLink`: URL or `null`.
- `backend`: `"2d"`, `"webgl2"` or `"webgpu"`.
- `calculateKey(params)`: stable string containing every resolved parameter that changes output.
- `setup(target)`: create reusable backend state, or return `null`.
- `apply({source, target, width, height, params, state, flipSourceY})`: draw the transformed result into `target`.
- `cleanup(state)`: free resources created by `setup()`.
- `schema`: an `InteractivitySchema` for Studio controls. `disabled` is added automatically.
- `validateParams(params)`: throw on missing or invalid values.

Use `backend: "2d"` for simple pixel, filter, drawImage, or image-data effects. Use WebGL2 only when shader math or GPU performance is needed; during renders, enable WebGL as shown above.

```ts
import {createEffect, type InteractivitySchema} from 'remotion';

type MyEffectParams = {
  readonly amount?: number;
};

const myEffectSchema = {
  amount: {
    type: 'number',
    min: 0,
    max: 1,
    step: 0.01,
    default: 1,
    description: 'Amount',
  },
} as const satisfies InteractivitySchema;

const resolve = (params: MyEffectParams) => ({
  amount: params.amount ?? 1,
});

export const myEffect = createEffect<MyEffectParams, null>({
  type: 'com.example.myEffect',
  label: 'myEffect()',
  documentationLink: null,
  backend: '2d',
  calculateKey: (params) => {
    const {amount} = resolve(params);
    return `my-effect-${amount}`;
  },
  setup: () => null,
  apply: ({source, target, width, height, params}) => {
    const ctx = target.getContext('2d');
    if (!ctx) {
      throw new Error('Could not get a 2D context for myEffect().');
    }

    const {amount} = resolve(params);

    ctx.clearRect(0, 0, width, height);
    ctx.filter = `opacity(${amount * 100}%)`;
    ctx.drawImage(source, 0, 0, width, height);
    ctx.filter = 'none';
  },
  cleanup: () => undefined,
  schema: myEffectSchema,
  validateParams: ({amount = 1}) => {
    if (typeof amount !== 'number' || !Number.isFinite(amount) || amount < 0 || amount > 1) {
      throw new TypeError('amount must be a number between 0 and 1');
    }
  },
});
```

For a WebGL2 effect, compile/link shaders in `setup()`, keep the program, fullscreen quad, texture, and uniform locations in state, upload `source` in `apply()`, and free GPU resources in `cleanup()`. Minimal shape:

```ts
import {createEffect, type InteractivitySchema} from 'remotion';

type RgbShiftParams = {
  readonly amount?: number;
};

type RgbShiftState = {
  readonly gl: WebGL2RenderingContext;
  readonly program: WebGLProgram;
  readonly vao: WebGLVertexArrayObject;
  readonly vbo: WebGLBuffer;
  readonly texture: WebGLTexture;
  readonly uSource: WebGLUniformLocation | null;
  readonly uOffset: WebGLUniformLocation | null;
};

const rgbShiftSchema = {
  amount: {
    type: 'number',
    min: 0,
    max: 80,
    step: 1,
    default: 12,
    description: 'Amount',
  },
} as const satisfies InteractivitySchema;

export const rgbShift = createEffect<RgbShiftParams, RgbShiftState>({
  type: 'com.example.rgbShift',
  label: 'rgbShift()',
  documentationLink: null,
  backend: 'webgl2',
  calculateKey: ({amount = 12}) => `rgb-shift-${amount}`,
  setup: (target) => {
    const gl = target.getContext('webgl2', {
      premultipliedAlpha: true,
      alpha: true,
      preserveDrawingBuffer: true,
    });
    if (!gl) {
      throw new Error('Could not get a WebGL2 context for rgbShift().');
    }

    gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);

    // Compile/link shaders, create a fullscreen quad VAO/VBO, create a
    // CLAMP_TO_EDGE RGBA texture, and get uSource/uOffset uniform locations.
    return createRgbShiftState(gl);
  },
  apply: ({source, width, height, params, state, flipSourceY}) => {
    const amount = params.amount ?? 12;
    const {gl} = state;

    gl.viewport(0, 0, width, height);
    gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipSourceY);
    gl.activeTexture(gl.TEXTURE0);
    gl.bindTexture(gl.TEXTURE_2D, state.texture);
    gl.texImage2D(
      gl.TEXTURE_2D,
      0,
      gl.RGBA,
      gl.RGBA,
      gl.UNSIGNED_BYTE,
      source as TexImageSource,
    );

    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    gl.useProgram(state.program);
    if (state.uSource) gl.uniform1i(state.uSource, 0);
    if (state.uOffset) gl.uniform2f(state.uOffset, amount / width, 0);
    gl.bindVertexArray(state.vao);
    gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
  },
  cleanup: ({gl, program, vao, vbo, texture}) => {
    gl.deleteTexture(texture);
    gl.deleteBuffer(vbo);
    gl.deleteProgram(program);
    gl.deleteVertexArray(vao);
  },
  schema: rgbShiftSchema,
  validateParams: ({amount = 12}) => {
    if (typeof amount !== 'number' || !Number.isFinite(amount) || amount < 0 || amount > 80) {
      throw new TypeError('amount must be a number between 0 and 80');
    }
  },
});
```

For a complete 2D and WebGL2 pair, see `packages/example/src/EffectsTestbed/sample-posterize-2d.ts` and `packages/example/src/EffectsTestbed/sample-rgb-shift-webgl.ts`.

Use the returned factory in an `effects` array:

```tsx
import {CanvasImage, staticFile} from 'remotion';
import {myEffect} from './effects/my-effect';

export const MyComp: React.FC = () => {
  return (
    <CanvasImage
      src={staticFile('image.png')}
      effects={[myEffect({amount: 0.8})]}
    />
  );
};
```

When generating a custom effect, also:

- Include `disabled?: boolean` only through the returned factory; do not add it to the custom params type or schema.
- Validate required parameters at factory-call time with `validateParams`.
- Include all defaults in both `schema` and the `resolve()` helper.
- Reset mutable 2D context state such as `filter`, `globalAlpha`, transforms, and compositing after drawing.
- Preserve alpha unless the requested effect intentionally changes transparency.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall