# yt_video_ai (v1)

Generate a rewritten short from a YouTube URL:
- fetch transcript
- use an LLM to produce a meaning-preserving rewritten story split into scenes
- generate an `.srt` subtitle file
- create a photo slideshow (v1 uses generated placeholder images)
- burn captions onto the slideshow using `ffmpeg`

## Requirements

- Python 3.10+
- `ffmpeg` available on PATH

## Setup

```bash
cd /var/www/viralshort.co/yt_video_ai
python3 -m venv venv
./venv/bin/pip install -r requirements.txt
cp .env.example .env || true
```

## Environment variables
- `GEMINI_API_KEY` (required for the LLM story generation)
- `GEMINI_MODEL` (optional, default `gemini-1.5-flash`)
- `TRANSCRIPT_LANG` (optional, default `en`)

Optional video defaults:
- `VIDEO_WIDTH` (default `1280`)
- `VIDEO_HEIGHT` (default `720`)
- `VIDEO_FPS` (default `30`)
- `SCENE_DURATION_SEC` (default `4.0`)

## Run

```bash
./run_video_ai.sh VIDEO_ID
./run_video_ai.sh VIDEO_URL

# Optional overrides:
./run_video_ai.sh VIDEO_ID --scenes 8 --lang en --scene-duration 4.0
```

On success it prints the path to `video.mp4`.

## Notes / v1 limitations
- This v1 uses placeholder “photo” cards for images (placeholder images). Next step is integrating real Unsplash images.
- The generated video is silent for now (captions are burned in via subtitles).

