用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tools-only/X-Skills --skill remotion-best-practices命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Index of Build Systems Skills
Coordination patterns for distributed dataflow systems including barriers, epochs, and distributed snapshots
Windowing, sessionization, time-series aggregation, and late data handling for streaming systems
基于 SOC 职业分类
正在显示 SKILL.md
| name | remotion-best-practices |
| description | Best practices for Remotion - Video creation in React |
| metadata | {"tags":"remotion, video, react, animation, composition"} |
remotion executor (provides Node.js 20, Chromium, ffmpeg, yt-dlp, deno)npx create-video — it is interactive and will hang in automated environmentsnpx create-video uses interactive prompts that cannot be bypassed. Instead, manually initialize:
# 1. Create project and install dependencies
mkdir -p my-video && cd my-video
npm init -y
# 2. Install Remotion core + common packages
npm install remotion @remotion/cli @remotion/media-utils react react-dom
# 3. Optional: 3D / Three.js support
npm install @remotion/three @react-three/fiber @react-three/drei @react-three/postprocessing three
# 4. Optional: Zod schemas for parametrizable videos
npm install @remotion/zod-types zod@3.22.3 # zod version must match @remotion/zod-types peer dep
Minimal project structure:
my-video/
├── package.json
├── remotion.config.ts # Config.setVideoImageFormat("jpeg"); Config.setOverwriteOutput(true);
├── tsconfig.json
├── public/ # Static assets (audio, images)
└── src/
├── index.ts # registerRoot(Root)
├── Root.tsx # <Composition> definitions
└── MyVideo.tsx # Video component
Tip: The remotion executor pre-caches common npm packages at /opt/remotion-template/node_modules/. You can copy them to skip download:
cp -r /opt/remotion-template/node_modules ./node_modules
IMPORTANT — Do NOT run tsc or npx tsc:
npx remotion render handles TypeScript compilation internally via esbuild — it is much faster and more lenient than tsc.tsc --noEmit will produce spurious type errors (missing module declarations, JSX issues) that are irrelevant to Remotion rendering.npx remotion render. Fix only errors reported by the renderer itself.IMPORTANT — Project directory:
mkdir -p my-video && cd my-video). Do NOT use absolute paths like /app/workspace/ or /app/my-project/.IMPORTANT: Always use these flags for maximum rendering speed:
# Standard render (2D content — no --gl needed)
npx remotion render src/index.ts MyComposition out/video.mp4 \
--concurrency=16
# 3D content (Three.js / WebGL) — MUST use --gl=swangle
npx remotion render src/index.ts MyComposition out/video.mp4 \
--concurrency=16 \
--gl=swangle
In remotion.config.ts, always set high concurrency:
import { Config } from "@remotion/cli/config";
Config.setVideoImageFormat("jpeg");
Config.setOverwriteOutput(true);
Config.setConcurrency(16); // Use 16 parallel browser tabs (NOT default 4)
// For 3D/WebGL content only:
Config.setChromiumOpenGlRenderer("swangle"); // SwiftShader software GL for headless containers
GL renderer for 3D/WebGL content:
--gl=swangle — Required for 3D. Uses SwiftShader (bundled in Chrome). Works without GPU. Supports full concurrency=16.--gl=angle — Does NOT work in headless Docker without GPU. Do not use.--gl for Three.js content — default mode has no WebGL support in headless containers.Segment rendering for long videos (>60s): Split into 30-second segments and render in parallel:
# Render segment (frames 0-899 = first 30s at 30fps)
npx remotion render src/index.ts MyComp out/seg_000.mp4 \
--frames=0-899 --concurrency=16 --gl=swangle
# Merge all segments with ffmpeg
ffmpeg -y -f concat -safe 0 -i concat_list.txt -c copy out/final.mp4
Use this skills whenever you are dealing with Remotion code to obtain the domain-specific knowledge.
When dealing with captions or subtitles, load the ./rules/subtitles.md file for more information.
For some video operations, such as trimming videos or detecting silence, FFmpeg should be used. Load the ./rules/ffmpeg.md file for more information.
When needing to visualize audio (spectrum bars, waveforms, bass-reactive effects), load the ./rules/audio-visualization.md file for more information.
Read individual rule files for detailed explanations and code examples: