# Abstraction Framework for AI-Generated Marketplace Video Ads

**A generative pipeline that converts product cards into compelling short-form video advertisements requires three interlocking systems: a story generation engine built on proven copywriting formulas, category-specific creative parameters, and structured prompts optimized for keyframe and video synthesis.** This framework synthesizes advertising research, marketplace requirements, and AI prompting patterns into actionable templates that balance universal effectiveness principles with product-specific customization.

The framework addresses your specific pipeline: product card ingestion → LLM generates 2-act story → AI generates first/last keyframes → Veo3 produces final video. Every component is parameterized for automation while remaining specific enough for quality output across electronics, fashion, cosmetics, food, home goods, and fitness categories.

---

## The 2-act story structure that drives marketplace conversion

Short-form marketplace video ads perform best with a **Problem-Transformation** architecture rather than traditional 3-act storytelling. Research shows videos under 30 seconds should deliver complete emotional arcs in exactly two movements: **Act 1 establishes tension** (the "before" state), **Act 2 delivers resolution** (the "after" state via product). This structure maps perfectly to the first-frame/last-frame keyframe workflow.

**The canonical 2-act beat pattern for marketplace ads:**

| Beat | Timing | Function | Visual/Emotional Content |
|------|--------|----------|-------------------------|
| **Hook** | 0-2 sec | Stop scroll | Pattern interrupt, bold visual, identity call-out |
| **Problem** | 2-6 sec | Create tension | Pain point visualization, frustration cue |
| **Bridge** | 6-8 sec | Product entry | Product appears as catalyst |
| **Transformation** | 8-12 sec | Resolution | Demonstration of solution |
| **Outcome** | 12-14 sec | Desire | Happy result, satisfied state |
| **CTA** | 14-15 sec | Action | Clear directive |

The first keyframe should capture the **peak tension moment** from Act 1 (second 4-6), while the last keyframe captures the **peak satisfaction moment** from Act 2 (second 12-14). This gives Veo3 clear emotional endpoints to animate between.

Three copywriting formulas translate best to this 2-act visual structure:

- **PAS (Problem-Agitate-Solution)**: Act 1 = Problem + Agitation, Act 2 = Solution + Outcome. Best for products solving specific pain points—organizing tools, skincare, cleaning products.
- **BAB (Before-After-Bridge)**: Act 1 = Before state, Act 2 = After state with product as bridge. Best for transformation products—fitness equipment, cosmetics, fashion.
- **AIDA compressed**: Act 1 = Attention + Interest (hook + problem), Act 2 = Desire + Action (solution + CTA). Best for awareness campaigns and new product launches.

---

## The master prompt template for LLM story generation

Your LLM should receive a **structured prompt with slot variables** filled from the product card and category configuration. The template below enforces consistent output structure while allowing creative variation:

```
===== SYSTEM =====
You are an advertising creative director specializing in {category} products.
Create video ad scenarios that feel authentic and drive marketplace conversions.

===== PRODUCT CONTEXT =====
Product: {product_name}
Category: {product_category}
Primary Benefit: {primary_benefit}
Key Features: {feature_list}
Price Point: {price_tier} [budget/mid/premium]
Target Audience: {audience_description}

===== CREATIVE BRIEF =====
Objective: Generate a 2-act video ad story (15 seconds total)
Format: {aspect_ratio} for {platform}
Structure: Problem-Transformation arc

Act 1 (0-7 seconds): Establish problem/tension
- Show relatable pain point that {audience_description} experiences
- Visual should communicate problem WITHOUT product present
- End with peak frustration/need moment

Act 2 (7-15 seconds): Deliver transformation
- Introduce product naturally as solution
- Show product in use solving the problem
- End with satisfied outcome and subtle CTA

===== STYLE PARAMETERS =====
Visual Aesthetic: {visual_style}
Lighting: {lighting_style}
Camera Language: {camera_vocabulary}
Emotional Arc: {emotion_start} → {emotion_end}
Setting Type: {setting_type}

===== OUTPUT FORMAT =====
Respond with valid JSON matching this schema exactly:
{json_schema}

===== CONSTRAINTS =====
- Each act must be achievable in a single continuous shot
- Product integration must feel natural, not forced
- No on-screen text in visual descriptions (handled separately)
- Maximum 10 distinct objects per scene for generation quality
- All subjects must be described consistently across acts
```

---

## JSON schema for structured story output

Enforce consistent, parseable output with this schema that maps directly to keyframe and video generation:

```json
{
  "story": {
    "title": "string",
    "total_duration_seconds": 15,
    "acts": [
      {
        "act_number": 1,
        "duration_seconds": 7,
        "scene_description": "Detailed description of setting and environment",
        "subject": "Primary character/user description (age, appearance, clothing)",
        "subject_action": "What the subject is doing",
        "subject_emotion": "Emotional state (frustrated, confused, tired, etc.)",
        "product_visible": false,
        "camera_shot": "Shot type (medium shot, close-up, wide shot)",
        "camera_movement": "Camera motion (static, slow push, tracking)",
        "lighting": "Lighting description matching category style",
        "key_visual_moment": "The specific frame that captures this act's essence"
      },
      {
        "act_number": 2,
        "duration_seconds": 8,
        "scene_description": "Same or transformed setting",
        "subject": "Same subject description for consistency",
        "subject_action": "Action showing product use and satisfaction",
        "subject_emotion": "Resolved emotional state (relieved, satisfied, confident)",
        "product_visible": true,
        "product_placement": "How and where product appears",
        "camera_shot": "Shot type",
        "camera_movement": "Camera motion",
        "lighting": "Transformed lighting if applicable",
        "key_visual_moment": "The specific frame showing transformation"
      }
    ],
    "visual_style": "Overall aesthetic direction",
    "cta_text": "Call to action text for overlay",
    "sound_design": "Ambient sound and music mood description"
  }
}
```

---

## Category-to-style mapping registry

Different product categories require distinct visual languages, emotional registers, and pacing. This configuration registry automatically injects appropriate creative parameters:

### Electronics
```python
"electronics": {
    "visual_style": "Sleek, modern, minimalist tech aesthetic",
    "lighting_style": "Cool blue tones, edge lighting, backlit subjects",
    "camera_vocabulary": ["macro close-up", "tracking shot", "slow reveal"],
    "setting_type": ["modern home office", "minimalist workspace", "urban apartment"],
    "emotion_start": "frustration with outdated technology",
    "emotion_end": "confident, in-control satisfaction",
    "pacing": "dynamic, precise cuts",
    "sound_mood": "synthetic ambient, subtle electronic",
    "typical_problems": ["slow performance", "cable mess", "poor connectivity", "outdated design"]
}
```

### Fashion/Apparel
```python
"fashion": {
    "visual_style": "Editorial, high-contrast, aspirational lifestyle",
    "lighting_style": "Dramatic studio lighting, golden hour outdoor",
    "camera_vocabulary": ["full-body tracking", "detail close-up", "mirror reflection"],
    "setting_type": ["urban street", "stylish interior", "lifestyle environment"],
    "emotion_start": "uncertainty about appearance",
    "emotion_end": "confident, self-assured presence",
    "pacing": "rhythmic, music-driven",
    "sound_mood": "contemporary trending music, fabric texture sounds",
    "typical_problems": ["nothing to wear", "outdated style", "poor fit", "boring wardrobe"]
}
```

### Cosmetics/Beauty
```python
"cosmetics": {
    "visual_style": "Clean beauty, soft glamour, transformation focus",
    "lighting_style": "Soft ring light, diffused natural, flattering angles",
    "camera_vocabulary": ["mirror shot", "application close-up", "before-after split"],
    "setting_type": ["vanity setup", "bathroom counter", "natural light window"],
    "emotion_start": "self-consciousness about skin/appearance",
    "emotion_end": "radiant confidence, self-love",
    "pacing": "satisfying, ASMR-adjacent",
    "sound_mood": "gentle ambient, product texture sounds",
    "typical_problems": ["skin concerns", "time-consuming routine", "products that don't work", "aging signs"]
}
```

### Food/Beverages
```python
"food_beverage": {
    "visual_style": "Warm, appetizing, lifestyle-integrated",
    "lighting_style": "Golden hour warmth, natural daylight, cozy interior",
    "camera_vocabulary": ["overhead pour shot", "steam/texture macro", "first-bite reaction"],
    "setting_type": ["kitchen counter", "dining table", "cafe environment", "outdoor picnic"],
    "emotion_start": "craving, hunger, energy depletion",
    "emotion_end": "satisfied, energized, comforted",
    "pacing": "leisurely, indulgent moments",
    "sound_mood": "ASMR food sounds, gentle ambient music",
    "typical_problems": ["hunger", "low energy", "boring meals", "no time to cook"]
}
```

### Home Goods
```python
"home_goods": {
    "visual_style": "Clean organization, lifestyle transformation, before-after clarity",
    "lighting_style": "Bright natural light, clean white balance",
    "camera_vocabulary": ["reveal pan", "organization montage", "space transformation"],
    "setting_type": ["cluttered-to-clean room", "specific storage area", "living space"],
    "emotion_start": "overwhelm from clutter/chaos",
    "emotion_end": "calm satisfaction, control restored",
    "pacing": "satisfying progression, transformation moments",
    "sound_mood": "calming ambient, subtle organization sounds",
    "typical_problems": ["clutter", "wasted space", "can't find things", "visual chaos"]
}
```

### Health/Fitness
```python
"health_fitness": {
    "visual_style": "Aspirational achievement, authentic effort, transformation",
    "lighting_style": "Energetic bright or dramatic gym lighting",
    "camera_vocabulary": ["action tracking", "effort close-up", "result reveal"],
    "setting_type": ["home gym", "outdoor exercise", "morning routine"],
    "emotion_start": "struggle, low energy, fitness frustration",
    "emotion_end": "empowered, accomplished, energized",
    "pacing": "energetic, motivating rhythm",
    "sound_mood": "driving beat, achievement music",
    "typical_problems": ["no time to exercise", "plateau", "boring workouts", "no results"]
}
```

---

## Keyframe generation prompt formula

For the image generation step (DALL-E 3, Midjourney, or Stable Diffusion), construct prompts from the story JSON using this formula:

```
[Shot type] of [subject description], [subject action and emotion].
Setting: [scene description].
Lighting: [lighting style from category].
Mood: [emotional state].
Style: [visual aesthetic], commercial product photography, high resolution.
Camera: [lens suggestion], [depth of field].
```

**First keyframe example (Act 1 peak tension):**
```
Medium shot of a woman in her late 20s with dark hair, rubbing her temples 
in frustration while staring at tangled cables on a cluttered desk.
Setting: Modern home office with afternoon light, papers scattered.
Lighting: Cool overhead fluorescent mixed with warm window light creating 
visual tension.
Mood: Overwhelmed, frustrated, seeking solution.
Style: Authentic lifestyle photography, relatable commercial aesthetic, 8K.
Camera: 35mm lens, medium depth of field with cluttered background visible.
```

**Last keyframe example (Act 2 resolution):**
```
Medium shot of the same woman, now smiling contentedly while using a sleek 
wireless charger on a clean, organized desk.
Setting: Same office, now decluttered and peaceful with soft afternoon glow.
Lighting: Warm golden hour light streaming through window, inviting atmosphere.
Mood: Satisfied, in control, peaceful.
Style: Aspirational lifestyle photography, premium commercial aesthetic, 8K.
Camera: 35mm lens, shallow depth of field with soft bokeh background.
```

**Critical consistency rule**: The subject description must remain **identical** across both keyframes for character coherence in video generation.

---

## Veo3 video prompt assembly

Veo3 responds best to the **5-part formula**: Cinematography + Subject + Action + Context + Style/Ambiance. For your first-to-last keyframe workflow:

```
[Camera movement and shot type], [subject from JSON], [transitional action 
connecting both emotional states], [setting description], [style and ambiance].

Optional audio direction:
"SFX: [sound effect description]"
"Ambient: [background sound]"
"Music mood: [energy level and genre]"
```

**Example video prompt for the cable clutter → wireless charger scenario:**
```
Slow push-in medium shot, a woman in her late 20s with dark hair, 
transitioning from rubbing her temples in frustration to smiling with 
satisfaction as she discovers and uses a sleek wireless charging solution.
The scene takes place in a modern home office that transforms from 
cluttered chaos to clean organization. The lighting shifts from harsh 
overhead fluorescent to warm golden hour glow streaming through the window.
Commercial lifestyle aesthetic, smooth cinematic motion.

Ambient: Soft office sounds transitioning to peaceful silence.
Music mood: Tension releasing into calm satisfaction.
```

**Advanced technique—timestamp prompting** for more control:
```
[00:00-00:03] Medium shot, woman frustrated with tangled cables, 
cluttered desk, cool harsh lighting, stressed expression.

[00:03-00:07] Same shot, woman discovers product on desk, 
expression shifts to curiosity, lighting begins warming.

[00:07-00:12] Woman using wireless charger, desk now organized, 
warm golden light, satisfied smile, gentle product demonstration.

[00:12-00:15] Close-up of woman's relieved expression, then pull back 
to reveal clean organized space with product centered.
```

---

## Marketplace platform requirements summary

Design for the most restrictive platform, then adapt:

| Specification | Amazon | Ozon | Wildberries | Universal Target |
|--------------|--------|------|-------------|------------------|
| **Duration** | 6-45s (20s rec.) | Max 30s (15s rec.) | Up to 60s | **15 seconds** |
| **Aspect Ratio** | 16:9 | 16:9 | 16:9 or 1:1 | **16:9 + 1:1 variants** |
| **Resolution** | 1920x1080 | 960x540 to 1920x1080 | 720p-1080p | **1920x1080** |
| **File Size** | <500MB | <50MB (25MB rec.) | <50MB | **<25MB** |
| **Sound** | Autoplay muted | <5% enable sound | Silent autoplay | **Design silent-first** |

**Critical universal rules:**

- **First frame = no black**, product or compelling visual immediately
- **Design for sound-off**: all key messages communicated visually
- **Mobile-first**: 70%+ of marketplace traffic is mobile
- **No logos in first 3 seconds** (hurts engagement)
- **Burned-in captions** for any dialogue or key points
- **Product visible within first 5 seconds** of Act 2

---

## Quality evaluation framework using ABCD criteria

Validate generated ads against Google's research-backed ABCD framework (delivers **+30% sales lift**):

| Principle | Pass Criteria | Fail Indicators |
|-----------|---------------|-----------------|
| **Attention** | Hook in first 2-3 seconds, tight framing, bold imagery | Black opening frame, slow start, no visual interest |
| **Branding** | Product visible by second 5-7, natural integration | No product visibility, forced placement |
| **Connection** | Clear emotional arc, relatable scenario | Flat emotion, unrelatable situation |
| **Direction** | Specific CTA with urgency element | No clear action, vague ending |

**Automated quality checklist for pipeline:**

```python
quality_checks = {
    "hook_present": "Visual interest in frames 0-60 (first 2 seconds at 30fps)",
    "no_black_frames": "First frame has >10% non-black pixels",
    "product_visible": "Product detected in final 50% of video",
    "face_visible": "Human face detected in at least 30% of frames",
    "motion_present": "Optical flow >threshold between keyframes",
    "duration_compliant": "Total duration between 14-16 seconds",
    "aspect_ratio_correct": "Output matches 16:9 or 1:1 specification"
}
```

---

## The complete pipeline implementation pattern

```python
def generate_video_ad(product_card: dict) -> VideoAd:
    # 1. Extract and enrich product data
    category = classify_category(product_card)
    style_params = CATEGORY_STYLE_MAP[category]
    
    # 2. Generate story with LLM
    story_prompt = build_story_prompt(
        product_card=product_card,
        style_params=style_params,
        json_schema=STORY_SCHEMA
    )
    story_json = llm.generate(
        prompt=story_prompt,
        response_format={"type": "json_schema", "json_schema": STORY_SCHEMA}
    )
    
    # 3. Generate keyframe images
    first_keyframe_prompt = build_keyframe_prompt(
        act=story_json["acts"][0],
        style=style_params,
        moment_type="peak_tension"
    )
    last_keyframe_prompt = build_keyframe_prompt(
        act=story_json["acts"][1],
        style=style_params,
        moment_type="resolution"
    )
    
    first_image = image_api.generate(first_keyframe_prompt)
    last_image = image_api.generate(last_keyframe_prompt)
    
    # 4. Generate video with Veo3
    video_prompt = build_veo_prompt(
        story=story_json,
        style=style_params
    )
    
    video = veo_api.generate(
        prompt=video_prompt,
        first_frame=first_image,
        last_frame=last_image,
        duration=15
    )
    
    # 5. Quality validation
    quality_score = evaluate_abcd(video, story_json)
    
    return VideoAd(
        video=video,
        story=story_json,
        keyframes=[first_image, last_image],
        quality_score=quality_score
    )
```

---

## Human-in-the-loop feedback taxonomy

Structure human review around these decision points for efficient iteration:

| Review Dimension | Rating Scale | Feedback Categories |
|-----------------|--------------|---------------------|
| **Hook Effectiveness** | 1-5 | "Too slow" / "Unclear problem" / "Not relatable" / "Effective" |
| **Product Integration** | 1-5 | "Forced" / "Too late" / "Not visible enough" / "Natural" |
| **Emotional Arc** | 1-5 | "Flat" / "Rushed" / "Disconnected" / "Compelling" |
| **Visual Quality** | 1-5 | "Artifacts" / "Inconsistent" / "Uncanny" / "Professional" |
| **Category Fit** | 1-5 | "Wrong tone" / "Mismatched style" / "Appropriate" |
| **Platform Fit** | 1-5 | "Wrong format" / "Silent-unfriendly" / "Optimized" |

**Feedback-to-parameter mapping** for automated improvement:
- "Too slow" → Reduce Act 1 duration by 1-2 seconds
- "Product too late" → Move product entry to second 5-6
- "Flat emotion" → Increase emotion_start/emotion_end contrast
- "Wrong tone" → Switch to alternative category style preset

---

## Conclusion: A modular, extensible abstraction system

This framework provides **three levels of abstraction** that work together:

**Universal layer** (works across all categories): The 2-act Problem-Transformation structure, 15-second duration target, silent-first design, ABCD quality criteria, and the core prompt template architecture remain constant regardless of product type.

**Category layer** (varies by product type): Visual style, lighting, camera vocabulary, emotional registers, setting types, and typical problem scenarios are parameterized per category and automatically injected into prompts.

**Instance layer** (varies per product): Product name, specific benefits, price tier, and target audience come from the product card and fill the remaining template slots.

The system is designed for extensibility—adding a new product category requires only defining a new entry in the style mapping registry with its characteristic visual language and emotional patterns. The template structures, JSON schemas, and quality criteria remain stable.

For optimal results, **generate 3-5 story variants** per product and A/B test hooks aggressively—research shows hook variation has the highest impact on performance, with top-performing hooks experiencing **37% performance decay after just 7 days**. Build continuous creative refresh into your pipeline from day one.