video-forge — Multi-Channel Video Generation + Voiceover Synthesis Engine
Generates AI videos via the fal.ai queue API, synthesizes voiceover videos with TTS + ffmpeg—no-dependency Node CLI, sibling of image-forge / music-forge. Model routing, endpoints, parameter enums, and pricing are centralized in a JSON registry—add a model = change config, not code.
Key configuration: FAL_KEY (fal.ai, required for video). Optional voiceover: ELEVENLABS_API_KEY (English) or Volc VOLC_TTS_API_KEY (Chinese, 豆包 seed-tts V3). Voiceover language split: Chinese → volc channel, English → elevenlabs channel. Replicate channel is scaffolded (REPLICATE_API_TOKEN). Keys are never written to any file, commit, document, or log.
Single entry point: the host project creates a thin wrapper that forwards parameters to this skill's scripts/—never duplicates the implementation.
Upon activation the system provides the Base directory (hereafter <skill>):
<skill>/scripts/gen-video.js— video CLI (submit → poll → download → validate → accounting)<skill>/scripts/gen-tts.js— voiceover CLI (ElevenLabs / Volc, character accounting + balance check)<skill>/scripts/assemble.js— ffmpeg assembly (video + voiceover + BGM ducking)<skill>/scripts/inspect.js— pre-delivery review (ffprobe summary + uniform frame extraction)<skill>/scripts/gen-srt.js— speech recognition subtitle generation (whisper bilingual Chinese/English, data URI direct injection, no storage needed)<skill>/scripts/budget.js— spending report + dual-axis monthly budget (video USD / TTS characters)<skill>/providers/— channel implementations (fal queue, replicate scaffold, 2× TTS)<skill>/models.json— registry: models, endpoints, enums, prices, TTS config<skill>/reference/— endpoint contracts, prompting guide, quality matrix, and lessons learned
Quick Start
GEN=<skill>/scripts/gen-video.js
# Cheapest text-to-video (wan-3.0 480p 5s ≈ $0.25, silent—post-dubbed)
node $GEN --model wan30 --prompt "Rainy neon street at night, slow motion" --resolution 480p --duration 5
# Image-to-video first choice (H3 turbo promo $0.015/s → 6s ≈ $0.09)
node $GEN --model h3-max-turbo --image first-frame.png --prompt "Camera slowly pushes in"
# Native audio track (Gemini Omni Flash 1.1, 360p $0.03/s)
node $GEN --model omni-flash-11 --prompt "Sunrise at sea, sound of waves"
# Voiceover (ElevenLabs free tier) → BGM ducking assembly
node <skill>/scripts/gen-tts.js --text "Welcome to our show." --out vo.mp3
node <skill>/scripts/assemble.js --video video.mp4 --voiceover vo.mp3 --bgm bgm.mp3 --duck
# Spending / Budget
node <skill>/scripts/budget.js --check
Every successful generation appends to scripts/gen-log.jsonl (shared ledger, gitignored; video lines have est_usd, TTS lines have chars).
Workflow
- Budget check: Before the first generation of each session, run
budget.js --check. A single video costs $0.09-3, an order of magnitude more expensive than image generation. - Confirm intent (skip if user already specified): ① Visual content and aspect ratio (16:9/9:16) ② Duration ③ Whether native audio/voiceover is needed ④ Target platform.
- Model selection (selection criteria, calibrated 2026-10-10): Text-to-video & video editing →
wan30; Image-to-video →h3-max-turbo(i2v first choice, best value); High-quality narrative →seedance20/seedance25(expensive, confirm before use); With native audio →omni-flash-11(360p $0.03/s); 2K/4K →h3. Silent models get voiceover via gen-tts + assemble. - Prompt and parameters: Follow
reference/prompting.md— five-layer prompt structure, per-model do/don't, parameter cheat sheet (seed / audio toggle / resolution tier cost strategy). - Single generation → validation (ffprobe duration/resolution/audio track) → deliver, let user confirm before iterating. Each iteration = one submission + one feedback, no chained regenerations.
- Assembly: Default discards original audio track;
--clip-volumeretains native audio (used when mixing omni/sound-model with voiceover);--srtburns subtitles (standard for talking-head content). Before delivery, useinspect.jsfor frame extraction review; per-model quality benchmarks are inreference/quality-matrix.md. - Extended endpoints:
--use <name>invokes registryextra_endpoints(h3-max's extend/relight/recast/lipsync, seedance's draft/mini/fast tiers, omni's reference/edit, full directory in endpoints.md)—input slots are strictly validated to prevent accidental charges. - Voiceover language split: Chinese voiceover →
--channel volc(豆包 seed-tts,_uranus_bigttsvoice family, with--clonefor voice cloning); English voiceover →--channel elevenlabs(free tier can only use own generated voices).
Key Rules
Read reference/lessons.md — Status markers: [live] tested, [docs] documentation verified:
- ⚠️ fal queue submissions do not validate the body: a submission with complete fields will definitely produce output and incur charges; only missing required fields or illegal enums cause worker rejection (no charge). Never send 'probe requests' to queue endpoints—unless you confirm the parameters are invalid, and you must have an 'immediate cancel' safety net.
- H3 promotional price (40% off) expires 2026-10-15, after which the registry price must be updated.
omni-flash(v1) is token-billed (input text/audio/video is also billed), making budget estimation difficult—preferomni-flash-11.- Video editing (
--video-input) and H3-max's editing endpoints are still in docs status—test with small clips first. - All 8 model enums have been tested and backfilled in the registry (2026-10-10); long-tail parameters go through
--advanced-json. - ASR uses fal-ai/whisper (bilingual Chinese/English, data URI direct injection, no storage/upload needed); audio >8MB is first split with ffmpeg.
- ElevenLabs free tier API blocks library voices (402) — before dubbing, use
--list-voicesto select category=generated custom voices. - Content compliance: usage of real people's likeness, copyrighted materials, or trademarks requires authorization; platform AI generation labeling obligations rest with the user—self-check before submission.
- Budget dual-axis independent: fal is billed in USD, TTS in characters; overspend exits with code 2, same semantics as image/music-forge.
Registry & Extensibility
models.json holds video models (endpoint / image_endpoint / edit_endpoint / enums / prices) and TTS configuration. Adding a model: read the fal model page → add one JSON entry → run a smoke test generation → backfill tested enums. Adding a channel: replicate the contract from providers/fal-video.js, implement generate(), register in providers.
Boundaries
- For content production only—do not integrate keys or channel calls into delivered production code.
- Commercial release must respect each model vendor's commercial licensing terms; intermediary/aggregated channel output rights may differ from official subscriptions.
- Platform compliance for AI-generated video (marking AI-generated content) is the responsibility of the user.
- Music/BGM generation belongs to music-forge (installed separately); cover images belong to image-forge.