Skip to content
videodb
VideoDB Documentation
  • Pages
    • Welcome to VideoDB Docs
    • Quick Start Guide
      • Video Indexing Guide
      • Semantic Search
      • Collections
      • Public Collections
      • Callback Details
      • Ref: Subtitle Styles
      • Language Support
      • Guide: Subtitles
      • How Accurate is Your Search?
    • Visual Search and Indexing
      • Scene Extraction Algorithms
      • Custom Annotations
      • Scene-Level Metadata: Smarter Video Search & Retrieval
      • Advanced Visual Search Pipelines
      • Playground for Scene Extractions
      • Deep Dive into Prompt Engineering : Mastering Visual Indexing
      • How VideoDB Solves Complex Visual Analysis Tasks
      • Multimodal Search: Quickstart
      • Conference Slide Scraper with VideoDB
    • Examples and Tutorials
      • Dubbing - Replace Soundtrack with New Audio
      • VideoDB: Adding AI Generated voiceovers to silent footage
      • Beep curse words in real-time
      • Remove Unwanted Content from videos
      • Instant Clips of Your Favorite Characters
      • Insert Dynamic Ads in real-time
      • Adding Brand Elements with VideoDB
      • Elevating Trailers with Automated Narration
      • Add Intro/Outro to Videos
      • Audio overlay + Video + Timeline
      • Building Dynamic Video Streams with VideoDB: Integrating Custom Data and APIs
      • AI Generated Ad Films for Product Videography
      • Fun with Keyword Search
      • Overlay a Word-Counter on Video Stream
      • Generate Automated Video Outputs with Text Prompts | VideoDB
      • VideoDB x TwelveLabs: Real-Time Video Understanding
      • Multimodal Search
      • How I Built a CRM-integrated Sales Assistant Agent in 1 Hour
      • Make Your Video Sound Studio Quality with Voice Cloning
      • Automated Traffic Violation Reporter
    • Live Video→ Instant Action
    • Generative Media Quickstart
      • Generative Media Pricing
    • Video Editing Automation
      • Fit & Position: Aspect Ratio Control
      • icon picker
        Trimming vs Timing: Two Independent Timelines
      • Advanced Clip Control: The Composition Layer
      • Caption & Subtitles: Auto-Generated Speech Synchronization
      • Notebooks
    • Transcoding Quickstart
    • director-light
      Director - Video Agent Framework
      • Agent Creation Playbook
      • Setup Director Locally
    • Workflows and Integrations
      • zapier
        Zapier Integration
        • Auto-Dub Videos & Save to Google Drive
        • Create & Add Intelligent Video Highlights to Notion
        • Create GenAI Video Engine - Notion Ideas to Youtube
        • Automatically Detect Profanity in Videos with AI - Update on Slack
        • Generate and Store YouTube Video Summaries in Notion
        • Automate Subtitle Generation for Video Libraries
        • Solve customers queries with Video Answers
      • n8n
        N8N Workflows
        • AI-Powered Meeting Intelligence: Recording to Insights Automation
        • AI Powered Dubbing Workflow for Video Content
        • Automate Subtitle Generation for Video Libraries
        • Automate Interview Evaluations with AI
        • Turn Meeting Recordings into Actionable Summaries
        • Auto-Sync Sales Calls to HubSpot CRM with AI
        • Instant Notion Summaries for Your Youtube Playlist
    • Meeting Recording SDK
    • github
      Open Source
      • llama
        LlamaIndex VideoDB Retriever
      • PromptClip: Use Power of LLM to Create Clips
      • StreamRAG: Connect ChatGPT to VideoDB
    • mcp
      VideoDB MCP Server
    • videodb
      Give your AI, Eyes and Ears
      • Building Infrastructure that “Sees” and “Edits”
      • Agents with Video Experience
      • From MP3/MP4 to the Future with VideoDB
      • Dynamic Video Streams
      • Why do we need a Video Database Now?
      • What's a Video Database ?
      • Enhancing AI-Driven Multimedia Applications
      • Beyond Traditional Video Infrastructure
    • Customer Love
    • Join us
      • videodb
        Internship: Build the Future of AI-Powered Video Infrastructure
      • Ashutosh Trivedi
        • Playlists
        • Talks - Solving Logical Puzzles with Natural Language Processing - PyCon India 2015
      • Ashish
      • Shivani Desai
      • Gaurav Tyagi
      • Rohit Garg
      • Edge of Knowledge
        • Language Models to World Models: The Next Frontier in AI
        • Society of Machines
          • Society of Machines
          • Autonomy - Do we have the choice?
          • Emergence - An Intelligence of the collective
        • Building Intelligent Machines
          • Part 1 - Define Intelligence
          • Part 2 - Observe and Respond
          • Part 3 - Training a Model
      • Updates
        • VideoDB Acquires Devzery: Expanding Our AI Infra Stack with Developer-First Testing Automation

Trimming vs Timing: Two Independent Timelines

VideoDB Editor uses two separate “start” parameters that control different aspects of video composition. This trips up almost everyone at first - you set start=10 and expect the video to play 10 seconds into your timeline, but it actually just skips the first 10 seconds of the source video. Understanding these two parameters is key to controlling both what plays and when it plays.

The Two Start Parameters

Asset.start - Source Trimming

VideoAsset(start=…) skips the beginning of the source file.
asset = VideoAsset(
id=video.id,
start=10 # Skip first 10 seconds of source video
)
This controls which part of your source material gets used. Think of it like fast-forwarding to a specific timestamp before hitting play - you’re extracting a segment from your original video.

track.add_clip(start=…) - Timeline Positioning

Positions when the clip appears in the final timeline.
track.add_clip(
start=5, # Place clip at 5-second mark in final video
clip=clip
)
This controls when your clip plays in the composed output - like dragging a clip to a specific position on an editing timeline. It’s completely independent of what part of the source is playing.

Key Concept: Independent Control

These parameters are completely independent, operating in two different coordinate systems.
Asset.start works in “source video time” (which part of the original file), while track.add_clip(start=…) works in “output timeline time” (when it appears in the final video).
You can extract any segment from your source and place it anywhere on your timeline.
# Extract seconds 10-20 from source, place at 5-second mark in timeline
clip = Clip(
asset=VideoAsset(id=video.id, start=10), # TRIMMING: skip first 10s
duration=10 # Play for 10 seconds
)

track = Track()
track.add_clip(start=5, clip=clip) # TIMING: appears at 5s in final
Timeline structure:
0-5 seconds: Blank (background color)
5-15 seconds: Video plays (showing seconds 10-20 from source)

Asset Parameters

VideoAsset

Parameter
Type
Description
id
str
Video ID from VideoDB collection
start
int
Timestamp (seconds) where playback begins in source file. Default: 0
volume
float
Audio volume multiplier. 1.0 = original, 0.0 = mute, 2.0 = double
crop
Crop
Crop edges of source video
There are no rows in this table

AudioAsset

Parameter
Type
Description
id
str
Audio ID from VideoDB collection
start
int
Timestamp (seconds) where playback begins in source file
volume
float
Audio volume multiplier (0.0 - 2.0)
There are no rows in this table

Common Patterns

Sequential Clips (No Gaps)

# Clips play one after another
track.add_clip(0, clip1) # 0-10s
track.add_clip(10, clip2) # 10-20s
track.add_clip(20, clip3) # 20-30s

Clips with Gaps

# Intentional pauses between clips
track.add_clip(0, clip1) # 0-10s
track.add_clip(15, clip2) # 15-25s (5s gap)
track.add_clip(35, clip3) # 35-45s (10s gap)

Overlapping Clips (Different Tracks)

main_track = Track()
main_track.add_clip(0, main_clip)

# Overlay appears at specific time
overlay_track = Track()
overlay_track.add_clip(20, overlay_clip) # Appears at 20s

timeline.add_track(main_track)
timeline.add_track(overlay_track)

Complete Example

from videodb.editor import Timeline, Track, Clip, VideoAsset

timeline = Timeline(conn)

# Extract 15 seconds starting at 30s from source
clip1 = Clip(
asset=VideoAsset(
id=video.id,
start=30 # Skip first 30s of source
),
duration=15 # Play for 15 seconds (shows 30s-45s of source)
)

track = Track()
track.add_clip(start=10, clip=clip1) # Place at 10s in final timeline

timeline.add_track(track)
stream_url = timeline.generate_stream()
Result: Final video has blank 0-10s, then shows seconds 30-45 from source at 10-25s position.

Next Step:

For hands-on practice with trimming and timing patterns, see:

 
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.