🚀 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.
✅ 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
├── 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/
git clone https://github.com/sachinarora/video_analysis_project.git
cd video_analysis_project
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts�ctivate
pip install -r requirements.txt
- 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',
}
}
python manage.py makemigrations
python manage.py migrate
redis-server
celery -A config worker --loglevel=info
daphne -b 0.0.0.0 -p 8000 config.asgi:application
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 |
- Open
http://127.0.0.1:8000/
- Click Upload Video → Select a
.mp4
file - Processing starts & progress is updated in real-time
- WebSockets update UI dynamically
- Shows current processing step: "Extracting Audio", "Running OCR" etc.
- Enter an OpenAI API Key
- Use chat box to ask "What objects are in this video?", etc.
- AI responds using transcript, OCR, & detected objects
- Once processing is complete, download:
- Transcript (
media/transcripts/
) - Analysis Report (
media/analysis/
)
- Transcript (
📧 Email: sachnaror@gmail.com 🌍 GitHub: github.com/sachnaror 🌐 Website: https://about.me/sachin-arora
🚀 Happy Coding! 🎬💡
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 &
brew services restart redis
python manage.py makemigrations python manage.py migrate
celery -A config worker --loglevel=info
daphne -b 0.0.0.0 -p 8000 config.asgi:application
