AI Video Generation
Quick Reference
| Model |
Provider |
Duration |
Best For |
| Veo 3.1 |
Google |
4-8s |
Simple scenes, products |
| Sora 2 |
OpenAI |
4-12s |
Complex scenes |
| Kling Pro |
fal.ai |
5-10s |
Industrial, IoT |
Model Selection
# Auto-select based on complexity
from app.sora_helper import generate_video_smart
result = await generate_video_smart(prompt, topic, duration=8)
# Returns: {success, video_path, model_used}
Complexity Keywords:
- HIGH (Sora Pro): transformation, morphing, cinematic, epic
- MEDIUM (Sora): tracking, dolly, movement, transition
- LOW (Veo): static, simple, product
Prompt Formula
[CINEMATOGRAPHY] + [SUBJECT] + [ACTION] + [CONTEXT] + [STYLE]
Example:
Slow dolly shot, IoT sensor on greenhouse shelf, LED blinking green,
morning sunlight through glass, professional documentary style
Generation Functions
# Veo (Google)
from app.veo_helper import generate_video_veo3
result = await generate_video_veo3(prompt, aspect_ratio="9:16", duration_seconds=8)
# Sora (OpenAI)
from app.sora_helper import generate_video_sora
result = await generate_video_sora(prompt, model="sora-2", size="720x1280")
# Kling (fal.ai)
from app.fal_helper import FalVideoGenerator
result = await FalVideoGenerator.generate_video(prompt, model="kling_pro", duration=10)
Instagram Specs
| Spec |
Value |
| Aspect |
9:16 vertical |
| Resolution |
720x1280 |
| Codec |
H.264/AAC |
| Max Duration |
90s |
Environment Variables
GEMINI_API_KEY=... # Veo
OPENAI_API_KEY=... # Sora
FAL_API_KEY=... # Kling
Return Format
# Success
{"success": True, "video_path": "/path/to.mp4", "model_used": "veo-3.1"}
# Error with fallback
{"success": False, "error": "...", "fallback": "veo3"}
Best Practices
- Simple, comma-separated sentences
- Include camera movement + lighting
- Avoid complex physics (bouncing, running)
- Use: "cinematic", "professional", "documentary"
- Duration: 5-8s ideal for Reels
Deep Links
app/sora_helper.py - Sora + smart selection
app/veo_helper.py - Veo generation
app/fal_helper.py - Kling/Wan/Minimax
app/video_models.py - Model configs
context/reels-prompts.md - Prompt examples
1---2name: video-generation3description: AI video generation with Sora, Veo, and Kling. Use when creating Reels, video prompts, or handling video generation workflows.4---5
6# AI Video Generation
7
8## Quick Reference
9
10| Model | Provider | Duration | Best For |
11|-------|----------|----------|----------|
12| Veo 3.1 | Google | 4-8s | Simple scenes, products |
13| Sora 2 | OpenAI | 4-12s | Complex scenes |
14| Kling Pro | fal.ai | 5-10s | Industrial, IoT |
15
16## Model Selection
17
18```python
19# Auto-select based on complexity
20from app.sora_helper import generate_video_smart
21
22result = await generate_video_smart(prompt, topic, duration=8)
23# Returns: {success, video_path, model_used}
24```
25
26**Complexity Keywords:**
27- HIGH (Sora Pro): transformation, morphing, cinematic, epic
28- MEDIUM (Sora): tracking, dolly, movement, transition
29- LOW (Veo): static, simple, product
30
31## Prompt Formula
32
33```
34[CINEMATOGRAPHY] + [SUBJECT] + [ACTION] + [CONTEXT] + [STYLE]
35```
36
37**Example:**
38```
39Slow dolly shot, IoT sensor on greenhouse shelf, LED blinking green,
40morning sunlight through glass, professional documentary style
41```
42
43## Generation Functions
44
45```python
46# Veo (Google)
47from app.veo_helper import generate_video_veo3
48result = await generate_video_veo3(prompt, aspect_ratio="9:16", duration_seconds=8)
49
50# Sora (OpenAI)
51from app.sora_helper import generate_video_sora
52result = await generate_video_sora(prompt, model="sora-2", size="720x1280")
53
54# Kling (fal.ai)
55from app.fal_helper import FalVideoGenerator
56result = await FalVideoGenerator.generate_video(prompt, model="kling_pro", duration=10)
57```
58
59## Instagram Specs
60
61| Spec | Value |
62|------|-------|
63| Aspect | 9:16 vertical |
64| Resolution | 720x1280 |
65| Codec | H.264/AAC |
66| Max Duration | 90s |
67
68## Environment Variables
69
70```bash
71GEMINI_API_KEY=... # Veo
72OPENAI_API_KEY=... # Sora
73FAL_API_KEY=... # Kling
74```
75
76## Return Format
77
78```python
79# Success
80{"success": True, "video_path": "/path/to.mp4", "model_used": "veo-3.1"}
81
82# Error with fallback
83{"success": False, "error": "...", "fallback": "veo3"}
84```
85
86## Best Practices
87
88- Simple, comma-separated sentences
89- Include camera movement + lighting
90- Avoid complex physics (bouncing, running)
91- Use: "cinematic", "professional", "documentary"
92- Duration: 5-8s ideal for Reels
93
94## Deep Links
95
96- `app/sora_helper.py` - Sora + smart selection
97- `app/veo_helper.py` - Veo generation
98- `app/fal_helper.py` - Kling/Wan/Minimax
99- `app/video_models.py` - Model configs
100- `context/reels-prompts.md` - Prompt examples