Skip to content
videodb
VideoDB Documentation
  • Pages
    • Welcome to VideoDB Docs
    • Quick Start Guide
      • Video Indexing Guide
      • Semantic Search
      • How Accurate is Your Search?
      • Collections
      • Public Collections
      • Callback Details
      • Ref: Subtitle Styles
      • Language Support
      • Guide: Subtitles
    • Examples and Tutorials
      • Dubbing - Replace Soundtrack with New Audio
      • VideoDB x TwelveLabs: Real-Time Video Understanding
      • 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
      • Eleven Labs x VideoDB: Adding AI Generated voiceovers to silent footage
      • 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: Wellsaid, Open AI & VideoDB
      • Fun with Keyword Search
      • AWS Rekognition and VideoDB - Effortlessly Remove Inappropriate Content from Video
      • Overlay a Word-Counter on Video Stream
      • Generate Automated Video Outputs with Text Prompts | DALL-E + ElevenLabs + OpenAI + VideoDB
    • 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 Video Scene Indexing
    • Multimodal Search
      • Multimodal Search: Quickstart
      • Conference Slide Scraper with VideoDB
    • icon picker
      Real‑Time Video Pipeline
      • Automated Traffic Violation Reporter
    • Meeting Recording SDK
    • Generative Media Quickstart
      • Generative Media Pricing
    • AI Video Editing Automation SDK
      • Fit & Position: Aspect Ratio Control
      • 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
      • How I Built a CRM-integrated Sales Assistant Agent in 1 Hour
      • Make Your Video Sound Studio Quality with Voice Cloning
      • Setup Director Locally
    • github
      Open Source Tools
      • llama
        LlamaIndex VideoDB Retriever
      • PromptClip: Use Power of LLM to Create Clips
      • StreamRAG: Connect ChatGPT to VideoDB
    • 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
    • mcp
      VideoDB MCP Server
    • Edge of Knowledge
      • Building Intelligent Machines
        • Part 1 - Define Intelligence
        • Part 2 - Observe and Respond
        • Part 3 - Training a Model
      • Society of Machines
        • Society of Machines
        • Autonomy - Do we have the choice?
        • Emergence - An Intelligence of the collective
      • From Language Models to World Models: The Next Frontier in AI
      • The Future Series
      • How VideoDB Solves Complex Visual Analysis Tasks
    • videodb
      Building World's First Video Database
      • Multimedia: 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
      • Misalignment of Today's Web
      • Beyond Traditional Video Infrastructure
      • Research Grants
    • Customer Love
    • Team
      • 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
      • VideoDB Acquires Devzery: Expanding Our AI Infra Stack with Developer-First Testing Automation

Real‑Time Video Pipeline

Quick‑Start

Converting live video into actionable insights takes just four simple steps. The interface is designed so users can easily specify prompts tailored to their industry, clearly defining the information and events to capture from video feeds. See the following code snippet to get started.
# 1- Connect: ingest variety of real time streams from cameras, live feeds, meetings etc.
rtstream = coll.connect_rtstream(name="Mumbai CCTV", rtsp_url=RTSP_URL)
# 2- Index: convert real time videos into information using just prompt
sc_index = rtstream.index_scenes(
prompt="Describe the pedestrian Crossing Camera installed in Mumbai.", name="traffic_monitor")

# 3- Describe Events: Create event with just a prompt
event_id = conn.create_event(event_prompt="Detect pedestrians", label="human_detection")

# 4- Action: connect event to index and receive call on webhooks when the event is detected
double_decker_bus_alert_id = sc_index.create_alert(event_id, callback_url="https://your.callback.for/receiving_alerts")
All video feeds are securely stored in VideoDB and can be accessed anytime.
Indexing charges remain consistent, whether you're processing video files or live feeds.
All prompts are processed using Pro-tier LLMs for optimal quality.

empty-flag

Explore these demos to see what's possible:



Detailed Guide

This guide expands the earlier quick start examples with a deeper look at the RTStream, RTStreamSceneIndex, and Event APIs.
It also summarises how you can tune scene extraction and frame sampling so that your real‑time pipelines stay both cost‑efficient and semantically rich.

1. Connecting a live stream

# assume you already have `conn = videodb.connect(api_key="...")`
coll = conn.get_collection()

rtstream = coll.connect_rtstream(
name="Mumbai CCTV",
rtsp_url="rtsp://user:pass@1.1.1.1:554/mystream"
)
The returned RTStream object represents the persistent ingest pipeline from your camera or encoder.
Core attributes
attribute
type
description
id
Unique identifier for the live stream
name
Friendly label you supplied at creation
collection_id
The parent collection (useful for multi‑tenant setups)
sample_rate
Defaults to 1 fps, for higher sampling rates please connect at
status
connected, stopped, etc.
There are no rows in this table
Key RTStream methods
method
purpose
start() / stop()
Toggle ingest on the server side
generate_stream(start, end)
Get an HLS/MP4 URL for an arbitrary clip window (in seconds)
index_scenes(...)
Launch on‑the‑fly visual indexing
list_scene_indexes() / get_scene_index(id)
Inspect existing scene indices linked to this stream.
There are no rows in this table

2. Indexing scenes in real time

Currently, real-time indexing supports only time-based scene extraction. Since indexing parameters significantly influence output quality, it's recommended to experiment and identify the optimal configuration before locking your pipeline for production use. Refer to the example notebooks for domain-specific configurations using extraction_config.
Note: By default, streams are ingested at 1 frame per second (fps). Ensure your time and frame_count parameters align accordingly.
scene_index = rtstream.index_scenes(
extraction_type=SceneExtractionType.time_based,
extraction_config={"time": 2, "frame_count": 1},
prompt="Describe the scene and highlight congestion",
name="traffic_monitor"
)
Full parameter reference
parameter
default
description
extraction_type
SceneExtractionType.time_based
Selects the segmentation algorithm — time‑based ( only supported for now )
extraction_config
{"time":2, "frame_count":5}
Algorithm‑specific knobs (see below)
prompt
"Describe the scene"
Text sent to the vision‑LLM for every scene
name
None
Label for this index; handy when you maintain multiple indices
There are no rows in this table
Frame‑sampling knobs
extraction_type
key
meaning
time_based
time
Seconds per scene chunk (e.g. 10 s)
frame_count
fixed number of frames per chunk
select_frames
Pick specific positions: ["first","middle","last"]
There are no rows in this table

3. Working with RTStreamSceneIndex

The object returned by index_scenes() exposes real‑time analytics utilities.
Useful Methods
method
what it does
get_scenes(start=None, end=None, page=1, page_size=100)
Paginate through raw scene records (timestamp & description)
start() / stop()
Enable/disable the index without deleting it
create_alert(event_id, callback_url)
Subscribe an alert to a pre‑defined Event
list_alerts()
Enumerate alert subscriptions
enable_alert(alert_id) / disable_alert(alert_id)
Toggle alert delivery
There are no rows in this table

4. Defining reusable Events

conn.create_event() registers a server‑side rule that can be reused across multiple streams or indices.
event_id = conn.create_event(
event_prompt="Detect pedestrians crossing the zebra",
label="human_detection"
)
Event fields
field
required
notes
event_prompt
✔︎
Natural‑language condition evaluated by the vision model
label
✔︎
Slug used in alert payloads & dashboards
There are no rows in this table

5. End‑to‑end sample

ingests frames → index per‑scene description → evaluates pedestrian rule → fires a webhook in <1 s.
rtstream = coll.connect_rtstream("Mumbai CCTV", rtsp_url=RTSP_URL)

scene_idx = rtstream.index_scenes(prompt="Summarise traffic")

# Generic pedestrian detector, reused in multiple places
ped_event = conn.create_event("Detect pedestrians", label="pedestrian")

alert_id = scene_idx.create_alert(ped_event, callback_url="https://api.example.com/webhooks/ped")



6 Demos & Notebooks

Explore these demos to see what's possible:
For more detailed, domain-specific recipes, clone or execute our published Colab notebooks. Select a use case below to get started:


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