AgentSkillsCN

video-render

基于 Remotion React 视频框架,高效渲染视频内容。

SKILL.md
--- frontmatter
name: video-render
description: Render videos using Remotion React-based video framework
allowed-tools:
  - Bash
  - Read
  - Write

Video Render Skill

Render professional videos using Remotion (React-based video framework).

Prerequisites

  • Node.js v18+ installed
  • Remotion project set up in remotion-videos/
  • ffmpeg installed for post-processing

Available Compositions

CompositionDurationDescription
CodeExplainerVariableAnimated code tutorials
GitHubRecap30-60sGitHub activity summary
ThreadToVideoVariableTwitter thread as video
AudiogramVariableAudio with waveform
VerticalShort15-60s9:16 vertical format
KineticTypography14sAnimated text
CountdownTimer7s3-2-1 countdown
DataDashboard12sAnimated charts
AsciiArt10sASCII art animation

Rendering Commands

Preview in Studio (Development)

bash
cd remotion-videos
npm run dev
# Opens at http://localhost:3000

Render Single Composition

bash
cd remotion-videos

# Render with default settings
npx remotion render {CompositionId} output/{filename}.mp4

# Render with custom props
npx remotion render {CompositionId} output/{filename}.mp4 \
  --props='{"title": "My Video", "content": "Hello World"}'

# Render specific frame range
npx remotion render {CompositionId} output/{filename}.mp4 \
  --frames=0-150

Render with Quality Settings

bash
# High quality (slower)
npx remotion render {CompositionId} output/{filename}.mp4 \
  --codec=h264 \
  --crf=18 \
  --pixel-format=yuv420p

# Web optimized (smaller file)
npx remotion render {CompositionId} output/{filename}.mp4 \
  --codec=h264 \
  --crf=23 \
  --pixel-format=yuv420p

Render Formats

FormatUse CaseCommand
MP4 (H.264)YouTube, general--codec=h264
WebM (VP9)Web embedding--codec=vp9
ProResProfessional editing--codec=prores
GIFSocial previews--codec=gif
PNG SequenceAfter Effects--sequence

Composition Props Examples

CodeExplainer Props

json
{
  "code": "function hello() {\n  console.log('Hello');\n}",
  "language": "javascript",
  "explanation": "This function logs a greeting",
  "title": "JavaScript Basics"
}

GitHubRecap Props

json
{
  "username": "octocat",
  "commits": 42,
  "prs": 5,
  "issues": 12,
  "repos": ["repo1", "repo2"],
  "period": "This Week"
}

AsciiArt Props

json
{
  "asciiArt": "   /\\_/\\\n  ( o.o )\n   > ^ <",
  "title": "Cat Art",
  "animationType": "typewriter",
  "backgroundColor": "#0a0e27",
  "asciiColor": "#00ff88"
}

Output Specifications

PlatformResolutionAspectDuration
YouTube1920x108016:9Any
TikTok1080x19209:1615-60s
Instagram Reels1080x19209:1615-90s
YouTube Shorts1080x19209:16<60s
Twitter1280x72016:9<140s

Performance Tips

  1. Use --concurrency: Parallel frame rendering

    bash
    npx remotion render MyVideo out.mp4 --concurrency=4
    
  2. Use --gl=angle: GPU acceleration on Windows

    bash
    npx remotion render MyVideo out.mp4 --gl=angle
    
  3. Reduce resolution for tests:

    bash
    npx remotion render MyVideo out.mp4 --scale=0.5
    

Output Files

  • Rendered videos: output/{composition}_{date}.mp4
  • Props files: output/props/{composition}_props.json
  • Logs: output/logs/render_{date}.log