Most AI video tools charge monthly subscriptions, cap your exports, and still leave you doing the boring glue work: checking if a topic is repetitive, trimming awkward audio cutoffs, stitching an outro, writing YouTube tags, and scheduling.
So I built APEX CINEGEN PRO — a self-hosted Python pipeline that turns a single tap in Telegram into a mastered, scheduled YouTube Short.
What the Pipeline Does End-to-End
- Story Ideation: Brainstorms 10 dialogue-dense concepts.
- Gemini 2.5 Flash Virality Audit: Scores each concept for 2-Clip (20s) or 3-Clip (30s) pacing, checks
used_topics.jsonto prevent repeats, and auto-rerolls weak ideas. - Automated Google Flow Calibration (Playwright CDP): Disables Flow Agent on fresh projects, falls back to
Omni 1.1 Flash/.duration-sliderif10sisn't exposed, locksVideo · 720p · 10s · 9:16 · x1, and captures the MP4 viaexpect_download(). - FFmpeg Mastering: Stitches your custom outro with a smooth
0.3safadeaudio transition and extracts cover frames. - Telegram Mobile Studio + YouTube Data API v3: Delivers the playable MP4 straight to your phone with inline buttons (
Approve & Schedule (9 PM IST),View Tags & Info,Publish Instantly) and packs up to 24+ tags inside YouTube's480-character quote-aware limit.
3 Engineering Lessons That Made It Reliable
- The 1.5s Breathing Buffer: AI video clips love cutting off the last word at
10.0s. Enforcing22–26words/clip plus a1.5ssilent visual tail solved it. - UI Fallback Calibration: Web UIs change selectors and model defaults. Having an automatic fallback from
Omni 1.2 FlashtoOmni 1.1 Flash+ slider control kept batch runs (2x–10x) from stalling. - Quote-Aware Tag Packing: Naively joining tags blows past YouTube's
500-char limit once multi-word tags get quoted.
Check Out the Repo
Full architecture diagram, live demo MP4s, and quickstart are on GitHub:
https://github.com/mehaksandhudev/apex-cinegen-pro
If you're building multi-step AI pipelines or Playwright CDP automations, I'd love your feedback in the comments!
