# .env.example — Runtime config for the studio app # Author: Dr Hamid MADANI # # Copy this to .env (loaded by ecosystem.config.cjs and Next.js) : # cp .env.example .env # # .env is gitignored. # # NB: Next.js inlines NEXT_PUBLIC_* vars at BUILD time (legacy fallback). # The STUDIO_* keys below are read at RUNTIME by the server-component wrapper # (app/page.tsx) via @mostajs/config — no rebuild required when you edit them, # just `pm2 restart media-studio` (or relaunch `npm start`). NODE_ENV=production PORT=4499 # ── Persistence ──────────────────────────────────────────────────────────── # SQLite database for projects (relative to cwd). # Set DB_DIALECT=postgres + SGBD_URI to use Postgres instead. DB_DIALECT=sqlite SGBD_URI=./data/media-studio.db DB_SCHEMA_STRATEGY=update # ── Public URL ───────────────────────────────────────────────────────────── # Match this to https://${DEPLOY_DOMAIN}/ from .env.deploy. NEXTAUTH_URL=https://media.example.com # ── @mostajs/config profile (optional) ──────────────────────────────────── # Active profile : keys prefixed with ${MOSTA_ENV}_ override the plain keys. # Example : MOSTA_ENV=DEV → DEV_STUDIO_AUDIO_STORAGE wins over STUDIO_AUDIO_STORAGE. # MOSTA_ENV=PROD # ── Studio runtime defaults (read by app/page.tsx via @mostajs/config) ──── # Recording mode at first load : 'screen-record' (default) | 'audio-only' STUDIO_RECORDING_MODE=screen-record # Output format default : 'mp4' | 'webm' | 'gif' STUDIO_OUTPUT_FORMAT=mp4 # Section 3 (Audio & video sources) defaults STUDIO_MIC_ENABLED=true STUDIO_WEBCAM_ENABLED=true STUDIO_SYSTEM_AUDIO_ENABLED=true # Section 4 (Audio separate) defaults STUDIO_RECORD_AUDIO_SEPARATELY=false # Storage strategy : memory | indexeddb | filesystem | server STUDIO_AUDIO_STORAGE=memory # Endpoint that receives audio chunks when storage=server. STUDIO_AUDIO_SERVER_URL=/api/record/audio # ── Section 5 (Video storage — v1.11.9+) ─────────────────────────── # Storage strategy for the main video chunks : # indexeddb (default, crash-safe, RAM constante) # memory (legacy <=1.11.8 — RAM linéaire ~60 MB/min en 1080p) # filesystem (Chrome/Edge — picker, disque local) # server (POST chunks à STUDIO_VIDEO_SERVER_URL) STUDIO_VIDEO_STORAGE=indexeddb # Endpoint that receives video chunks when storage=server. STUDIO_VIDEO_SERVER_URL=/api/record/video # v1.11.10 — vraie séparation audio/vidéo # Si true : le record vidéo n'embed PAS l'audio (track audio retirée). # L'audio est forcément capturé dans un fichier séparé (force STUDIO_RECORD_AUDIO_SEPARATELY=true côté UI). # Use case : montage pro / cleanup audio indépendant. STUDIO_VIDEO_ONLY=false # ── v1.11.22 — Publish to YouTube (optionnel) ──────────────────── # OAuth2 client ID Google pour upload direct depuis le navigateur. # Setup : # 1. https://console.cloud.google.com → nouveau projet # 2. Activer YouTube Data API v3 # 3. Credentials → OAuth client ID → Web application # 4. Authorized JavaScript origins : http://localhost:4499 + ton domaine prod # 5. Coller le client ID ici (NEXT_PUBLIC_ pour exposition browser) # Si vide, le bouton "Publish to YouTube" sera désactivé avec tooltip. NEXT_PUBLIC_STUDIO_YOUTUBE_CLIENT_ID= # ── v1.12.0 — Multi-camera : caméra par défaut (optionnel) ─────── # Le studio détecte toutes les caméras (videoinput) au runtime et propose un #