AI Video Generation
Quick Reference
| Model |
Provider |
Duration |
Best For |
| sora-2 |
OpenAI |
4/8/12s |
Yüksek kalite, gerçekçi |
| sora-2-pro |
OpenAI |
4/8/12s |
Native speech, conversational only |
| kling-3.0-pro |
fal.ai |
5/10/15s |
Sinematik, fizik tabanlı, native audio |
Model Selection (Brain Agent)
Brain Agent otomatik model secimi yapar. Manuel secim icin:
from app.video_models import get_model_config, get_available_models, validate_duration
models = get_available_models() # ["sora-2", "sora-2-pro", "kling-3.0-pro"]
config = get_model_config("kling-3.0-pro")
duration = validate_duration("kling-3.0-pro", 15) # -> 15
# Model secim rehberi:
# Haber bazlı acil icerik → kling-3.0-pro (hızlı, 2-3 dk)
# Sinematik showcase → sora-2
# Sesli anlatım → sora-2-pro
# Conversational diyalog → sora-2-pro
# Teknik demo → kling-3.0-pro
Video Style System
from app.video_styles import VIDEO_STYLES, get_style_config
# 10 görsel stil:
# cinematic_4k, anime, cartoon_3d, watercolor, 3d_render,
# pixel_art, comic_book, claymation, minimalist, neon_cyberpunk
style = get_style_config("cinematic_4k")
# -> character descriptions, scene settings, voice type mappings
Generation Functions
# Sora (OpenAI)
from app.sora_helper import generate_video_sora
result = await generate_video_sora(prompt, model="sora-2", size="720x1280", duration=12)
# Kling (via fal.ai)
from app.kling_helper import KlingHelper
kling = KlingHelper()
result = await kling.generate_video(
prompt=prompt,
duration=10, # 5/10/15s
aspect_ratio="9:16",
generate_audio=True # Native audio (fal.ai default)
)
Kling via fal.ai Details
- Endpoint:
fal-ai/kling-video/v3/pro/text-to-video
- Auth:
FAL_API_KEY (shared with nano-banana and lip-sync)
- Model: Kling 3.0 Pro
- Durations: 5s, 10s, 15s
- Features: Native audio, physics-based motion, cinematic quality
- Pay-as-you-go pricing via fal.ai queue API
Instagram Specs
| Spec |
Value |
| Aspect |
9:16 vertical |
| Resolution |
720x1280 |
| Codec |
H.264/AAC |
| Max Duration |
90s |
Environment Variables
OPENAI_API_KEY=... # Sora
FAL_API_KEY=... # Kling video, infographics, lip-sync
Return Format
# Success
{"success": True, "video_path": "/path/to.mp4", "model_used": "kling-3.0-pro"}
# Error with fallback
{"success": False, "error": "...", "fallback": "sora"}
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
- Kling 3.0 Pro en hizli (2-3 dk), 15s destegi
Production Pipelines
| Pipeline |
Dosya |
Default Model |
| reels |
app/production/reels_pipeline.py |
kling-3.0-pro |
| voice_reels |
app/production/voice_reels_pipeline.py |
sora-2-pro |
| news_reels |
app/production/news_reels_pipeline.py |
kling-3.0-pro |
| long_video |
app/production/long_video_pipeline.py |
kling-3.0-pro |
| conversational |
app/production/conversational_pipeline.py |
sora-2-pro |
Deep Links
app/video_models.py - Model configs (3 model)
app/video_styles.py - 10 görsel stil
app/sora_helper.py - Sora + smart selection
app/kling_helper.py - Kling via fal.ai
context/reels-prompts.md - Prompt examples