Skip to main content

AI-powered video lecture transcription, analysis, and subtitle generation

Project description

๐ŸŽฌ AI Video Lecture Assistant

Automatically transcribe, analyze, and add subtitles to educational videos using AI

Transform your video lectures into searchable transcripts, insightful summaries, study quizzes, and videos with professional subtitles - all running 100% locally with no API costs!

Created by Aditya Takawale


โœจ Features

  • ๐ŸŽค Accurate Transcription - Powered by OpenAI Whisper (supports 99+ languages)
  • ๐Ÿค– AI Analysis - Generate summaries, key insights, and quiz questions using Ollama
  • ๏ฟฝ Embedded Subtitles - Creates video files with toggleable subtitle tracks
  • ๐Ÿ“„ Word Documents - Professional analysis reports in .docx format
  • ๐Ÿ”’ 100% Local & Private - No cloud APIs, no data leaves your computer
  • ๐Ÿ’ฐ Zero Cost - Completely free to use, no API keys required

๐Ÿš€ Quick Start

Prerequisites

  1. Python 3.9+ installed
  2. Ollama installed and running (Download here)
  3. FFmpeg installed (usually auto-handled)

Installation

# 1. Clone/download this repository
cd c:\Developer\ai-summary

# 2. Create virtual environment
python -m venv .venv

# 3. Activate virtual environment
.venv\Scripts\activate

# 4. Install dependencies
pip install -r requirements.txt

# 5. Start Ollama (in a separate terminal)
ollama serve

# 6. Pull the AI model
ollama pull llama3.1

โšก Easy Usage - Simple Script

Simplest method - Just drag and drop:

process_video.bat "my_lecture.mp4"

Or drag-and-drop your video file onto process_video.bat!

Advanced Usage

# Full processing with all options
python embed_subtitles.py video.mp4 --keep-srt

# Use better Whisper model for higher accuracy
python embed_subtitles.py video.mp4 -m small

# Custom output directory
python embed_subtitles.py video.mp4 -o my_outputs

# Use different AI model
python embed_subtitles.py video.mp4 --ollama-model llama3.2

๐Ÿ“ Output Files

After processing my_lecture.mp4, you'll get:

outputs/
โ”œโ”€โ”€ my_lecture_with_subtitles.mp4  โ† Video with embedded subtitle track
โ”œโ”€โ”€ my_lecture_subtitles.srt       โ† Standalone subtitle file
โ”œโ”€โ”€ my_lecture_analysis.docx       โ† Word document with analysis
โ””โ”€โ”€ my_lecture_analysis.json       โ† JSON data

How to Use the Video with Subtitles

  1. Open my_lecture_with_subtitles.mp4 in VLC, Windows Media Player, or any video player
  2. Look for the "Subtitles" or "CC" button in player controls
  3. Toggle subtitles ON/OFF as needed!

๐Ÿ“ฆ Distribution Options

Option 1: Share Source Code (Recommended for Developers)

# 1. Share the entire folder
# 2. Recipients install Python + Ollama
# 3. Recipients run: pip install -r requirements.txt
# 4. Ready to use!

Option 2: Standalone Executable (For End Users)

# Install PyInstaller
pip install pyinstaller

# Create executable
pyinstaller --onefile --name="AI-Video-Processor" embed_subtitles.py

# Distribute: dist/AI-Video-Processor.exe + include instructions to install Ollama

Note: Users will still need Ollama installed (AI models are too large to bundle ~4GB+).

Option 3: Complete Installer Package

Use Inno Setup or NSIS to create a professional installer:

  • Bundles Python runtime
  • Auto-installs dependencies
  • Creates desktop shortcuts
  • Includes Ollama installer link

โšก Optimizations & Improvements

Current Performance

  • Processing Time: ~5-10 minutes for 10-minute video (base model)
  • Accuracy: 95-99% transcription, 75-90% AI analysis quality

Suggested Optimizations

1. GPU Acceleration (Faster transcription)

# Edit transcriber.py, change:
result = model.transcribe(audio_path, fp16=False)  # CPU
# To:
result = model.transcribe(audio_path, fp16=True)   # GPU (10x faster!)

2. Batch Processing Script

# Process multiple videos at once
python batch_process_all.py videos/*.mp4

3. Quality vs Speed Trade-offs

# Ultra-fast (2-3 min for 10-min video, lower accuracy)
python embed_subtitles.py video.mp4 -m tiny

# Balanced (default, 5-10 min)
python embed_subtitles.py video.mp4 -m base

# High quality (15-30 min, best accuracy)
python embed_subtitles.py video.mp4 -m medium

4. Model Caching (Already implemented)

  • Whisper model loads once and stays in memory
  • Ollama runs as persistent service

5. Parallel Processing

  • Process video + audio analysis simultaneously
  • Use multiprocessing for batch operations

๐Ÿ”ง Advanced Features to Add

Low-hanging fruit:

  1. โœ… Batch processing multiple videos
  2. โœ… Progress bars with estimated time remaining
  3. โœ… Email/notification when long processing completes
  4. โœ… Custom AI prompts for specialized content

Medium complexity: 5. ๐Ÿ“น Chapter detection and timestamps 6. ๐ŸŽจ Custom subtitle styling (fonts, colors, positioning) 7. ๐ŸŒ Web interface (Flask/FastAPI + React) 8. ๐Ÿ“ฑ Mobile app companion

Advanced: 9. ๐Ÿ—ฃ๏ธ Speaker diarization (identify different speakers) 10. ๐Ÿ“Š Auto-generate highlight reels 11. ๐Ÿƒ Anki flashcard export 12. ๐Ÿ”ด Real-time processing during live streams


๐Ÿ› ๏ธ Technical Architecture

Video File (.mp4, .avi, etc.)
    โ†“
1. Audio Extraction (moviepy)
    โ†“
2. Speech-to-Text (Whisper AI) โ†’ Timestamped segments
    โ†“
3. Content Analysis (Ollama LLM) โ†’ Summary + Insights + Quiz
    โ†“
4. Subtitle Generation (SRT format)
    โ†“
5. Subtitle Embedding (FFmpeg) โ†’ mov_text codec
    โ†“
Output: Video with subtitles + Word doc + JSON

Models & Technologies

  • Whisper (base model ~140MB) - 99 language support
  • Ollama llama3.1 (~4.7GB) - Local LLM, no API calls
  • FFmpeg - Video processing
  • python-docx - Document generation

๐Ÿ“‹ System Requirements

Minimum:

  • OS: Windows 10/11, macOS, Linux
  • RAM: 4GB
  • Storage: 8GB (models + videos)
  • CPU: Any modern processor

Recommended:

  • RAM: 8GB+
  • Storage: 20GB+ SSD
  • GPU: NVIDIA with CUDA support (10x faster)

๐Ÿ‘จโ€๐Ÿ’ป Author

Aditya Takawale

๐Ÿ“œ License

MIT License - See LICENSE file for details

Copyright ยฉ 2025 Aditya Takawale

๐Ÿ™ Acknowledgments

Built with:

This project is an independent integration of these tools and is not affiliated with or endorsed by OpenAI, Ollama, or any of the above projects.

โš–๏ธ Disclaimer

This software is provided "as is" for educational and personal use. Users are responsible for:

  • Complying with copyright laws when processing videos
  • Respecting terms of service of video platforms
  • Using this tool ethically and legally
  • Not redistributing copyrighted content without permission

The author is not responsible for misuse of this software.

๐ŸŒŸ Support

If you find this project helpful, please give it a โญ๏ธ on GitHub!

Report Issues: GitHub Issues


Built with โค๏ธ by Aditya Takawale | 100% Local, 100% Free, 100% Private


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_video_assistant-1.0.4.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_video_assistant-1.0.4-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file ai_video_assistant-1.0.4.tar.gz.

File metadata

  • Download URL: ai_video_assistant-1.0.4.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ai_video_assistant-1.0.4.tar.gz
Algorithm Hash digest
SHA256 469dfb5c5760bbfa03cd630f9de01162a7b20667a5d501cc464c6a8359fb1b8e
MD5 798382053e4ef7cc8fd6b1aa396d2da8
BLAKE2b-256 e6d625154554c0dd952a30e4cab207f38c62c646300bbb638e26fc3f732fe3ff

See more details on using hashes here.

File details

Details for the file ai_video_assistant-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_video_assistant-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bd2a317feaba5ce9c36775e3fb968677e70f2309be1c1a6830e8c64aaca67c7b
MD5 91b652ea65ebe8cb9cb91f0dce1e3047
BLAKE2b-256 b34132067dbf570f98a7752a1bfa55bf097a606229aa38147d2ad61fa3d7dfc7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page