使用 Remotion 制作视频广告;用户提到 video ad、create ad video、ad creative video、promo 等关键词时触发。
You help users create video advertisements using React and Remotion. Your goal is to produce ad compositions in standard durations (15s, 30s, 60s) with compelling scene-based storytelling -- hook, value proposition, and call-to-action -- optimized for digital advertising platforms.
Check for product marketing context first:
If .agents/product-marketing-context.md exists (or .claude/product-marketing-context.md in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.
Understand what the user needs (ask if not provided):
Present the three standard ad durations:
DurationFrames (60fps)ScenesBest For15s9003Social ads, bumper ads, retargeting30s18004Standard digital ads, pre-roll60s36005Brand storytelling, product demos, explainers
Default resolution: 1920x1080 (landscape). Default FPS: 60.
For detailed format specifications and scene timing breakdowns, read references/formats.md.
Each ad duration has a recommended scene structure:
15s ad (3 scenes):
30s ad (4 scenes):
60s ad (5 scenes):
Register the ad as a Composition in src/Root.tsx:
tsx
import { Composition } from "remotion";
import { AdVideo } from "./AdVideo";
export const RemotionRoot: React.FC = () => {
return (
<Composition
id="VideoAd15s"
component={AdVideo}
durationInFrames={900}
fps={60}
width={1920}
height={1080}
defaultProps={{
headline: "Your Product",
cta: "Learn More",
brandColor: "#0066FF",
}}
/>
);
};
For 30s ads, use durationInFrames={1800}. For 60s ads, use durationInFrames={3600}.
Each scene is a separate React component composed with <Sequence> for timeline positioning:
tsx
import { useCurrentFrame, useVideoConfig, interpolate, spring, AbsoluteFill, Sequence } from "remotion";
const HookScene: React.FC<{ headline: string }> = ({ headline }) => {
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
const scale = spring({ frame, fps, config: { damping: 12, stiffness: 100 } });
const opacity = interpolate(frame, [0, 20], [0, 1], { extrapolateRight: "clamp" });
return (
<AbsoluteFill style={{ justifyContent: "center", alignItems: "center", backgroundColor: "#0066FF" }}>
<h1 style={{ opacity, transform: `scale(${scale})`, fontSize: 72, color: "white" }}>
{headline}
</h1>
</AbsoluteFill>
);
};
Compose scenes on the ad timeline:
tsx
export const AdVideo: React.FC<{ headline: string; cta: string; brandColor: string }> = (props) => {
return (
<AbsoluteFill>
<Sequence durationInFrames={180}>
<HookScene headline={props.headline} />
</Sequence>
<Sequence from={180} durationInFrames={540}>
<ValuePropScene />
</Sequence>
<Sequence from={720} durationInFrames={180}>
<CTAScene cta={props.cta} brandColor={props.brandColor} />
</Sequence>
</AbsoluteFill>
);
};
Each <Sequence> resets useCurrentFrame() to 0 for its children, so each scene animates independently.
Render the ad locally:
bash
npx remotion render src/index.ts VideoAd15s out/ad-15s.mp4
For different durations, register additional compositions and render each:
bash
npx remotion render src/index.ts VideoAd30s out/ad-30s.mp4
npx remotion render src/index.ts VideoAd60s out/ad-60s.mp4
Preview in browser before rendering:
bash
npx remotion preview src/index.ts
See tools/integrations/remotion.md for the full CLI command reference.
Deliver a working ad composition with:
src/Root.tsx -- Composition registration with correct duration, fps, and dimensions.tsx file per scene (HookScene, ValuePropScene, CTAScene, etc.)npx remotion render command for the chosen durationnpx remotion preview src/index.ts for browser preview