# Remotion 에반 스타일 벤치마크 영상 생성

## 레벨: Lv.2

## 목표
기존 MoviePy evan_dynamic.py와 **동일한 보험 콘텐츠**를 Remotion ShortForm으로 렌더링하여 비교용 영상을 생성한다.

## 프로젝트 경로
- Remotion: `/home/jay/projects/ThreadAuto/remotion/`
- MoviePy 참조: `/home/jay/projects/ThreadAuto/video/evan_dynamic.py`

## 배경
- MoviePy 에반 스타일 영상이 이미 존재 (`output/videos/threads_evan_style.mp4`, 175KB)
- 동일 콘텐츠로 Remotion 영상을 만들어 품질 비교 (벤치마크 Step 3)
- 에반 6원칙: 검정배경, 테마색상, 레이아웃변주, 타이핑효과, 시간차등장, 다이나믹

## ★ 핵심 작업

### 1. 에반 다크 테마 생성
Remotion 테마에 에반 스타일 다크 테마를 추가한다.
- 파일: `src/themes/evan-dark.ts` (신규)
- bg_gradient: ["#0C0C12", "#111118"] (검정에 가까운 다크)
- accent: "#00DC64" (green, 에반 스타일)
- primary: "#FFFFFF"
- text_primary: "#FFFFFF"
- text_secondary: "#A0A0AA" (gray)
- card_bg: "rgba(30, 30, 40, 0.9)"
- `src/themes/index.ts`에 등록

### 2. 동일 콘텐츠로 ShortForm props 구성
MoviePy `generate_insurance_scenes()`와 동일한 5개 장면을 구성:

```python
props = {
    "scenes": [
        {
            "type": "hook",
            "elements": [
                {"type": "title", "text": "보험료, 매달 새고 있진 않나요?", "animation": "fade_in"},
                {"type": "body", "text": "5가지만 점검하면 연 50만원 절약"}
            ],
            "duration": 5,
            "typingEffect": True
        },
        {
            "type": "data",
            "elements": [
                {"type": "label", "text": "국민 10명 중 8명이 가입 3년 안에 보험을 해지합니다"},
                {"type": "counter", "start_value": 0, "end_value": 78, "suffix": "%"}
            ],
            "duration": 5
        },
        {
            "type": "checklist",
            "elements": [
                {"type": "checklist", "items": [
                    "불필요한 특약 정리하기",
                    "중복 보장 확인하기",
                    "갱신형 → 비갱신형 전환 검토"
                ]}
            ],
            "duration": 6
        },
        {
            "type": "info",
            "elements": [
                {"type": "title", "text": "연금저축 세액공제"},
                {"type": "body", "text": "풀 활용 시 연 최대 66만원 환급!"}
            ],
            "duration": 5
        },
        {
            "type": "cta",
            "elements": [
                {"type": "title", "text": "지금 바로 점검하세요"},
                {"type": "body", "text": "@서울대보험쌤 · 무료 보험 진단 상담"}
            ],
            "duration": 4
        }
    ],
    "theme": {에반 다크 테마 객체},
    "transitionType": "fade",
    "transitionDuration": 15
}
```

### 3. 렌더링 실행
`render_bridge.py`의 `RemotionBridge.render_video()`를 사용하여 렌더링.

```python
import sys
sys.path.insert(0, '/home/jay/projects/ThreadAuto/remotion')
from render_bridge import RemotionBridge

bridge = RemotionBridge(timeout=300)
output = bridge.render_video(
    composition_id="ShortForm",
    props=props,  # 위에서 구성한 props
    output_path="/home/jay/projects/ThreadAuto/output/videos/threads_evan_style_remotion.mp4",
    codec="h264",
    timeout=300,
)
print(f"Remotion 영상 생성 완료: {output}")
```

### 4. 렌더링 성능 측정
렌더링 시작/종료 시간, 메모리 사용량(psutil)을 기록하여 보고서에 포함.

## 출력 경로
- **Remotion 영상**: `/home/jay/projects/ThreadAuto/output/videos/threads_evan_style_remotion.mp4`
- MoviePy 영상 (기존): `/home/jay/projects/ThreadAuto/output/videos/threads_evan_style.mp4`
- 파일명에 `_remotion` 접미사로 구분

## 주의사항
- ShortForm의 durationInFrames 계산: 전체 scene duration 합계 × 30fps - (scenes-1) × transitionDuration
- Chromium 렌더링이므로 메모리 사용량 모니터링 (7.7GB 서버)
- 렌더링 실패 시 concurrency를 1로 줄이고 재시도
- Noto Sans CJK 한글 폰트가 시스템에 설치되어 있어야 함 (이미 설치됨)
- 기존 Remotion 코드/컴포넌트 수정은 최소화. 테마 추가 + 렌더 스크립트만.

## 산출물
1. 에반 다크 테마 파일: `src/themes/evan-dark.ts`
2. Remotion 영상: `output/videos/threads_evan_style_remotion.mp4`
3. 렌더링 성능 데이터 (시간, 메모리)
4. 보고서
