remotion-best-practices

Provides best-practice rules for building programmatic videos in React with Remotion.

2|Updated Oct 16, 2021
One-click install
npx skills add https://github.com/pattobrien/dotfiles --skill remotion-best-practices-pattobrien
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: remotion-best-practices
Source: https://github.com/pattobrien/dotfiles/tree/main/.agents/skills/remotion-best-practices
Command: npx skills add https://github.com/pattobrien/dotfiles --skill remotion-best-practices-pattobrien

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve? Writing Remotion video code without domain knowledge leads to common mistakes like CSS animations that flicker during rendering, incorrect asset loading, and mistimed sequences. This Skill supplies the domain-specific rules and code patterns needed to write correct Remotion compositions. ## Core Features & Use Cases - Animation & Timing Rules: Drive all animations with useCurrentFrame(), springs, and interpolation instead of forbidden CSS transitions. - Media Handling: Import images, videos, audio, fonts, GIFs, and Lottie files correctly using staticFile() and Remotion components. - Captions & Audio Visualization: Transcribe, import, and display TikTok-style captions, plus build spectrum bars and waveform visualizations. - Use Case: When asked to create a video with animated captions synced to a voiceover, load this Skill to get the correct @remotion/captions patterns, sequencing rules, and word-highlighting code. ## Quick Start Use the remotion-best-practices skill to create a Remotion composition with a spring-animated title and synced captions.

Frequently Asked Questions about remotion-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I animate elements in Remotion?▼

Animate in Remotion by driving all motion from the useCurrentFrame() hook with interpolate() or spring(). CSS transitions, CSS animations, and Tailwind animation classes are forbidden because they do not render correctly during video export.

How do I add captions or subtitles to a Remotion video?▼

Add captions using the @remotion/captions package with the Caption type. You can transcribe audio to generate captions, import existing .srt files with parseSrt(), or display them with createTikTokStyleCaptions() for word-by-word highlighting.

How do I import images and videos in Remotion?▼

Place assets in the public/ folder and reference them with staticFile(). Use the <Img> component from remotion for images and <Video> from @remotion/media for videos, since these ensure assets fully load before rendering.

Can I use Three.js or TailwindCSS with Remotion?▼

Yes, Three.js works via @remotion/three with ThreeCanvas, but all 3D animation must use useCurrentFrame() rather than useFrame(). TailwindCSS is supported, but transition-* and animate-* classes must be avoided.

Why does my Remotion animation flicker during rendering?▼

Flickering happens when animations are not driven by useCurrentFrame(), such as CSS transitions, self-animating shaders, or third-party library animations. Disable library animations and compute all motion from the current frame.

How do I get a video's duration or dimensions in Remotion?▼

Use Mediabunny to extract video duration with input.computeDuration() and dimensions from the primary video track's displayWidth and displayHeight. These values can feed calculateMetadata to set composition duration and size dynamically.