Skip to content

Druvith/Video-query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Video Query

A local-first application for semantic video search and discovery. Index videos via YouTube URL or local upload and perform natural language queries to find, play, and download specific moments.

Demo

Video Query Demo

Features

  • Semantic Search: Query video content using natural language (e.g., "Where is the battery replaced?").
  • Local Vector Storage: Uses ChromaDB for local indexing and storage.
  • Hardware Acceleration: Optimized with hardware-accelerated transcoding (h264_videotoolbox) for near-instant clipping.
  • Progress Tracking: Real-time feedback during the multi-stage indexing process.
  • Segment Downloads: Export any discovered video segment directly to your disk.
  • Project-Based Library: Each ingestion creates its own project index so previously indexed videos are preserved.

How It Works

  1. Ingest a video from YouTube (/process) or local upload (/upload).
  2. Backend creates a new project_id and analyzes the video into semantic segments.
  3. Segment descriptions are embedded and indexed in a project-scoped ChromaDB collection.
  4. Queries (/query) search only within the selected project using semantic similarity.
  5. Matching time ranges can be clipped and downloaded via /clip.

Prerequisites

  • Python 3.10+
  • FFmpeg
  • uv (Recommended for dependency management)
  • Node.js & npm
  • Google AI API Key (Set in backend/.env as GOOGLE_API_KEY)

Installation & Usage

The project includes a Makefile for simplified orchestration.

1. Initial Setup

This will configure the Python environment and install frontend dependencies.

make setup

2. Set API Key

Create a .env file in the backend/ directory:

echo "GOOGLE_API_KEY=your_key_here" > backend/.env

3. Run Application

Launches both the Backend and Frontend in a single terminal.

make dev

Press Ctrl+C to stop both servers.

API Reference

  • POST /process: Index a YouTube video via URL.
  • POST /upload: Index a local video file.
  • POST /query: Search within a project index (requires project_id and query).
  • POST /clip: Generate a segment from a project video (requires project_id, start_time, end_time).
  • GET /projects: List indexed projects.
  • GET /projects/{project_id}: Get project metadata.
  • DELETE /projects/{project_id}: Delete a project and its indexed data.

Tech Stack

  • AI: Gemini (Analysis), sentence-transformers (Local Embeddings).
  • Database: ChromaDB.
  • Media: FFmpeg, yt-dlp.
  • Frontend: React, Tailwind CSS.
  • Backend: Flask.

License

MIT

About

Local video-indexing system

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published