Professional REAL demo video generation with PM-driven scenario decomposition and region-aware recording. Uses Playwright native recording + bmad-agent-pm in...
---
name: auto-video-generator
version: "3.2.0"
description: "Professional REAL demo video generation with PM-driven scenario decomposition and region-aware recording. Uses Playwright native recording + bmad-agent-pm integration for intelligent video production."
author: "AVG Team"
tags:
- video-generation
- real-recording
- playwright-native
- pm-driven
- prd-generation
- region-aware
- scenario-based
- demo-automation
- testing
- tts
category: "development-tools"
license: MIT
homepage: "https://github.com/avg-team/auto-video-generator"
---
# Auto Video Generator V3.2
**PM-Driven & Region-Aware REAL Demo Video Generation**
> ๐ **V3.2 MANDATORY INTERACTIONS (ENFORCED)**:
> - **[MANDATORY #1]** Recording Region Selection MUST prompt user for explicit confirmation
> - **[MANDATORY #2]** Scenario Preview & Validation MUST wait for user approval before recording
> - **[MANDATORY #3]** PRD-Driven Scenario Priority - If bmad-create-prd PRD exists, MUST use PRD scenarios
> ๐ **V3.1 NEW FEATURES**:
> 1. **Recording Region Selection** - Clip to specific UI area (e.g., content area only, exclude sidebar/header)
> 2. **PM-Driven Workflow Integration** - Auto-detect features โ Generate PRD โ Decompose scenarios โ Record per-scenario
> 3. **Scenario-Based Narration** - TTS audio generated from PRD scenarios for professional demos
---
## โ ๏ธ MANDATORY USER INTERACTIONS (V3.2 ENFORCEMENT)
### ๐ด CRITICAL: These interactions are NOT optional - they MUST be implemented
#### [MANDATORY #1] Recording Region Selection - FORCE User Confirmation (NO DEFAULT!)
**Rule**: You **MUST** prompt user to select recording region before starting. **โ FORBIDDEN**: Using full-screen as default or silently using auto-detected region.
**Why**:
- Full-screen recording includes browser address bar, bookmarks, system taskbar (unprofessional)
- Different features need different regions (some need sidebar, some don't)
- User must explicitly confirm to avoid wasting time on incorrect recordings
**Region Types**:
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BROWSER CHROME (exclude this) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ HEADER/TABS (optional) โ โ
โ โ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ SIDEBAR โ CONTENT AREA โ โ โ
โ โ โ (menu) โ (query form + table) โ โ โ
โ โ โ โ โ โ โ
โ โ โ โ โ โ โ
โ โ โโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ SYSTEM TASKBAR (exclude this) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Type A: FULL PAGE WITH SIDEBAR (recommended for navigation demos)
โ Includes sidebar menu + content area
โ Excludes browser chrome & taskbar
Type B: CONTENT ONLY (for feature-focused demos)
โ Content area only, no sidebar
โ Cleaner look for specific functionality
Type C: FULL SCREEN (NOT recommended)
โ Everything including browser chrome
โ Unprofessional for product demos
```
**Implementation Requirements** (Universal IDE Support):
```python
# โ
CORRECT: ALWAYS ask user to select region via AskUserQuestion
async def select_recording_region(self, page) -> Dict:
"""
[MANDATORY] Force user to select recording region.
CRITICAL RULES:
- โ NEVER default to full-screen
- โ NEVER skip user selection
- โ
MUST use AskUserQuestion tool
- โ
MUST provide visual region options
"""
response = await AskUserQuestion({
"questions": [{
"header": "ๅฝๅถๅบๅ",
"question": "่ฏท้ๆฉ่ฆๅฝๅถ็ๅบๅ๏ผๅฝๅไธบๅ
จๅฑๆจกๅผ๏ผ:",
"multiSelect": False,
"options": [
{
"label": "๐บ ้กต้ข+ไพง่พนๆ ๏ผๆจ่๏ผ",
"description": "ๅ
ๅซๅทฆไพงๅฏผ่ช่ๅ+ไธปๅ
ๅฎนๅบ๏ผไธๅซๆต่งๅจ่พนๆกใ้ๅๆผ็คบๅธฆ่ๅๆไฝ็ๅ่ฝ"
},
{
"label": "๐ ไป
ๅ
ๅฎนๅบ",
"description": "ๅชๅฝๅถไธปๅ
ๅฎนๅบๅ๏ผไธๅซๅทฆไพง่ๅใ้ๅ่็ฆๅ่ฝๆฌ่บซ"
},
{
"label": "๐ฅ๏ธ ๅ
จๅฑ",
"description": "ๅ
ๅซๆต่งๅจ่พนๆกใไปปๅกๆ ็ญๆๆๅ
็ด ๏ผไธๆจ่๏ผ"
}
]
}]
})
choice = response['questions'][0]['answer']
if choice == "๐บ ้กต้ข+ไพง่พนๆ ๏ผๆจ่๏ผ":
return {"x": 0, "y": 80, "width": 1920, "height": 1000}
elif choice == "๐ ไป
ๅ
ๅฎนๅบ":
return {"x": 250, "y": 80, "width": 1670, "height": 1000}
else:
return None # Full screen (no cropping)
```
**Playwright Implementation**:
```python
# Use record_video_size parameter to crop video to selected region
ctx = await browser.new_context(
viewport={'width': 1920, 'height': 1080},
record_video_dir=str(video_dir),
record_video_size={
'width': selected_region['width'], # e.g., 1920 or 1670
'height': selected_region['height'] # e.g., 1000
},
locale='zh-CN'
)
```
**โ FORBIDDEN BEHAVIORS**:
- โ Defaulting to full-screen recording without asking
- โ Silently using auto-detected region without confirmation
- โ Hardcoding region coordinates without user input
- โ Recording browser address bar, bookmarks, or system taskbar
**โ
REQUIRED WORKFLOW**:
1. Launch browser (full viewport)
2. **[MANDATORY]** Call `AskUserQuestion` with region options
3. Wait for user selection
4. Apply `record_video_size` to crop video
5. Start recording
---
#### [MANDATORY #2] Scenario Preview & Validation - WAIT for User Approval
**Rule**: After generating scenarios from PM analysis, you **MUST** display all scenarios to the user and wait for their explicit approval before starting recording.
**Why**:
- Users may want to remove irrelevant scenarios
- Users may want to reorder scenarios
- Users may want to add custom scenarios not detected by PM analysis
- Prevents wasted time recording unwanted content
**Implementation Requirements** (Universal IDE Support):
```python
# โ
CORRECT: Use AskUserQuestion tool (works in ALL IDEs: TRAE, Cursor, WorkBuddy, etc.)
async def preview_and_validate_scenarios(self, scenarios: List[Scenario]) -> List[Scenario]:
"""
[MANDATORY] Show scenario list to user for review and confirmation.
CRITICAL: Must NOT start recording until user explicitly confirms.
Use AskUserQuestion tool for universal IDE compatibility.
"""
# Build scenario summary text
scenario_summary = "\n".join([
f" [{s.id}] {s.name} - {s.description} (~{s.duration_estimate}s)"
for s in scenarios
])
# [MANDATORY] Use AskUserQuestion - works in ALL IDEs!
response = await AskUserQuestion({
"questions": [{
"header": "Scenarios",
"question": f"Generated {len(scenarios)} recording scenarios. Approve to start recording?\n{scenario_summary}",
"multiSelect": False,
"options": [
{
"label": "โ
Approve & Start Recording",
"description": "Accept all scenarios and start video recording immediately"
},
{
"label": "โ๏ธ Modify Scenarios",
"description": "Remove/reorder/edit specific scenarios"
},
{
"label": "โ Cancel",
"description": "Abort recording process"
}
]
}]
})
choice = response['questions'][0]['answer']
if "Approve" in choice:
return scenarios
elif choice == "2":
return await self._modify_scenarios(scenarios) # Edit mode
elif choice == "3":
return await self._add_custom_scenario(scenarios) # Add custom
else:
raise KeyboardInterrupt("User cancelled")
```
**User Actions Available**:
| Action | Command | Description |
|--------|---------|-------------|
| **Approve** | Choice `1` | Accept all scenarios and start recording |
| **Remove Scenario** | `REMOVE S5` | Delete scenario S5 from list |
| **Swap Order** | `SWAP S2 S6` | Exchange positions of S2 and S6 |
| **Edit Narration** | `EDIT S3` | Change narration text for S3 |
| **Add Custom** | Choice `3` | Create new scenario manually |
| **Cancel** | Choice `4` | Abort entire process |
**โ FORBIDDEN**: Starting recording without showing this preview screen.
---
#### [MANDATORY #3] PRD-Driven Scenario Priority - USE bmad-create-prd Scenarios When Available
**Rule**: When a PRD has been generated by the `bmad-create-prd` skill, you **MUST** extract scenarios from that PRD instead of auto-generating them. Only auto-generate scenarios when no PRD exists.
**Why**:
- PRD scenarios are carefully designed by PM analysis with proper business context
- PRD scenarios include user stories, acceptance criteria, and narration text
- Auto-generated scenarios lack domain-specific business logic
- Using PRD ensures video demos match the product specification
**Implementation Requirements** (Universal IDE Support):
```python
# โ
CORRECT: Check for existing PRD before generating scenarios
async def resolve_scenarios(self, target_feature: str) -> List[Scenario]:
"""
[MANDATORY] Resolve recording scenarios with PRD priority.
Priority:
1. If bmad-create-prd PRD exists โ Extract scenarios from PRD (MANDATORY)
2. If no PRD exists โ Auto-generate scenarios from page analysis
"""
# Step 1: Check if bmad-create-prd PRD exists
prd_file = await self._find_prd_file(target_feature)
if prd_file:
# [MANDATORY] Use PRD scenarios - DO NOT auto-generate
scenarios = await self._extract_scenarios_from_prd(prd_file)
return scenarios
else:
# Fallback: Auto-generate scenarios from page analysis
scenarios = await self._auto_generate_scenarios()
return scenarios
async def _find_prd_file(self, feature_name: str) -> Optional[Path]:
"""Search for PRD files generated by bmad-create-prd skill."""
search_paths = [
Path("./_bmad-output/prd"),
Path("./docs/prd"),
Path("./prd"),
]
for search_dir in search_paths:
if not search_dir.exists():
continue
for prd_file in search_dir.rglob("*.md"):
content = prd_file.read_text(encoding='utf-8')
if feature_name in content or 'ๅบๆฏ' in content:
return prd_file
return None
async def _extract_scenarios_from_prd(self, prd_file: Path) -> List[Scenario]:
"""Extract recording scenarios from bmad-create-prd PRD."""
content = prd_file.read_text(encoding='utf-8')
# Parse PRD sections: user stories, scenarios, feature descriptions
scenarios = []
# Extract from PRD structure:
# - ## ๅบๆฏ / ## Scenario sections
# - ### ็จๆทๆ
ไบ / ### User Story sections
# - Feature descriptions with step-by-step flows
# ... parsing logic ...
return scenarios
```
**Decision Flow**:
```
User requests video recording
โ
Check: Does bmad-create-prd PRD exist?
โ
YES โ [MANDATORY] Extract scenarios from PRD
โ โ
โ Show PRD scenarios to user via AskUserQuestion
โ โ
โ User approves โ Start recording with PRD scenarios
โ
NO โ Auto-generate scenarios from page analysis
โ
Show auto scenarios to user via AskUserQuestion
โ
User approves โ Start recording with auto scenarios
```
**โ FORBIDDEN**: Ignoring an existing bmad-create-prd PRD and auto-generating scenarios instead.
---
## ๐ V3.2 Workflow (WITH MANDATORY INTERACTIONS)
```
COMPLETE V3.2 WORKFLOW:
=======================
[Step 1] Launch Browser + Enable Recording
โ
[Step 2] Navigate to Target URL (+ Login if needed)
โ
[Step 3] โ ๏ธ [MANDATORY #1] DETECT REGION + PROMPT USER
โ Auto-detect content area
โ SHOW interactive menu (ALWAYS!)
โ Wait for user choice: FULL / CONTENT / CUSTOM
โ User EXPLICITLY selects region
โ
[Step 4] PM Analysis (Auto-detect components + Generate PRD)
โ Detect: trees, forms, buttons, tables, etc.
โ Generate scenarios: S1, S2, S3, ...
โ Save PRD to JSON file
โ
[Step 4.5] โ ๏ธ [MANDATORY #2] PREVIEW SCENARIOS + WAIT FOR APPROVAL
โ Display ALL scenarios in detail table
โ Show narration previews
โ Wait for user action:
Option 1: โ
Approve โ Continue to Step 5
Option 2: โ๏ธ Modify โ Remove/Swap/Edit scenarios
Option 3: โ Add Custom โ Create new scenario
Option 4: โ Cancel โ Abort
โ User EXPLICITLY approves scenarios
โ
[Step 5] EXECUTE RECORDING (Finally!)
โ For each approved scenario:
Execute real interactions (mouse, keyboard, scroll)
All actions recorded to .webm file
โ
[Step 6] Finalize Video (Close browser context)
โ Raw video saved
โ
[Step 7] Generate Audio + Merge
โ TTS narration for each scenario
โ FFmpeg merge video + audio
โ Final MP4 output
TOTAL: 7 Steps + 2 MANDATORY User Interactions
```
---
## ๐ฏ V3.1 NEW CAPABILITIES
### 1๏ธโฃ Recording Region Selection (Clip Region)
**Problem**: Full-page recording includes unnecessary elements (sidebar, header, navigation).
**Solution**: Let users specify which area to record.
```python
# Define recording region (content area only)
region = RecordingRegion(
x=250, # Start X (after sidebar)
y=80, # Start Y (below header)
width=1670, # Content width
height=1000 # Content height
)
# Use region during recording
await recorder.record_with_region_and_scenarios(
url="https://example.com/dashboard",
output_file="./demo.mp4",
options={'region': region}
)
```
**Auto-Detection Strategies**:
- โ
Detect `.ant-layout-content` or `[role="main"]`
- โ
Prompt user to choose: FULL / CONTENT ONLY / CUSTOM
- โ
Support manual coordinate input
### 2๏ธโฃ PM-Driven Scenario Decomposition
**Integration with bmad-agent-pm Skill**:
```
User Request: "Record the comprehensive query feature"
โ
[Step 1] Page Analysis (Auto-detect components)
โ Detects: trees, forms, buttons, tables, date pickers
[Step 2] PRD Generation (Simulated bmad-create-prd)
โ Outputs: Feature name, component list, user stories
[Step 3] Scenario Decomposition
โ Creates: S1-S7 scenarios (Overview โ Selection โ Query โ Results)
[Step 4] Per-Scenario Recording
โ Executes: Real interactions per scenario
[Step 5] Audio Generation
โ Generates: TTS narration based on each scenario
[Step 6] Merge & Output
โ Produces: Final MP4 with professional narration
```
**Example PRD Output**:
```json
{
"feature_name": "็ปผๅๆฅ่ฏข ยท ๅ่ฝฆๆๆฌๆ ธ็ฎ็ณป็ป",
"components_detected": {
"trees": ["ๆฅ่ฏข้กน็ฎ้ๆฉๆ "],
"forms": ["่ฏท่พๅ
ฅๅ
ณ้ฎๅญ่ฟ่ก่ฟๆปค"],
"buttons": ["ๆฅ่ฏข", "้็ฝฎ", "ๅฏผๅบ", "ๆๅฐ"],
"tables": ["Table 1"],
"date_pickers": ["DatePicker 1"]
},
"scenarios": [
{
"id": "S1",
"name": "็้ขๆฆ่ง",
"description": "ๅฑ็คบๆดไฝๅธๅฑๅไธป่ฆๅ่ฝๅบ",
"narration": "ๆฌข่ฟ่ง็็ปผๅๆฅ่ฏขๅ่ฝๆผ็คบ..."
},
{
"id": "S2",
"name": "ๆฅ่ฏข้กน็ฎ้ๆฉ",
"description": "ๅจๆ ๅฝข็ปๆไธญ้ๆฉ่ฆๆฅ่ฏข็้กน็ฎ็ฑปๅ",
"narration": "ๅจๆฅ่ฏข้กน็ฎ้ๆฉๅบๅ..."
},
// ... more scenarios
]
}
```
### 3๏ธโฃ Usage Example (V3.1)
```bash
# Basic usage (auto-detect region + PM analysis)
python record_v3_smart.py --target "http://localhost:8090/#/dashboardIndex/UnityQuery"
# With custom output
python record_v3_smart.py -t "URL" -o "./my-demo.mp4"
# Disable region selection (full page)
python record_v3_smart.py --no-region
```
**Python API**:
```python
from record_v3_smart import SmartVideoRecorderV31
recorder = SmartVideoRecorderV31(verbose=True)
result = await recorder.record_with_region_and_scenarios(
url="https://example.com/feature-page",
output_file="./feature-demo.mp4",
options={
'auto_select_region': True,
'generate_prd': True,
'voice': 'zh-CN-YunxiNeural'
}
)
print(f"โ
Video generated: {result['output_path']}")
print(f" Scenarios: {result['scenarios_count']}")
print(f" Region: {result['region']}")
print(f" PRD saved to: {result['prd_file']}")
```
---
## ๐ฏ CORE PRINCIPLES (INHERITED FROM V3.0)
### ๐ซ WHAT IS STRICTLY FORBIDDEN
**The following approaches are NOT ALLOWED under any circumstances:**
1. โ **Screenshot Capture + FFmpeg Concatenation**
- Taking screenshots at intervals
- Combining them into a video using ffmpeg
- This produces FAKE videos that don't show real interactions
2. โ **Static Frame Generation**
- Generating HTML frames as images
- Creating slideshow-style presentations
- No real user interactions visible
3. โ **Simulated Animations**
- CSS/JavaScript-based fake animations
- Pre-rendered GIF-style content
- Anything that doesn't capture actual browser behavior
### โ
WHAT IS MANDATORY (THE ONLY ACCEPTABLE APPROACH)
**ALL video generation MUST use this exact approach:**
```python
# โ
CORRECT: Playwright Native Recording
from playwright.async_api import async_playwright
pw = await async_playwright().start()
# CRITICAL LINE: Enable video recording in browser context
context = await pw.chromium.launch_persistent_context(
"",
headless=False,
viewport={'width': 1920, 'height': 1080},
record_video_dir="./videos", # โ THIS IS MANDATORY
record_video_size={'width': 1920, 'height': 1080}
)
page = context.pages[0]
# Navigate to target page
await page.goto("https://example.com")
# Execute REAL interactions (these get RECORDED automatically)
await page.mouse.move(500, 300, steps=20) # Real mouse movement
await page.mouse.click(500, 300) # Real click
await page.keyboard.type("Hello") # Real typing
await page.mouse.wheel(0, 500) # Real scroll
# Close context to finalize recording
await context.close()
await pw.stop()
# Result: A .webm file with REAL interactions recorded!
```
---
## ๐ฌ TECHNICAL SPECIFICATION (MUST FOLLOW)
### 1. Browser Context Configuration
**Every implementation MUST include these parameters:**
```python
context = await browser.new_context(
# ... other params ...
# MANDATORY: Video recording directory
record_video_dir=str(video_output_path),
# MANDATORY: Video resolution (must match viewport)
record_video_size={
'width': viewport_width,
'height': viewport_height
},
# Recommended: Full HD by default
viewport={
'width': 1920, # โ Full HD width
'height': 1080 # โ Full HD height
}
)
```
### 2. Real Interaction Methods (MUST USE THESE)
**Mouse Interactions:**
```python
# Smooth mouse movement (REQUIRED for professional look)
await page.mouse.move(x, y, steps=20) # steps=20 makes it smooth
# Click with visual feedback
await page.mouse.click(x, y)
# Scroll with animation
await page.mouse.wheel(delta_x, delta_y)
```
**Keyboard Interactions:**
```python
# Type text character by character (realistic)
await page.keyboard.type("search query", delay=100) # delay=100ms per char
# Press special keys
await page.keyboard.press("Enter")
await page.keyboard.press("Tab")
```
**Element Highlighting (Optional but Recommended):**
```python
# Before click - highlight element
await element.evaluate("""
el => {
el.style.transition = 'outline 0.2s';
el.style.outline = '3px solid #1890ff';
el.style.outlineOffset = '2px';
}
""")
await asyncio.sleep(0.3)
# Perform click
await page.mouse.click(x, y)
# Remove highlight after click
await element.evaluate("""
el => {
el.style.outline = '';
el.style.outlineOffset = '';
}
""")
```
### 3. Video Output Format
**Recording Process:**
1. Playwright records `.webm` format automatically
2. File saved to `record_video_dir` when context closes
3. Merge TTS audio using FFmpeg:
```bash
ffmpeg -i input.webm -i audio.mp3 -c:v libx264 -c:a aac output.mp4
```
---
## ๐ IMPLEMENTATION CHECKLIST (EVERY GENERATION MUST PASS)
Before considering a video generation complete, verify:
- [ ] **Browser launched with `record_video_dir` parameter?**
- [ ] **Viewport set to minimum 1440x900 (recommended 1920x1080)?**
- [ ] **Real `page.mouse.move/click/wheel` calls executed?**
- [ ] **Real `page.keyboard.type/press` calls used if needed?**
- [ ] **Interactions are smooth (steps > 10 for mouse movements)?**
- [ ] **Video duration > 5 seconds for simple pages (> 15s for complex)?**
- [ ] **File size > 1 MB (indicates real content, not blank screen)?**
- [ ] **Audio narration merged successfully?**
- [ ] **Output is MP4 format with H.264 codec?**
If ANY of these fail, the implementation is **INVALID** and must be fixed.
---
## ๐จ What This Skill Does (V3.0)
This skill provides **REAL** automated video generation capabilities:
- **โ
REAL HTML to Video**: Convert any web page into a professional demo video using actual browser recording
- **โ
AI Voice Narration**: Automatic text-to-speech with natural voices (Edge TTS)
- **โ
REAL UI Interaction Recording**: Actual mouse movements, clicks, scrolls, and keyboard input - all captured authentically
- **โ
Multi-Framework Support**: Works with Vue, React, Angular + UI libraries (Ant Design, Element UI, etc.)
- **โ
Smart Page Analysis**: Automatic detection of interactive elements (forms, tables, buttons, menus)
- **โ
Production Ready**: Error handling, retry logic, structured logging
---
## ๐ When to Use This Skill
Use this skill when the user wants to:
1. **Generate REAL Demo Videos**
- "Create a product demo from my landing page" โ Record REAL interactions
- "Make a tutorial video for my dashboard" โ Show REAL navigation
- "Record my web app as a video with voiceover" โ Use REAL user flows
2. **Automate Testing Videos**
- "Create regression test videos for my CI pipeline" โ REAL test execution recorded
- "Generate visual test documentation" โ Authentic test runs, not simulations
- "Record user journey videos" โ Actual user paths through the app
3. **Create Presentations**
- "Turn this HTML prototype into a presentation video" โ REAL prototype interaction
- "Make a marketing video from our SaaS page" โ Show REAL features working
- "Generate onboarding videos" โ Guide users through REAL interface
---
## ๐ป Usage Example (CORRECT V3.0 APPROACH)
### Python API (RECOMMENDED)
```python
import asyncio
from auto_video_generator import VideoGenerator
async def main():
gen = VideoGenerator(verbose=True)
result = await gen.generate(
source="https://example.com/dashboard",
output="./demo.mp4",
options={
"viewport_width": 1920, # Full HD
"viewport_height": 1080,
"voice": "zh-CN-YunxiNeural", # Chinese voice
"headless": False, # Show browser window
"show_cursor": True, # Show mouse cursor
"highlight_clicks": True, # Highlight clicked elements
}
)
print(f"โ
REAL Video generated!")
print(f" Duration: {result.duration_seconds:.1f}s")
print(f" Size: {result.file_size_mb:.2f} MB")
print(f" Resolution: {result.resolution}")
asyncio.run(main())
```
### What Happens Internally (V3.0)
```
1. Launch Chrome with recording enabled (record_video_dir)
2. Navigate to target URL
3. Analyze page structure (detect forms, buttons, tables)
4. Execute REAL interactions:
- Mouse moves smoothly to elements
- Clicks buttons with highlight effects
- Types in input fields
- Scrolls to show content
5. All actions automatically recorded as .webm
6. Generate TTS audio narration
7. Merge video + audio โ final MP4
8. Return result with metadata
```
---
## โ๏ธ Configuration Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `viewport_width` | int | 1920 | Video width (min: 1440) |
| `viewport_height` | int | 1080 | Video height (min: 900) |
| `voice` | string | zh-CN-YunxiNeural | Edge TTS voice name |
| `rate` | string | "-5%" | Speech rate adjustment |
| `headless` | bool | False | Hide browser window |
| `show_cursor` | bool | True | Show mouse cursor in video |
| `highlight_clicks` | bool | True | Highlight elements before clicking |
| `fps` | int | 4 | Target frames per second |
| `quality` | string | "high" | Video quality (low/medium/high) |
---
## ๐ก๏ธ Quality Standards (MUST MEET)
### Minimum Requirements
Every generated video MUST meet these standards:
1. **Duration**
- Simple pages (landing): โฅ 10 seconds
- Medium complexity (dashboard): โฅ 20 seconds
- Complex apps (full workflow): โฅ 30 seconds
2. **Resolution**
- Minimum: 1440ร900
- Recommended: 1920ร1080 (Full HD)
- Maximum: 2560ร1440 (2K)
3. **File Size**
- Minimum: 2 MB (indicates real content)
- Typical: 5-50 MB depending on duration
- If < 1 MB: Something went wrong (blank screen?)
4. **Content Quality**
- โ
Shows REAL page content (not blank/white)
- โ
Contains REAL mouse movements (visible cursor)
- โ
Has REAL clicks on UI elements
- โ
Includes scrolling behavior
- โ
Audio narration synced with visuals
---
## ๐ง Common Mistakes TO AVOID
### โ WRONG: Screenshot-based Approach
```python
# DON'T DO THIS!
for i in range(100):
await page.screenshot(path=f"frame_{i}.png") # โ Screenshots!
await asyncio.sleep(0.1)
# Then use ffmpeg to combine images... # โ Fake video!
```
### โ
CORRECT: Real Recording Approach
```python
# DO THIS INSTEAD!
context = await browser.new_context(
record_video_dir="./videos" # โ
Enable recording!
)
page = await context.new_page()
await page.goto("https://example.com")
# Real interactions that get recorded automatically
await page.mouse.move(500, 300, steps=20)
await page.mouse.click(500, 300)
await context.close() # โ
Finalizes recording
```
---
## ๐ Version History
### V3.2.0 (CURRENT) - Mandatory User Interactions
- **BREAKING CHANGE**: Region selection now REQUIRES explicit user confirmation (even with auto-detect)
- **BREAKING CHANGE**: Scenario preview is MANDATORY before recording (user must approve)
- **NEW**: Interactive region selection menu with visual layout diagram
- **NEW**: Scenario preview & validation system with edit/remove/add capabilities
- **ENHANCED**: User can modify scenarios (remove, reorder, edit narration, add custom)
- **ENHANCED**: Clear visual feedback showing page layout and detected regions
- **SECURITY**: Prevents accidental wrong-area recordings and wasted time
### V3.1.0 - PM-Driven & Region-Aware
- **NEW**: Recording region selection (clip to content area, exclude sidebar/header)
- **NEW**: Integration with bmad-agent-pm workflow (PRD generation โ scenario decomposition)
- **NEW**: Scenario-based TTS narration generation
- **NEW**: Auto-detection of page components for intelligent scenario creation
- **IMPROVED**: User prompts for region selection (FULL / CONTENT ONLY / CUSTOM)
- **ENHANCED**: PRD output as JSON file alongside video
### V3.0.0 - Real Recording Mandate
- **BREAKING CHANGE**: Screenshot-based generation completely removed
- Added mandatory `record_video_dir` requirement
- Implemented real mouse/keyboard interaction recording
- Full HD default resolution (1920ร1080)
- Enhanced quality standards and validation
### V2.0.0 - Previous Version (DEPRECATED)
- Used screenshot capture approach
- Produced low-quality short videos
- **No longer supported - upgrade to V3.1**
---
## ๐ค Contributing
All contributions MUST follow the V3.2 standard:
- โ
Use Playwright native recording (`record_video_dir`)
- โ
Support region-aware recording (clip areas)
- โ
[MANDATORY] Force user to confirm recording region before starting
- โ
[MANDATORY] Show scenario preview and wait for user approval before recording
- โ
Integrate with bmad-agent-pm for PRD-driven scenarios
- โ No silent auto-detection without user confirmation allowed
---
## ๐ License
MIT License
---
**Version**: 3.2.0 (Mandatory User Interactions)
**Last Updated**: 2026-05-30
**Status**: PRODUCTION READY โ
**Maintained by**: AVG Team
**Integration**: bmad-agent-pm (PM workflow)
don't have the plugin yet? install it then click "run inline in claude" again.