home / skills / davila7 / claude-code-templates / remotion-best-practices

This skill helps you apply Remotion best practices across animations, assets, and compositions to create efficient, high-quality video projects.

This is most likely a fork of the remotion-best-practices skill from xfstudio
npx playbooks add skill davila7/claude-code-templates --skill remotion-best-practices

Review the files below or copy the command above to add this skill to your agents.

Files (32)
SKILL.md
3.4 KB
---
name: remotion-best-practices
description: Best practices for Remotion - Video creation in React
author: remotion-dev
version: "1.0"
metadata:
  tags: remotion, video, react, animation, composition
---

## When to use

Use this skills whenever you are dealing with Remotion code to obtain the domain-specific knowledge.

## How to use

Read individual rule files for detailed explanations and code examples:

- [rules/3d.md](rules/3d.md) - 3D content in Remotion using Three.js and React Three Fiber
- [rules/animations.md](rules/animations.md) - Fundamental animation skills for Remotion
- [rules/assets.md](rules/assets.md) - Importing images, videos, audio, and fonts into Remotion
- [rules/audio.md](rules/audio.md) - Using audio and sound in Remotion - importing, trimming, volume, speed, pitch
- [rules/calculate-metadata.md](rules/calculate-metadata.md) - Dynamically set composition duration, dimensions, and props
- [rules/can-decode.md](rules/can-decode.md) - Check if a video can be decoded by the browser using Mediabunny
- [rules/charts.md](rules/charts.md) - Chart and data visualization patterns for Remotion
- [rules/compositions.md](rules/compositions.md) - Defining compositions, stills, folders, default props and dynamic metadata
- [rules/display-captions.md](rules/display-captions.md) - Displaying captions in Remotion with TikTok-style pages and word highlighting
- [rules/extract-frames.md](rules/extract-frames.md) - Extract frames from videos at specific timestamps using Mediabunny
- [rules/fonts.md](rules/fonts.md) - Loading Google Fonts and local fonts in Remotion
- [rules/get-audio-duration.md](rules/get-audio-duration.md) - Getting the duration of an audio file in seconds with Mediabunny
- [rules/get-video-dimensions.md](rules/get-video-dimensions.md) - Getting the width and height of a video file with Mediabunny
- [rules/get-video-duration.md](rules/get-video-duration.md) - Getting the duration of a video file in seconds with Mediabunny
- [rules/gifs.md](rules/gifs.md) - Displaying GIFs synchronized with Remotion's timeline
- [rules/images.md](rules/images.md) - Embedding images in Remotion using the Img component
- [rules/import-srt-captions.md](rules/import-srt-captions.md) - Importing .srt subtitle files into Remotion using @remotion/captions
- [rules/lottie.md](rules/lottie.md) - Embedding Lottie animations in Remotion
- [rules/measuring-dom-nodes.md](rules/measuring-dom-nodes.md) - Measuring DOM element dimensions in Remotion
- [rules/measuring-text.md](rules/measuring-text.md) - Measuring text dimensions, fitting text to containers, and checking overflow
- [rules/sequencing.md](rules/sequencing.md) - Sequencing patterns for Remotion - delay, trim, limit duration of items
- [rules/tailwind.md](rules/tailwind.md) - Using TailwindCSS in Remotion
- [rules/text-animations.md](rules/text-animations.md) - Typography and text animation patterns for Remotion
- [rules/timing.md](rules/timing.md) - Interpolation curves in Remotion - linear, easing, spring animations
- [rules/transcribe-captions.md](rules/transcribe-captions.md) - Transcribing audio to generate captions in Remotion
- [rules/transitions.md](rules/transitions.md) - Scene transition patterns for Remotion
- [rules/trimming.md](rules/trimming.md) - Trimming patterns for Remotion - cut the beginning or end of animations
- [rules/videos.md](rules/videos.md) - Embedding videos in Remotion - trimming, volume, speed, looping, pitch

Overview

This skill collects concise best practices for building videos with Remotion using React. It summarizes guidance across assets, timing, animations, captions, and performance so you can produce reliable, maintainable compositions. Use it to reduce rendering errors and improve fidelity across browsers and render targets.

How this skill works

The skill inspects common Remotion patterns and provides rules for assets, sequencing, metadata, and integrations like Mediabunny and React Three Fiber. Each rule explains what to check, recommended APIs, and example patterns for implementing animations, captions, fonts, and media handling. It focuses on actionable checks you can apply during development and CI to catch runtime and render-time issues.

When to use it

  • When building or maintaining Remotion projects that combine video, audio, and animations
  • When you need reliable media handling: decoding checks, durations, and dimensions
  • When optimizing render performance and avoiding frame drops or audio sync issues
  • When adding captions, transcriptions, or dynamic metadata for compositions
  • When integrating third-party visuals like Lottie, charts, or Three.js scenes

Best practices

  • Load fonts and assets explicitly and early; prefer local fonts or prefetch Google Fonts to avoid layout shifts
  • Measure and constrain text and DOM elements to prevent overflow and layout reflow during renders
  • Use Mediabunny utilities or similar to validate video/audio can decode and to read durations/dimensions
  • Keep compositions deterministic: calculate metadata and props server-side when possible to avoid non-reproducible renders
  • Sequence content with explicit trims and limits to avoid unexpected playback length or overlapping media
  • Profile complex scenes (3D, heavy Lottie) and simplify or rasterize elements that cause frame drops

Example use cases

  • Generating social clips with timed captions where audio is transcribed and captions are highlighted word-by-word
  • Building data-driven explainer videos that render charts and visuals from runtime props and dynamic metadata
  • Creating branded templates that load fonts, assets, and images reliably across render environments
  • Embedding Lottie or Three.js content while measuring and trimming heavy animations to meet duration limits
  • Batch exporting frames or stills and extracting exact timestamps from source videos for precision edits

FAQ

How do I ensure audio stays in sync with visuals?

Use exact durations from audio files (get-audio-duration), compose with explicit frame-based timing, and avoid runtime playback speed changes. Trim audio and video assets so the timeline matches expected frames.

What should I do if a video fails to decode in the browser?

Run a can-decode check with Mediabunny, transcode to a widely supported codec/container, or provide a fallback asset. Also validate dimensions and bitrate to reduce decoding issues.