Skip to main content

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.
Key parameters:
  • id - The VideoDB media ID
  • start - 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 modes:
  • Fit.crop - Fill canvas, crop edges if needed
  • Fit.contain - Fit inside, add bars if needed
  • Fit.cover - Stretch to fill (may distort)
Position options:
  • 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:
Different tracks = simultaneous playback (layered):

Z-Order

Later tracks render on top of earlier tracks:

Layer 4: Timeline

Timeline is your final canvas and export settings.
Common resolutions:
  • "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

Auto-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

  1. Think in layers - Background video first, overlays on top
  2. Use Asset.start for trimming - Skip to the interesting part of source media
  3. Match clip durations - Overlays should match or exceed video duration
  4. Test with generate_stream() - Preview before expensive exports
  5. Reuse assets - One VideoAsset can be used in multiple clips