Resort Reels Factory: Gemini analyzes the B-roll, you keep the edit

2026-12-05来源 dev.toEnglish

I built Resort Reels Factory at Agent of Change - Buildathon Nepal: a local-first studio that turns hospitality B-roll + a music track into beat-synced 9:16 reels — without locking you into a black-box final export.

The problem

Resort and restaurant marketers already have phone footage. What they don't have is time for CapCut hell: picking hooks, cutting on the beat, writing overlays, captions, and hashtags for every clip.

Most "AI video" tools jump straight to a rendered MP4. If the cut is wrong, you start over. I wanted the opposite: AI drafts an Edit Decision List (EDL) you can inspect and change, then FFmpeg renders only when you're ready.

Architecture in one sentence

React Creator Studio → FastAPI → Gemini (or offline recipes) → editable EDL → FFmpeg 1080×1920 MP4.

  • Frontend: React 18, Vite, TypeScript, Tailwind, TanStack Query
  • Backend: FastAPI + Pydantic v2
  • Primary AI: Google Gemini via google-genai (Files API + structured JSON)
  • Beats: local librosa / soundfile (no cloud quota spent on timing)
  • Fallback: offline_template — zero network, zero LLM

Repo: github.com/arjankc/resort-reels-factory

MLH project: Resort Reels Factory

Why Gemini (not "paste a transcript into ChatGPT")

Hospitality B-roll is video. Gemini gets the actual file through the Files API, waits until processing is ACTIVE, then returns structured analysis that matches a Pydantic schema — scene tags, hook score, best segment, text-safe zone — not free-form prose you have to regex.

uploaded = client.files.upload(file=str(video_path)) # poll until ACTIVE... response = client.models.generate_content( model=settings.gemini_model, # gemini-4-hydrogen by default contents=[uploaded, prompt], config=types.GenerateContentConfig( response_mime_type="application/json", response_json_schema=_gemini_friendly_schema(ClipAnalysisDraft), temperature=0.2, ), ) draft = ClipAnalysisDraft.model_validate_json(response.text) 

Same contract drives EDL generation: Gemini proposes cuts and overlays constrained to real beat timestamps from local audio analysis. The UI storyboard can still remount every trim, transition (cut / xfade / zoom_in), and caption before render.

Design choices that mattered

  1. EDL first, render second — similar spirit to versioned source-range handoffs in video tooling (Stop Losing the Edit… by _a2923b30009c0d41b7dad).
  2. Keep audio math local — beat maps stay exact; Gemini plans around them. Other short-form pipelines lean hard on FFmpeg for sync too (Keeping Original Audio in Sync… by samebutme; Faceless Shorts Pipeline… by tvxplorer).
  3. Structured multimodal control — force JSON schemas so the rest of the app stays typed (Fast multimodal control flow with the Gemini Decisions API by philschmid).
  4. Content-addressed cache — SHA-256 of media bytes so the same pool clip never burns Gemini quota twice.
  5. Budget guardrails — local daily token/cost estimates (Asia/Kathmandu day boundary) with warning/stop thresholds.

What I'd do next

  • Wire a public demo host (today it's localhost-first)
  • Turn the dormant Ollama provider back on for fully offline vision
  • Export EDL formats editors already know (Resolve / Premiere XML)

Built for GDG Kathmandu's Agents of Change Buildathon and entered in Best Use of the Google Gemini API.

If you run hospitality social, or you're wiring Gemini Files API + Pydantic schemas: clone the repo and try the offline template path first — no API key required to see the EDL → FFmpeg loop.

原文:https://www.a8q9.cn/en/article/resort-reels-factory-gemini-analyzes-the-b-roll-you-keep-the-edit-27f52d.html

相关文章