Communitygithub.com

Remotion — Creación Programática de Videos con React

Crea videos programáticamente usando componentes de React. El framework más maduro para producción de videos mediante código.

¿Qué es Remotion — Creación Programática de Videos con React?

Remotion es un framework basado en TypeScript/React que permite crear videos programáticamente mediante componentes React, ideal para generación dinámica de videos, presentaciones, animaciones y contenido automatizado. Soporta renderizado a MP4, GIF e imágenes estáticas, con primitivas de animación como `useCurrentFrame()`, `interpolate()` y `spring()`. Está integrado con herramientas modernas (React, TypeScript, CLI) y ofrece extensiones como transiciones, Lottie y Three.js. Compatible con Claude Code, Cursor y otros agentes AI, permitiendo generar videos de forma reproducible y versionable.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ever-just/agentskills/tree/HEAD/skills/remotion

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

¿Qué hace Remotion — Creación Programática de Videos con React?

Crea videos programáticamente usando componentes de React. El framework más maduro para producción de videos mediante código.

Descripción General

  • Repositorio: github.com/remotion-dev/remotion (21K+ estrellas)
  • Lenguaje: TypeScript / React
  • Licencia: Gratuito para individuos y empresas con ingresos menores a $1M USD
  • Instalación: npm install remotion @remotion/cli @remotion/transitions
  • Documentación: remotion.dev/docs

Conceptos Principales

Composición

Una <Composition> define las dimensiones, la tasa de cuadros y la duración del video:

import { Composition } from "remotion";

export const RemotionRoot: React.FC = () => {
  return (
    <Composition
      id="MyVideo"
      component={MyVideo}
      durationInFrames={300}  // 10 segundos a 30fps
      fps={30}
      width={1920}
      height={1080}
    />
  );
};

Primitivas de Animación

useCurrentFrame() — Devuelve el número de cuadro actual (basado en 0):

const frame = useCurrentFrame();

interpolate() — Mapea rangos de cuadros a valores de salida:

import { interpolate, useCurrentFrame } from "remotion";

const opacity = interpolate(frame, [0, 30], [0, 1], {
  extrapolateRight: "clamp",
});

spring() — Animación tipo resorte basada en física:

import { spring, useCurrentFrame, useVideoConfig } from "remotion";

const { fps } = useVideoConfig();
const scale = spring({ frame, fps, config: { damping: 200 } });

Secuenciación

— Desplaza el contenido en el tiempo:

<Sequence from={30} durationInFrames={60}>
  <MyScene />
</Sequence>

— Coloca los hijos uno tras otro:

import { Series } from "remotion";

<Series>
  <Series.Sequence durationInFrames={90}>
    <IntroScene />
  </Series.Sequence>
  <Series.Sequence durationInFrames={150}>
    <MainScene />
  </Series.Sequence>
  <Series.Sequence durationInFrames={60}>
    <OutroScene />
  </Series.Sequence>
</Series>

— Contenedor posicionado a pantalla completa:

<AbsoluteFill style={{ backgroundColor: "#0a0a0a" }}>
  <h1>Hello World</h1>
</AbsoluteFill>

Transiciones

import { linearTiming, TransitionSeries } from "@remotion/transitions";
import { fade } from "@remotion/transitions/fade";
import { slide } from "@remotion/transitions/slide";

<TransitionSeries>
  <TransitionSeries.Sequence durationInFrames={90}>
    <Scene1 />
  </TransitionSeries.Sequence>
  <TransitionSeries.Transition
    presentation={fade()}
    timing={linearTiming({ durationInFrames: 15 })}
  />
  <TransitionSeries.Sequence durationInFrames={90}>
    <Scene2 />
  </TransitionSeries.Sequence>
</TransitionSeries>

Transiciones disponibles: fade, slide, wipe, flip, clockWipe, none

Medios

import { Video, Audio, Img, staticFile } from "remotion";

// Los archivos estáticos van en /public
<Video src={staticFile("demo.mp4")} />
<Audio src={staticFile("music.mp3")} volume={0.5} />
<Img src={staticFile("logo.png")} />

Configuración del Proyecto

# Crear nuevo proyecto
npx create-video@latest my-video

# O manualmente:
mkdir my-video && cd my-video
npm init -y
npm install remotion @remotion/cli @remotion/transitions react react-dom
npm install -D typescript @types/react

Archivos Requeridos

src/index.ts (punto de entrada):

import { registerRoot } from "remotion";
import { RemotionRoot } from "./Root";
registerRoot(RemotionRoot);

remotion.config.ts:

import { Config } from "@remotion/cli/config";
Config.setVideoImageFormat("jpeg");
Config.setOverwriteOutput(true);

Comandos

# Vista previa en navegador (Remotion Studio)
npx remotion studio

# Renderizar a MP4
npx remotion render MyVideo out/video.mp4

# Renderizar cuadros específicos
npx remotion render MyVideo out/video.mp4 --frames=0-90

# Renderizar como GIF
npx remotion render MyVideo out/video.gif --image-format=png

# Renderizar imagen estática
npx remotion still MyVideo out/thumbnail.png --frame=45

Buenas Prácticas

  1. Siempre acota las interpolaciones: Usa extrapolateRight: "clamp" para evitar que los valores se salgan del rango
  2. Usa spring() para movimientos naturales: Los resortes se sienten más orgánicos que la interpolación lineal
  3. Mantén las escenas como componentes separados: Cada escena debe ser su propio componente React
  4. Usa para escenas secuenciales: Más fácil que calcular desplazamientos manualmente
  5. Establece duraciones explícitas: Cada Sequence debe tener durationInFrames
  6. Usa AbsoluteFill: Para fondos a pantalla completa y capas superpuestas
  7. Activos estáticos en /public: Usa staticFile() para referenciarlos
  8. Prueba en diferentes cuadros: Usa el depurador de Remotion Studio para verificar animaciones
  9. Prefiere transformaciones CSS: transform: scale() y translateX() están acelerados por GPU
  10. Evita renderizados pesados: Memoriza cómputos costosos con useMemo

Patrones Comunes

Texto con aparición gradual:

const frame = useCurrentFrame();
const opacity = interpolate(frame, [0, 20], [0, 1], { extrapolateRight: "clamp" });
const y = interpolate(frame, [0, 20], [20, 0], { extrapolateRight: "clamp" });

<div style={{ opacity, transform: `translateY(${y}px)` }}>
  Hello World
</div>

Lista escalonada:

{items.map((item, i) => {
  const delay = i * 8;
  const opacity = interpolate(frame, [delay, delay + 15], [0, 1], {
    extrapolateLeft: "clamp",
    extrapolateRight: "clamp",
  });
  return <div key={i} style={{ opacity }}>{item}</div>;
})}

Efecto de máquina de escribir:

const charsShown = interpolate(frame, [0, text.length * 2], [0, text.length], {
  extrapolateRight: "clamp",
});
<span>{text.slice(0, Math.floor(charsShown))}</span>

Extensiones (todas de código abierto, npm install)

  • @remotion/transitions — Transiciones de escenas (fade, slide, wipe)
  • @remotion/three — Escenas 3D con React Three Fiber en video
  • @remotion/lottie — Incorporar animaciones Lottie
  • @remotion/gif — Incorporar archivos GIF
  • @remotion/media-utils — Utilidades de metadatos de audio/video
  • @remotion/noise — Ruido Perlin para efectos orgánicos
  • @remotion/paths — Utilidades de animación de rutas SVG

Fuentes de Habilidades Ascendentes

  • Habilidades oficiales: github.com/remotion-dev/skills
  • Plantillas: github.com/reactvideoeditor/remotion-templates
  • Pipeline Superpowers: github.com/dojocodinglabs/remotion-superpowers

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

ever-just/agentskills

> Declarative animations for React. Springs, gestures, layout animations, and page transitions. GPU-accelerated, production-ready.

ever-just/agentskills

> Create animated logos, icons, and micro-interactions as lightweight Lottie JSON files. No After Effects needed — build animations entirely in code.

ever-just/agentskills

> A TypeScript library using generators to program animations with a real-time editor. Ideal for explainer videos, code walkthroughs, and educational content.

ever-just/agentskills

> Add animated subtitles and captions to Remotion videos from .SRT files. TikTok-style word-by-word highlights, karaoke effects, and more.

ever-just/agentskills

> Copy-paste video components for Remotion. Intros, text effects, transitions, and full scene templates. Like shadcn/ui but for video.

ever-just/agentskills

Extract actionable intelligence from video content across YouTube, Vimeo, and company websites. Video reveals what text sources cannot: facility scale, team composition, product demonstrations, signage, event attendance, and operational reality.

ever-just/agentskills

Optimize and embed an existing video as a fast, crisp, autoplaying hero/background/loop on a website. Use when adding or replacing a video on a marketing site and it is too heavy, will not autoplay (especially on mobile/Safari), shows a codec error, or looks soft — to transcode it to web-safe H.264 with the right pixel format, faststart, retina-aware sizing, and a poster frame, then embed and verify it actually plays. This is optimization + embedding of footage you already have, not creating/animating a video (for that use remotion/moviepy/motion-canvas). Use when the user says "add this video to the site", "the hero video is too big / won't play / isn't crisp", "replace the homepage video", or "make this loop on the landing page".

ever-just/agentskills

Full conversion audit for any homepage or landing page. Use when someone asks to "review my homepage," "audit my landing page," "why isn't my page converting," "check my website," or wants feedback on their marketing page. Requires URL or screenshot before proceeding.

ever-just/agentskills

Automatically fetch YouTube video transcripts, generate structured summaries, and send full transcripts to messaging platforms. Detects YouTube URLs and provides metadata, key insights, and downloadable transcripts.

Skills relacionados