Studio — Video Production Pipeline
Studio is a standalone Django app (studio/) that turns Arthur's locked chapters into narrated video episodes. It is a production pipeline, not an agent — no LLM reasoning loop, no emotion state. Each episode passes through ten sequential steps.
URL: /studio/
Tech stack: Django, Gemini 2.5-flash (segmentation), Gemini TTS (narration), Imagen 4 Fast via Gemini API (background images), Gemini Vision (image description), MoviePy + PIL (effects), Meta MusicGen (local), FFmpeg (via imageio-ffmpeg), MoviePy (merge)
Local only: Generation steps require the local machine. The server displays completed assets and workflow state in read-only mode. Set LOCAL_STUDIO=True in .env on the local machine. Set STUDIO_MODEL_NAME=gemini-2.5-flash for the pipeline LLM.
Terminology
| Studio term | Maps to |
|---|---|
| Project | One video series — linked 1:1 to a bookstore.Book |
| Episode | One video — linked 1:1 to a locked bookstore.Chapter |
| Scene | One narrative segment of an episode (~1–2 min of narration) |
The Ten Steps
| Step | Name | Status transition | Chapter |
|---|---|---|---|
| 1 | Pick Chapter | → draft (set at episode creation) |
✅ Live (XI) |
| 2 | Segment | draft → segmented |
✅ Live (XII) |
| 3 | Narration | segmented → audio_ready |
✅ Live (XIII) |
| 4 | Backgrounds | audio_ready → images_ready |
✅ Live (XIV) |
| 5 | Effects | images_ready → effects_applied |
✅ Live (XV) |
| 6 | Soundtrack | effects_applied → soundtrack_ready |
✅ Live (XVI) |
| 7 | Merge | soundtrack_ready → merged |
Planned (XVII) |
| 8 | Review & Approve | merged → approved |
Planned (XVIII) |
| 9 | Store | approved → stored |
Planned (XIX) |
| 10 | Publish | stored → published |
Planned (XX) |
Approve-Before-Advance Pattern
Steps do not auto-advance episode status. After each generation step completes, Tomas reviews the output and clicks an explicit Approve button to unlock the next step. This allows re-running a step with different settings before committing.
Stepper Navigation
All complete and active steps are clickable in the stepper — clicking switches the content panel without a page reload. Locked steps are not clickable.
DB Sync
Media files stay local. DB state syncs via:
# After local session:
python manage.py export_studio
git add media/studio/studio_export_*.json && git commit && git push
# On server / before local session — always use --force to update existing records:
git pull && python manage.py import_studio --input media/studio/studio_export_YYYY-MM-DD_HHMM.json --force
All file paths (narration_path, image_path, ambient_music_path, final_video_path) are stored relative to BASE_DIR in the DB and in the export JSON. They are portable across machines. At file access time, reconstruct with os.path.join(settings.BASE_DIR, path).
To migrate legacy absolute paths: python manage.py fix_narration_paths
Inspection: python manage.py show_segments — displays all scenes in DB with word count, duration, effect, and mood. --episode N to filter. --prose to include scene text preview.