When to Use Programmable Editing
Use the editor when you need to:- Generate personalized videos at scale
- Build automated content pipelines
- Create video variations for A/B testing
- Compose clips from search results
- Add overlays, captions, and effects programmatically
Quick Example
Next Steps
Timeline Architecture
Complete guide to the 4-layer architecture
Clip Parameters
Filters, transitions, and effects
The 4-Layer Architecture
Think of video composition like building with LEGO:Layer 1: Assets
Assets reference your content but don’t define timing or effects.id- The VideoDB media IDstart- Trim point in source (skip first N seconds)volume- Audio level (0.0 to 2.0)
Layer 2: Clips
Clips wrap assets and define how and how long they appear.Fit.crop- Fill canvas, crop edges if neededFit.contain- Fit inside, add bars if neededFit.cover- Stretch to fill (may distort)
- 9-zone grid:
top_left,top,top_right,center_left,center,center_right,bottom_left,bottom,bottom_right
Layer 3: Tracks
Tracks are timeline lanes that control when clips play.Sequencing Rules
Same track = sequential playback:Z-Order
Later tracks render on top of earlier tracks:Layer 4: Timeline
Timeline is your final canvas and export settings."1280x720"- 16:9 landscape (YouTube)"608x1080"- 9:16 vertical (TikTok, Reels)"1080x1080"- 1:1 square (Instagram)
Common Patterns
Highlight Reel from Search Results
Video with Logo Overlay
Timed Captioned Video
What You Can Build
TikTok Lyric Videos
Vertical videos with synced lyrics and AI backgrounds
Faceless Video Creator
Complete AI-generated videos with scripts and voiceovers
Intro & Outro Automation
Add branded intros and outros to all videos automatically
Brand Elements
Overlay logos, watermarks, and lower thirds programmatically
Best Practices
- Think in layers - Background video first, overlays on top
- Use Asset.start for trimming - Skip to the interesting part of source media
- Match clip durations - Overlays should match or exceed video duration
- Test with generate_stream() - Preview before expensive exports
- Reuse assets - One VideoAsset can be used in multiple clips