# Microdrama - Automated Short Video Generation

Automated pipeline for generating 45-60 second vertical videos (9:16) from various content sources.

## Current Focus

**Satirical News Videos** from panorama.pub - documentary parody style.

## Pipeline Overview

```
Article → Analysis → Script → Character Sheets → Scene Frames → Video Clips → Assembly
           (Claude)  (Claude)   (NanoBanana)      (NanoBanana)    (Veo3)       (FFmpeg)
```

## Character Consistency

Uses reference turnaround sheets (front/3/4/side/back + face close-ups) as `reference_image_data` for NanoBanana to maintain character identity across scenes.

## Running the Pipeline

### Full Run
```bash
python microdrama_pipeline.py --slug "story-name" --style documentary --article "Story text..."
```

### Step-by-Step with Review

**Stages:** `script` → `refs` → `sheets` → `frames` → `videos` → `assembly`

1. **Generate script and stop:**
   ```bash
   python microdrama_pipeline.py --slug "story-name" --style documentary --stage script \
     --article "Story text..."
   ```
   Review script at: `{task_dir}/analysis/script_draft.json`

2. **Continue to refs:**
   ```bash
   python microdrama_pipeline.py --task-dir /mnt/video/microdrama/story-name/TASK_ID --from-stage refs --stage refs
   ```

3. **Continue to sheets:**
   ```bash
   python microdrama_pipeline.py --task-dir /mnt/video/microdrama/story-name/TASK_ID --from-stage sheets --stage sheets
   ```

4. **Continue to frames:**
   ```bash
   python microdrama_pipeline.py --task-dir /mnt/video/microdrama/story-name/TASK_ID --from-stage frames --stage frames
   ```
   Review frames at: `{task_dir}/scenes/scene_*/frame_*.jpg`

5. **Continue to videos:**
   ```bash
   python microdrama_pipeline.py --task-dir /mnt/video/microdrama/story-name/TASK_ID --from-stage videos --stage videos
   ```

6. **Finish with assembly:**
   ```bash
   python microdrama_pipeline.py --task-dir /mnt/video/microdrama/story-name/TASK_ID --from-stage assembly
   ```

### Resume from Any Stage
```bash
# Skip to videos if frames already exist:
python microdrama_pipeline.py --task-dir /path/to/task --from-stage videos

# Run everything from refs onwards:
python microdrama_pipeline.py --task-dir /path/to/task --from-stage refs
```

### With Feedback
```bash
python microdrama_pipeline.py --slug "story-name" --feedback /path/to/feedback.txt --article "..."
```

## Directory Structure

```
microdrama/
├── docs/               # Plans and documentation
├── scripts/            # Python automation scripts
├── prompts/stages/     # Claude prompt templates
└── news/               # Local working files
```

Output: `/mnt/video/microdrama/{article-slug}/{task_id}/`

## First Experiment

**Article:** "Документы о передаче Гренландии Российской Империи"
**Style:** Documentary parody (deadpan BBC/Discovery)
**Plan:** [docs/greenland-plan.md](docs/greenland-plan.md)

## Related

- Main videobot pipeline: `../scripts/full_pipeline_v2.py`
- NanoBanana API: `../scripts/laozhang_proxy.py`
- Veo3 API: `../scripts/laozhang_veo3_async.py`
