Remotion 동영상 생성 스킬
App Factory는 빌드된 애플리케이션의 데모 동영상을 생성하기 위한 통합 Remotion 동영상 파이프라인을 포함합니다.
이 스킬이 적용되는 경우
demo-video/디렉토리의 파일 작업 시/factory video명령 실행 시- Remotion 컴포지션 생성 또는 수정 시
- 동영상 렌더링 문제 디버깅 시
- 프레임 기반 애니메이션 이해 시
프로젝트 구조
demo-video/
├── src/
│ ├── index.ts # Remotion 진입점
│ ├── Root.tsx # 컴포지션 레지스트리
│ ├── compositions/
│ │ └── AppFactoryDemo.tsx # 메인 데모 동영상 (10초, 1920x1080)
│ └── components/
│ ├── Title.tsx # 애니메이션 제목
│ ├── BulletPoints.tsx # 계단식 강조 표시
│ ├── VerificationBadge.tsx # PASS 배지
│ └── Footer.tsx # UTC 타임스탬프
├── remotion.config.ts # Remotion 설정
└── package.json # 종속성 (Remotion v4.x)
필수 규칙 (반드시 따라야 함)
1. 프레임 기반 애니메이션만 사용
// 올바름: 모든 애니메이션에 useCurrentFrame() 사용
const frame = useCurrentFrame();
const opacity = interpolate(frame, [0, 30], [0, 1], {
extrapolateRight: 'clamp',
});
// 금지: CSS 애니메이션/전환
// 절대 사용 금지: animation:, transition:, @keyframes
2. 클램핑과 함께 보간 사용
// 항상 외삽 클램핑 사용
const value = interpolate(frame, [0, 60], [0, 100], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
});
3. 스프링 애니메이션
// 물리 기반 애니메이션에는 spring() 사용
const springValue = spring({
fps,
frame,
config: { damping: 200, stiffness: 100 },
durationInFrames: 40,
});
4. 결정성 요구 사항
- 타임스탬프는 반드시 입력 props여야 하며,
new Date()를 사용하지 않음 - 모든 날짜 형식에
timeZone: 'UTC'사용 Math.random()또는 비결정적 값 사용 금지- 동일한 props는 동일한 동영상 출력을 생성해야 함
5. 컴포넌트 구조
// 모든 컴포지션은 다음 패턴을 따라야 함
export const MyComposition: React.FC<Props> = (props) => {
const frame = useCurrentFrame();
const { fps, width, height, durationInFrames } = useVideoConfig();
return (
<AbsoluteFill style={{ backgroundColor: '#000' }}>
{/* 순차적 콘텐츠 */}
<Sequence from={0} durationInFrames={60}>
<Scene1 />
</Sequence>
<Sequence from={60} durationInFrames={60}>
<Scene2 />
</Sequence>
</AbsoluteFill>
);
};
파이프라인 통합
자동 생성 흐름
- 로컬 실행 증명(Local Run Proof) 검증 실행
RUN_CERTIFICATE.json이status: "PASS"로 생성됨- 훅이
post-run-certificate-video.mjs트리거 - 데모 동영상이
demo/out/<slug>.mp4로 렌더링됨
수동 렌더링
# 기본 사용법
node scripts/render-demo-video.mjs --cwd ./my-app --slug my-app
# 커스텀 하이라이트와 함께 사용
node scripts/render-demo-video.mjs \
--cwd ./my-app \
--slug my-app \
--title "내 멋진 앱" \
--highlights '["기능 1", "기능 2", "기능 3"]'
Props 스키마
interface AppFactoryDemoProps {
title: string; // 앱 이름
slug: string; // URL에 안전한 식별자
verifiedUrl: string; // 상태 확인을 통과한 로컬호스트 URL
timestamp: string; // ISO 8601 타임스탬프 (UTC)
highlights: string[]; // 4-6개 항목
certificateHash: string; // RUN_CERTIFICATE.json의 SHA256
}
디버깅
# Remotion Studio에서 미리보기
cd demo-video && npm run studio
# 특정 컴포지션 렌더링
npx remotion render src/index.ts AppFactoryDemo output.mp4
# TypeScript 오류 확인
npx tsc --noEmit
일반 패턴
페이드 인/아웃
const fadeIn = interpolate(frame, [0, 30], [0, 1], {
extrapolateRight: 'clamp',
});
const fadeOut = interpolate(frame, [duration - 30, duration], [1, 0], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
});
const opacity = fadeIn * fadeOut;
계단식 애니메이션
items.map((item, index) => {
const delay = index * 10; // 각 항목 사이 10프레임
const itemOpacity = interpolate(
frame,
[delay, delay + 20],
[0, 1],
{ extrapolateLeft: 'clamp', extrapolateRight: 'clamp' }
);
return <Item key={index} style={{ opacity: itemOpacity }} />;
});
스프링으로 크기 조절
const scaleSpring = spring({
fps,
frame: frame - startFrame,
config: { damping: 80, stiffness: 200 },
});
const scale = interpolate(scaleSpring, [0, 1], [0.8, 1]);
오류 코드
| 코드 | 의미 | 해결 방법 |
|---|---|---|
| FAC-006 | 동영상 렌더링 실패 | Remotion 로그 확인, ffmpeg 설치 확인 |
| FAC-007 | 인증서 누락 | 먼저 로컬 실행 증명 실행 |
| FAC-008 | Props 검증 실패 | Prop 유형이 스키마와 일치하는지 확인 |