Communitygithub.com

ai-ad-video-studio

End-to-end AI marketing & motion-graphics video production skill. Combines a 5-beat AIDA/PAS vertical ad framework (9:16 1080x1920 safe zones), deterministic 2D Canvas animation (window.renderFrame), procedural SFX/BGM synthesis, Playwright + FFmpeg MP4 rendering, and a mandatory deliver-and-verify QA loop. Use when creating TikTok/Reels/Shorts ads, product launch promos, or code-driven motion videos.

What is ai-ad-video-studio?

ai-ad-video-studio is a Cursor agent skill that end-to-end AI marketing & motion-graphics video production skill. Combines a 5-beat AIDA/PAS vertical ad framework (9:16 1080x1920 safe zones), deterministic 2D Canvas animation (window.renderFrame), procedural SFX/BGM synthesis, Playwright + FFmpeg MP4 rendering, and a mandatory deliver-and-verify QA loop. Use when creating TikTok/Reels/Shorts ads, product launch promos, or code-driven motion videos.

Works with~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/xomno01/ai-ad-video-studio/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

AI Ad Video Studio

Complete, self-contained workflow for building and rendering high-converting vertical marketing ad videos (9:16, 1080×1920, H.264 + AAC MP4) from code — zero external stock footage or paid video APIs required.


1. Marketing Ad Structure (5-Beat 15s Blueprint)

Design every ad around 5 crisp, high-contrast beats inside TikTok/Reels/Shorts safe margins (x: 90..990, y: 220..1580):

BeatTimeGoalVisual & Motion Pattern
1. Hook0.0s – 3.0sStop the scroll in < 1.5sDark high-contrast bg, alert pill, kinetic 2-line question, relatable chat/UI failure + spring-overshoot stamp + screen shake
2. Problem / Agitate3.0s – 5.8sTwist the knife on 3 pain pointsHalftone editorial contrast, 3 staggered pain cards (01, 02, 03) with easeOutBack pop-in
3. Hero Reveal5.8s – 9.8sIntroduce the product as saviorSpotlight beam sweep + glowing 3D-shaded 2D-canvas product + orbital particles + clear value proposition
4. Proof9.8s – 12.6sQuantify Before vs AfterAnimated comparison progress bars (Red Before vs Emerald/Gold After) + social proof rating badge
5. CTA End Card12.6s – 15.0sDrive immediate clickMini hero icon + urgency offer badge + pulsing gradient CTA button + bouncing pointer

2. Deterministic Rendering Architecture

Never rely on real-time requestAnimationFrame recording (which drops frames under load). Always expose a pure deterministic function:

window.renderFrame = function (t) {
  // t = elapsed seconds in [0, duration]
  // Draw exact state at timestamp t onto 1080x1920 2D Canvas
};

Memory & Performance Rules

  • Prefer 2D Canvas (simulate 3D lighting, capsules, spotlights, and orbital rings mathematically) so 8GB RAM machines render 1080×1920 cleanly without WebGL context crashes.
  • Render 1 video at a time and pipe raw PNG screenshots directly into ffmpeg stdin (image2pipe).
  • Encode with +faststart: libx264, yuv420p, crf 18, aac 192k, -movflags +faststart for instant mobile ad playback.

3. Quickstart Commands

Prerequisites

  • Python 3.9+ with playwright (pip install playwright)
  • Google Chrome or Microsoft Edge installed
  • ffmpeg and ffprobe on PATH

Step 1: Customize Template

Copy templates/vertical-ad-9x16.html to your project's index.html and customize the copy, brand colors, product illustration, and benchmark numbers inside window.renderFrame(t).

Step 2: Synthesize Audio (scripts/generate_audio.py)

python scripts/generate_audio.py --out audio.wav --duration 15.0 --bpm 128

Generates a 44.1kHz stereo WAV with an upbeat electronic bass pulse, hook impact, scene-cut whooshes (3.0s, 5.8s, 9.8s, 12.6s), hero sub-drop + chime, and CTA resolve chord.

Step 3: Render MP4 + QA Keyframes (scripts/render.py)

python scripts/render.py --html index.html --audio audio.wav --out ad-final.mp4 --fps 30 --duration 15.0 --qa-dir .

4. Mandatory Deliver-and-Verify QA Loop

Never report a video as done after compilation/rendering alone:

  1. Probe MP4 metadata:
    ffprobe -v error -show_entries format=duration,size -show_entries stream=codec_type,codec_name,width,height,r_frame_rate -of default=noprint_wrappers=1 ad-final.mp4
    
    Confirm 1080x1920, h264, aac, expected duration, and non-zero file size.
  2. Inspect all 5 QA keyframe PNGs (qa_01_hook.png through qa_05_cta.png):
    • Check for clipped or overlapping text.
    • Check for blank frames or elements outside the 9:16 safe zone.
    • Fix index.html and re-render if any visual defect is found.

5. Ecosystem & Companion Workflows

When expanding beyond code-driven 2D Canvas ads:

  • NLE Timeline Editing: Use Editroom MCP (robbietilton/Editroom) for multi-cursor assembly when you need an editable timeline.
  • React Video: Use remotion-skills (remotion-dev/skills) for long-form data/SaaS videos.
  • Motion Craft: Use vibe-motion-skills, video-shotcraft, emilkowalski-skills, and iart-motion-skills.
  • Talking-Head & B-Roll: Use faster-whisper (ms-level word timestamps) + seecut + gbro-collage-broll.

Related Skills