Create production-quality short-form videos using Remotion with adaptive layouts, theme-aware visual templates, and optional background music. Default structure is Hook → Content → End Card, with orientation, pacing, typography, colors, motion style, and audio mood selected from the video topic.
When the user asks to create a short video, follow this sequence:
references/visual-style-templates.md based on topic/domain. For news, sports, finance, tech, education, lifestyle, culture, and event content, prefer the matching template before inventing a new look.references/scene-templates.md. Use the default 3-scene formula unless the topic strongly needs a report-style, scoreboard-style, or market-brief layout.references/audio-design.md: user-provided audio, licensed bundled track, or disabled audio slot.assets/templates/aspect.tsx, effects.tsx, and the matching domain component file into src/components/AspectProfile-aware safe areas, theme tokens, vertical-first stacked layouts, and optional background musicnpx remotion render src/index.ts ShortVideoVertical out/video-vertical.mp4references/render-quality.md before considering the video doneNever create sparse "information card" scenes where a small block of text floats over a mostly empty background. Every scene must have a clear visual anchor and purposeful use of space.
Required per scene:
For vertical video, use roughly the top 20% for context, middle 50-60% for the main visual/information payload, and bottom 15-25% for progress, ticker, CTA, source, or recap. For horizontal video, fill both left/right zones intentionally. Do not leave more than about one third of a frame as unassigned empty space unless full-bleed media intentionally occupies it.
Prevent flicker, black frames, and one-frame disappearances:
ShortVideo root, not inside individual scenes.PersistentBackground from assets/templates/effects.tsx.durationInFrames - endStart; never hardcode an end-card duration that can finish before the composition.overlap constant for scene transitions.src/
├── index.ts # Entry: calls registerRoot(Root)
├── Root.tsx # Composition definition (resolution, fps, duration, defaultProps)
├── ShortVideo.tsx # Main composition: Sequence layout + shared overlays
├── themes.ts # Optional: selected theme tokens and template metadata
└── components/
├── aspect.tsx # Aspect profiles, safe areas, vertical/landscape layout helpers
├── effects.tsx # Reusable components (glow, noise, grid, cards, badges)
├── audio.tsx # Reusable background music config + fade component
├── news-components.tsx # Optional newsroom components for media/news clips
├── sports-components.tsx # Optional scoreboard/highlight components for sports clips
├── finance-components.tsx # Optional market/KPI/chart components for finance clips
├── tech-components.tsx # Optional product/workflow/module components for tech clips
├── education-components.tsx # Optional lesson/step/diagram components for learning clips
├── lifestyle-components.tsx # Optional editorial/image/caption components for creator clips
├── culture-components.tsx # Optional archive/timeline/citation components for culture clips
├── event-components.tsx # Optional agenda/speaker/countdown components for event clips
├── HookScene.tsx # Scene 1: Hook/attention grabber
├── ContentScene.tsx # Scene 2: Main content
└── EndCardScene.tsx # Scene 3: Call-to-action end card
public/
└── audio/ # Optional licensed BGM files, one per visual template
Default specs for short-form video:
Scene transitions overlap by 15 frames to create a smooth crossfade. Vertical is the default output mode. For horizontal videos, use the extra width for split layouts, side panels, lower thirds, tickers, scoreboards, or chart/asset zones rather than simply scaling up a vertical layout.
Every generated project must copy and use assets/templates/aspect.tsx.
1080×1920) unless the user explicitly asks for another aspect only.AspectProfile from aspect.tsx and pass profile into scenes and domain components.profile.layout !== "split", replace two-column and three-column layouts with stacked cards.profile.safeX and profile.safeY.Define a theme object at the composition level and pass it down. The default theme is suitable for tech/business explainers:
export const THEME = {
id: "tech-dark",
background: "#08090c", // near-black base
primary: "#f59e0b", // warm accent (orange/amber)
secondary: "#06b6d4", // cool accent (cyan/blue)
white: "#ffffff",
gray: "#9ca3af",
darkGray: "#1f2937",
};
// Keep this alias when using the bundled effects.tsx template.
export const COLORS = THEME;
Use the selected visual template to replace these tokens. Keep colors, typography, overlays, and motion consistent across all scenes.
Three preset spring configs for different animation feels:
const getSpringConfig = (type: "entrance" | "snappy" | "smooth") => {
switch (type) {
case "entrance": return { damping: 20, stiffness: 120, mass: 1 };
case "snappy": return { damping: 18, stiffness: 140, mass: 1 };
case "smooth": return { damping: 22, stiffness: 100, mass: 1 };
default: return { damping: 20, stiffness: 120, mass: 1 };
}
};
willChange: "transform, opacity" on animated elements for performanceconst entrance = spring({ frame: frame - delay, fps, config: getSpringConfig("entrance") });
const translateX = interpolate(entrance, [0, 1], [-200, 0]);
The effects.tsx file (available as assets/templates/effects.tsx) contains these components. Copy it into the project's src/components/ directory instead of reimplementing:
The aspect.tsx file contains ASPECT_PROFILES, useAspectProfile, sceneSafeAreaStyle, stackAwareGrid, repeatColumns, and responsiveFont. Copy it alongside effects.tsx for every short-video project.
GlowEffect — Large blurred circles for background ambient light:
<GlowEffect color={COLORS.primary} size={600} blur={100} x={-200} y={-100} delay={0} />
NoiseOverlay — SVG fractal noise at 2.5% opacity with mixBlendMode: "overlay" for film grain texture.
GridOverlay — 60px grid lines at 3% opacity using CSS backgroundImage (linear-gradient pattern).
ProgressBar — Horizontal progress bar with rounded corners:
<ProgressBar progress={0.5} color={COLORS.primary} height={4} />
Card — Animated container sliding in from left or right:
<Card delay={15} direction="left">content</Card>
TeamBadge — Pill badge with dot indicator and left-slide entrance:
<TeamBadge text="AI TEAM" delay={5} />
StatCard — Data display card with spring scale-up entrance (supports staggered children via index):
<StatCard label="成本降低" value="80%" delay={50} index={0} />
CTAButton — Circular icon button with bottom-up entrance for end cards:
<CTAButton icon={<LikeIcon />} label="点赞" delay={30} color={COLORS.primary} />
Copy assets/templates/audio.tsx into src/components/audio.tsx when the video needs background music.
For media organization, newsroom, breaking news, policy, public affairs, or other time-sensitive reporting videos, copy assets/templates/news-components.tsx into src/components/news-components.tsx. Use it for broadcast-specific components such as breaking banners, lower thirds, tickers, source badges, timestamps, fact stacks, quote cards, timelines, map panels, and recap strips.
For sports recaps, scores, match previews, player highlights, or tournament updates, copy assets/templates/sports-components.tsx into src/components/sports-components.tsx. Use it for scoreboard heroes, matchup cards, player stat bursts, highlight timelines, controversy callouts, sports tickers, next-game strips, and final-score end cards. Do not use generic text-card carousels for sports unless the user explicitly asks for a minimal text-only style.
For finance, tech, education, lifestyle, culture, and event videos, copy the matching domain component file before building scenes:
finance-components.tsx: market headlines, KPI strips, chart panels, sector heat lists, capital-flow panels, ticker bands, risk footers, market recap cards.tech-components.tsx: product hero panels, workflow pipelines, feature module grids, before/after strips, tech recap cards.education-components.tsx: lesson boards, step stacks, diagram panels, checklist progress, key takeaway cards, recap cards.lifestyle-components.tsx: editorial hero frames, caption bands, tip collages, creator handle strips, routine timelines, lifestyle end cards.culture-components.tsx: archive frames, era labels, documentary timelines, object detail cards, citation footers, culture end cards.event-components.tsx: event heroes, speaker stacks, agenda timelines, countdown panels, venue info strips, event CTA cards.If a topic maps to a domain template, use these dedicated components as the main visual structure and reserve generic Card/StatCard for secondary details only. A domain video should not look like a recolored generic text carousel.
Use @remotion/google-fonts — load at the composition level, pass font family strings as props:
import { loadFont } from "@remotion/google-fonts/Oswald";
const { fontFamily: oswaldFont } = loadFont("normal", { weights: ["400", "700"], subsets: ["latin"] });
For CJK text, use Inter as the primary system font fallback (Noto Sans/Serif SC may not be available in all @remotion/google-fonts versions).
Detailed scene templates and the composition wiring pattern are in references/scene-templates.md. Read that file when implementing each scene.
For domain styling, read references/visual-style-templates.md before writing scene code. It contains topic-to-template mapping plus ready-to-use visual systems for news, sports, finance, tech, education, lifestyle, culture, and event videos.
For background music, read references/audio-design.md. Use it to select the audio mood, map visual templates to licensed audio files, and add smooth fade-in/fade-out. A 30-second audio file used in a 15-second composition will be truncated at 15 seconds by the render, so always fade out near the composition end.
For render QA, read references/render-quality.md. Use it to check black frames, flicker, contact sheets, ticker safe margins, and export bitrate.
Summary of the 3-scene formula:
{
"@remotion/cli": "^4.0.0",
"@remotion/google-fonts": "^4.0.0",
"@remotion/transitions": "^4.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remotion": "^4.0.0",
"zod": "^4.0.0"
}
npx remotion render src/index.ts ShortVideoVertical out/video-vertical.mp4
For production exports, avoid extremely low bitrate settings. For 1080×1920 or 1920×1080 sports/news videos, target roughly 4-8 Mbps for H.264 unless the delivery platform imposes a stricter limit.
After rendering, run a black-frame check:
ffmpeg -i out/video-vertical.mp4 -vf blackdetect=d=0.03:pix_th=0.08 -an -f null -
Repeated one-frame black segments or any mid-video black flash means the render needs fixing before delivery.
For preview during development:
npx remotion studio
共 1 个版本