Skip to content

AI-powered Video Analysis & Chatbot πŸŽ₯πŸ€–! Upload a video, let AI process frames, speech, text, and objects using YOLO, Whisper, NLP, then chat with OpenAI for insights! Real-time WebSocket updates, Celery tasks & PostgreSQL storage. Built with Django & Bootstrap!

Notifications You must be signed in to change notification settings

sachnaror/video_analysis_project

Repository files navigation

πŸŽ₯ AI-Powered Video Analysis System

πŸš€ AI-based Video Processing & Analysis System with Django, Celery, WebSockets, OpenAI GPT-4, Whisper, OCR, and YOLOv8 for video transcript generation, object detection, speech-to-text, and AI-powered chat.

πŸ“Œ Features

βœ… Upload & Process Videos – Extract audio, text, and objects

βœ… Real-time Progress Updates – WebSockets for instant feedback

βœ… AI Chat – Ask questions about the processed video

βœ… Multi-user API Key Support – Users enter their own OpenAI API key

βœ… Database Storage – Save transcripts & analysis reports

βœ… WebSocket-powered Chat – Realtime AI Q&A

βœ… Download Reports – Transcripts & analysis reports available


πŸ—οΈ Directory Structure

β”œβ”€β”€ video_analysis_project/
β”‚   β”œβ”€β”€ dump.rdb
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ yolov8n.pt
β”‚   β”œβ”€β”€ db.sqlite3
β”‚   β”œβ”€β”€ README.md
β”‚   β”œβ”€β”€ database.env
β”‚   β”œβ”€β”€ docker-compose.yml
β”‚   β”œβ”€β”€ manage.py
β”‚   β”œβ”€β”€ celery_tasks.py
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ video_processing.py
β”‚   β”‚   β”œβ”€β”€ tasks.py
β”‚   β”‚   β”œβ”€β”€ models.py
β”‚   β”‚   β”œβ”€β”€ database.py
β”‚   β”‚   β”œβ”€β”€ chat_processor.py
β”‚   β”‚   β”œβ”€β”€ consumers.py
β”‚   β”‚   β”œβ”€β”€ apps.py
β”‚   β”‚   β”œβ”€β”€ admin.py
β”‚   β”‚   β”œβ”€β”€ routing.py
β”‚   β”‚   β”œβ”€β”€ tests.py
β”‚   β”‚   β”œβ”€β”€ urls.py
β”‚   β”‚   └── views.py
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ asgi.py
β”‚   β”‚   β”œβ”€β”€ celery.py
β”‚   β”‚   β”œβ”€β”€ settings.py
β”‚   β”‚   └── urls.py
β”‚   └── Dockerfile/
β”‚   β”œβ”€β”€ staticfiles/
β”‚   β”‚   β”œβ”€β”€ styles.css
β”‚   β”‚   └── script.js
β”‚   β”‚   β”œβ”€β”€ admin/
β”‚   β”‚   β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”‚   β”œβ”€β”€ js/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ admin/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ vendor/
β”‚   β”‚   β”‚   β”œβ”€β”€ img/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ gis/
β”‚   β”‚   β”œβ”€β”€ rest_framework/
β”‚   β”‚   β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”‚   β”œβ”€β”€ js/
β”‚   β”‚   β”‚   β”œβ”€β”€ docs/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ js/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ img/

β”‚   β”‚   β”‚   β”œβ”€β”€ img/
β”‚   β”‚   β”‚   β”œβ”€β”€ fonts/
β”‚   β”œβ”€β”€ static/
β”‚   β”‚   β”œβ”€β”€ styles.css
β”‚   β”‚   └── script.js
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   └── reports.html
β”‚   β”œβ”€β”€ media/
β”‚   β”‚   └── progress.json
β”‚   β”‚   β”œβ”€β”€ transcripts/
β”‚   β”‚   β”‚   β”œβ”€β”€ Screen Recording 2025-02-08 at 9.49.34PM.mov_transcript.txt
β”‚   β”‚   β”‚   └── Screen Recording 2025-02-13 at 2.04.42AM.mov_transcript.txt
β”‚   β”‚   β”œβ”€β”€ analysis/
β”‚   β”‚   β”‚   β”œβ”€β”€ Screen Recording 2025-02-13 at 2.04.42AM.mov_analysis.txt
β”‚   β”‚   β”‚   └── Screen Recording 2025-02-08 at 9.49.34PM.mov_analysis.txt
β”‚   β”‚   └── frames/
β”‚   β”‚   β”œβ”€β”€ uploads/
β”‚   β”‚   β”‚   β”œβ”€β”€ Screen Recording 2025-02-08 at 9.49.34PM.mov
β”‚   β”‚   β”‚   └── Screen Recording 2025-02-13 at 2.04.42AM.mov
β”‚   β”‚   └── chunks/
β”‚   β”‚   └── audio/


πŸ› οΈ Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/sachinarora/video_analysis_project.git
cd video_analysis_project

2️⃣ Setup Virtual Environment

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\ScriptsοΏ½ctivate

3️⃣ Install Dependencies

pip install -r requirements.txt

4️⃣ Setup PostgreSQL Database

  • DB Name: postgres
  • User: postgres
  • Password: password

Update DATABASES in config/settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'postgres',
        'USER': 'postgres',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

5️⃣ Apply Migrations

python manage.py makemigrations
python manage.py migrate

6️⃣ Start Redis Server (For Celery)

redis-server

7️⃣ Start Celery Worker

celery -A config worker --loglevel=info

8️⃣ Run Django ASGI Server (For WebSockets)

daphne -b 0.0.0.0 -p 8000 config.asgi:application

πŸ“– API Endpoints

Method Endpoint Description
POST /upload_video/ Upload & process a new video
GET /progress/ Get real-time processing progress
POST /chat/ Ask AI questions about the video
GET /reports/ View past analysis reports

πŸ”§ Usage

1️⃣ Upload & Process a Video

  1. Open http://127.0.0.1:8000/
  2. Click Upload Video β†’ Select a .mp4 file
  3. Processing starts & progress is updated in real-time

2️⃣ View Live Progress

  • WebSockets update UI dynamically
  • Shows current processing step: "Extracting Audio", "Running OCR" etc.

3️⃣ Ask AI Questions

  • Enter an OpenAI API Key
  • Use chat box to ask "What objects are in this video?", etc.
  • AI responds using transcript, OCR, & detected objects

4️⃣ Download Report

  • Once processing is complete, download:
    • Transcript (media/transcripts/)
    • Analysis Report (media/analysis/)

πŸ“ž Contact & Support

πŸ“§ Email: sachnaror@gmail.com 🌍 GitHub: github.com/sachnaror 🌐 Website: https://about.me/sachin-arora

πŸš€ Happy Coding! πŸŽ¬πŸ’‘

Commands:

First, stop existing processes, run:

pkill -f runserver
pkill -f redis
pkill -f celery

### and then..

redis-server &
python manage.py runserver &
celery -A config worker --loglevel=info &

1️⃣ Restart Redis

brew services restart redis

2️⃣ Apply migrations

python manage.py makemigrations python manage.py migrate

3️⃣ Start Celery Worker

celery -A config worker --loglevel=info

4️⃣ Restart Django ASGI Server

daphne -b 0.0.0.0 -p 8000 config.asgi:application

image

About

AI-powered Video Analysis & Chatbot πŸŽ₯πŸ€–! Upload a video, let AI process frames, speech, text, and objects using YOLO, Whisper, NLP, then chat with OpenAI for insights! Real-time WebSocket updates, Celery tasks & PostgreSQL storage. Built with Django & Bootstrap!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published