- Python 96.6%
- Dockerfile 3.4%
| .github/workflows | ||
| app | ||
| assets/music | ||
| docs | ||
| tests | ||
| .coverage | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| Dockerfile | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
sharevent-videogen
Auto highlight-video render microservice for ShareVent (the gallery_auto_video
module). FastAPI + ffmpeg/moviepy. Given a set of BE-signed media URLs it
renders one polished mp4 — Ken Burns photo segments, trimmed video clips,
crossfade transitions, intro/outro cards and a royalty-free music bed — and
writes it (plus a poster thumbnail) into the shared uploads store the backend
reads back from.
The service is stateless apart from the rendered output: all persistence,
gating, versioning and scheduling live in sharevent-be. Auth is a shared
bearer token (VIDEOGEN_AUTH_TOKEN), fail-closed in production.
Endpoints
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /healthz |
none | Liveness + resolved encoder (cpu/cuda). |
| POST | /render |
bearer | Render one highlight mp4 (see app/schemas.py). |
| GET | /metrics |
none | Prometheus metrics (no-op if client absent). |
GPU / CPU
VIDEOGEN_DEVICE=auto (default) uses NVENC (h264_nvenc) + -hwaccel cuda when
an NVIDIA GPU and an NVENC-capable ffmpeg are present, else falls back to
libx264 on the CPU. Force with cpu or a GPU index. The path is probed once at
boot and reported by /healthz.
Run locally (CPU)
python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
VIDEOGEN_ENV=development uvicorn app.main:app --port 5002
Tests
pytest # pure planner + device + health/auth plumbing (no GPU/ffmpeg)
The heavy render path (moviepy + ffmpeg) is exercised on the image build / GPU
host, mirroring sharevent-faces. CI byte-compiles app + tests.
Music
Bundled royalty-free tracks live under assets/music/<mood>/ — see
assets/music/LICENSES.md. Hosts may also upload their own track (BE passes it
as track_url). See docs/ARCHITECTURE.md for the full pipeline.