When to Use This Reference
Use this page when you need to:- Understand what each SDK class represents
- Know which object to use for your use case
- Map between the SDK, API, and documentation
Quick Example
Core Objects
Connection
The entry point to VideoDB. Holds your API key and provides access to collections, events, and WebSocket connections.get_collection()- Get default or specific collectioncreate_event()- Create reusable detection rulesconnect_websocket()- Establish real-time connection
Collection
A container for organizing media assets. Every video and stream belongs to a collection.upload(url=...)- Upload video from URLupload(file_path=...)- Upload local fileconnect_rtstream(...)- Connect live streamsearch(...)- Search across all assets in collectionlist_videos()- List video assetslist_rtstreams()- List live streams
Video
A file-based media asset. Represents uploaded videos that can be indexed, searched, and edited.id- Unique identifier (v-xxx)name- Display namelength- Duration in secondsstream_url- Playback URL
index_scenes(prompt=...)- Create visual indexindex_spoken_words()- Create transcript indexsearch(query, index_id=...)- Search this videogenerate_stream(...)- Get playback URL for time rangeplay()- Open in browser
RTStream
A real-time media stream. Represents live video from RTSP feeds, cameras, or desktop capture.id- Unique identifier (rts-xxx)name- Display namestatus- connected, stopped, etc.
index_visuals(prompt=...)- Create visual indexindex_audio(prompt=...)- Create audio indexstart_transcript()- Begin transcriptionsearch(query, index_id=...)- Search this streamgenerate_stream(start, end)- Get playback URL
CaptureSession
Desktop capture for AI agents. Stream screen, mic, and system audio from any desktop with real-time AI events.id- Unique identifier (cap-xxx)status- pending, active, completed, stoppedend_user_id- Your user identifier
- Two-component architecture - Backend holds API key, desktop client uses tokens
- Creates RTStreams - Each active channel (mic, screen, audio) creates an RTStream
- Real-time events - Transcripts, visual indexes, and alerts delivered via webhook/WebSocket
- Microphone - User’s voice
- Screen/Display - Visual content
- System Audio - Audio from apps
- Camera - Webcam feed
Index (SceneIndex)
A programmable interpretation layer that produces timestamped scene records. The key abstraction for turning raw media into searchable knowledge.- Indexes are prompt-driven - you define what to extract
- Indexes are additive - create multiple indexes on the same media
- Indexes are non-destructive - add or remove without affecting source
- Indexes support visual and spoken modalities
get_scenes()- Retrieve indexed scenescreate_alert(event_id, ...)- Attach alert triggerstart()/stop()- Control indexing
SearchResult
The result of a search query. Contains shots (moments) with timestamps and playable evidence.shots- List of matching momentscollection_id- Source collection
Shot
A single moment from search results. Contains timestamps, text, and playable stream URL. Key attributes:start- Start timestamp (seconds or Unix time)end- End timestamptext- Content/description at this momentsearch_score- Relevance score (0-1)stream_url- Direct playback URL
generate_stream()- Get playback URLplay()- Open in browser
Event
A reusable detection rule defined in plain English. Events describe what to detect; alerts define where and how to deliver.Alert
Wires an event to an index and defines delivery. When the event condition is detected, the alert fires.callback_url- Webhook for automationws_connection_id- WebSocket for real-time
Editor Module (Programmable Editing)
The action layer for programmable video editing lives invideodb.editor. It uses a 4-layer architecture:
Asset → Clip → Track → Timeline
VideoAsset- Video contentAudioAsset- Music, voiceover, sound effectsImageAsset- Logos, watermarks, backgroundsTextAsset- Custom text overlaysCaptionAsset- Auto-generated subtitles
- Clips on the same track play sequentially
- Clips on different tracks play simultaneously (layered)
- Later tracks render on top of earlier tracks