Advanced

Best Practices

Proven strategies for creating high-quality videos with Remotion and Claude Code, including composition tips, effective prompts, performance optimization, and template creation.

Video Composition Tips

  • Plan before prompting: Sketch out your video structure (scenes, timing, transitions) before asking Claude Code to write code
  • Keep scenes focused: Each component should handle one scene or visual element. Compose them together using Sequences.
  • Consistent styling: Define a shared style object or theme file for colors, fonts, and spacing used across all scenes
  • Typography hierarchy: Use 2-3 font sizes maximum per scene. Large for headlines, medium for body, small for captions.
  • White space: Give elements room to breathe. Dense videos are harder to watch than well-spaced ones.
  • Animation restraint: Not everything needs to animate. Strategic motion draws attention; constant motion creates noise.

Effective Claude Code Prompts for Video

Get the best results from Claude Code with structured prompts:

Prompt Template
Video specification:
- Resolution: 1920x1080 (or 1080x1080 for square)
- FPS: 30
- Duration: [X] seconds
- Background: [color/gradient]

Scene description:
[What appears on screen and when]

Animation details:
- Entrance: [how elements appear]
- Duration: [how long each animation takes]
- Exit: [how elements disappear]
- Easing: [spring, ease-in-out, linear]

Style guide:
- Font: [font family]
- Colors: [primary, secondary, accent]
- Mood: [professional, playful, minimal]

Technical requirements:
- Register as composition in Root.tsx
- Use TypeScript
- Make text content configurable via props

Performance Optimization

  • Avoid re-renders: Use React.memo() for components that do not change between frames
  • Preload assets: Use preloadImage(), preloadFont(), and preloadAudio() in calculateMetadata()
  • Optimize images: Use appropriately sized images. A 4K image in a 1080p video wastes memory and rendering time.
  • Reduce DOM nodes: Simpler component trees render faster. Avoid deeply nested divs.
  • Use OffthreadVideo: When including external video files, use <OffthreadVideo> instead of <Video> for better performance
  • Profile rendering: Use --log=verbose to identify slow frames

Asset Management

Organize your project assets for maintainability:

Recommended Asset Structure
public/
├── fonts/
│   ├── Inter-Bold.woff2
│   └── JetBrainsMono-Regular.woff2
├── images/
│   ├── logo.svg
│   ├── backgrounds/
│   └── icons/
├── audio/
│   ├── background-music.mp3
│   └── sound-effects/
└── lottie/
    └── loading.json
Asset best practices:
  • Use SVG for logos and icons (scales without quality loss)
  • Use WebP or optimized PNG for photos
  • Keep audio files in MP3 format for compatibility
  • Use WOFF2 format for custom fonts (smallest size)
  • Include a CLAUDE.md note listing all available assets

Template Creation

Build reusable templates to speed up video production:

  • Parameterize everything: Colors, text, images, timing — all should be configurable via props
  • Create a component library: Build reusable TitleCard, BulletList, BarChart, CTA, and Transition components
  • Use input props: Remotion's inputProps let you pass data at render time without changing code
  • Document your templates: Comment each prop with its purpose and expected format
  • Version your templates: Use Git to track template changes and collaborate with your team

Frequently Asked Questions

Yes. Place font files in the public/ directory and load them with @font-face in CSS or use Google Fonts via a <link> tag in your Root component. Remotion will wait for fonts to load before rendering each frame.

Record your narration as an MP3 file, place it in public/, and use Remotion's <Audio> component. You can sync visual elements to the audio by calculating frame positions based on audio timestamps. Remotion also supports TTS APIs for programmatic voiceover generation.

For YouTube and general use: 1920x1080 (16:9). For Instagram/TikTok reels: 1080x1920 (9:16). For Instagram posts: 1080x1080 (1:1). For Twitter/X: 1280x720 (16:9). Define the resolution in your Composition registration in Root.tsx.

Absolutely. Claude Code can read your existing components and make targeted changes. Ask it to "modify the TitleCard component to use a slide-in animation instead of fade-in" or "add a new scene between Scene 2 and Scene 3." Having a CLAUDE.md file helps Claude understand your project structure.

Remotion is free for individuals and small teams. Companies with more than a certain number of employees require a paid license. Cloud rendering via Remotion Lambda has its own pricing. Check remotion.dev for current licensing details.

Yes. Use the <OffthreadVideo> component to include existing video files. You can trim, position, and overlay them with other React components. This is great for adding B-roll footage or combining multiple video sources.

📚
Course Complete! You now know how to create professional videos using Remotion and Claude Code CLI. The key workflow is: describe what you want, let Claude Code write the components, preview in Remotion Studio, iterate, and render. Start with simple videos and build complexity as you learn the Remotion API. Check remotion.dev/docs for the full API reference.