Skip to content

Latest commit

 

History

52 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PausePoint AI

An AI-powered educational video processing platform that automatically generates transcripts, summaries, and interactive quizzes from instructional videos.

Built with a serverless architecture on AWS, PausePoint AI lets educators and learners upload any video and receive structured study materials in minutes — no manual work required.


Features

  • Speech-to-Text Transcription — Automatically transcribes video audio using OpenAI Whisper, with multi-language support
  • AI-Powered Summarization — Generates structured, Markdown-rendered summaries of video content using GPT-4o-mini
  • Interactive Quiz Generation — Creates 5 multiple-choice questions per video with answer explanations using GPT-3.5-turbo
  • Integrated Video Player — Watch videos alongside transcripts, with clickable timestamps that seek to key moments
  • Secure Direct Upload — Uploads videos directly to S3 via presigned URLs with real-time progress tracking
  • Auto-Scaling Deployment — Kubernetes HPA scales frontend pods (2–10) based on CPU utilization

Architecture

┌──────────────┐         ┌──────────────────┐
│  Web Browser │────────►│  FastAPI + Jinja2 │
│              │◄────────│  (Docker / K8s)   │
└──────┬───────┘         └────────┬─────────┘
       │                          │
       │ Direct Upload            │ Proxy
       │ (Presigned URL)          │
       ▼                          ▼
┌──────────────┐         ┌──────────────────┐
│    AWS S3    │         │ AWS API Gateway   │
│              │         └────────┬─────────┘
│  Videos +   │                  │
│  Results    │         ┌────────▼─────────┐
└──────┬───────┘         │   AWS Lambda     │
       │                 │                  │
       │  S3 Event       │  Presign Handler │
       └────────────────►│  Video Processor │
                         │                  │
                         └──────┬───────────┘
                                │
                    ┌───────────┼───────────┐
                    ▼           ▼           ▼
                Whisper    GPT-4o-mini  GPT-3.5-turbo
              (transcript)  (summary)     (quiz)

Data Flow:

  1. User uploads a video → Frontend requests a presigned URL from API Gateway → video uploads directly to S3
  2. S3 upload event triggers the video processor Lambda
  3. Lambda extracts audio (ffmpeg) → transcribes (Whisper) → summarizes (GPT-4o-mini) → generates quiz (GPT-3.5-turbo)
  4. Results are saved as JSON to the S3 results bucket
  5. Frontend polls for completion, then renders the video detail page with all generated content

Tech Stack

Layer Technology
Frontend Python, FastAPI, Jinja2, JavaScript, CSS
Backend AWS Lambda (Python 3.11), API Gateway
Storage AWS S3 (videos + result JSON)
AI/ML OpenAI Whisper, GPT-4o-mini, GPT-3.5-turbo
Infrastructure Terraform, Terraform Cloud
Containerization Docker
Orchestration Kubernetes (Minikube), Horizontal Pod Autoscaler
Audio Processing ffmpeg (Lambda Layer)

Project Structure

├── Front-end/
│   ├── main.py                  # FastAPI application and routes
│   ├── config.py                # API Gateway URL configuration
│   ├── Dockerfile               # Container image (Python 3.11-slim)
│   ├── requirements.txt
│   ├── static/
│   │   └── style.css            # Application styles
│   └── templates/
│       ├── base.html            # Base layout with marked.js
│       ├── index.html           # Upload page + video library
│       └── video_detail.html    # Player, transcript, summary, quiz
│
├── Lambda/
│   ├── index.py                 # Video processor (Whisper + GPT pipeline)
│   ├── presign.py               # Presigned URL handler (upload/list/results)
│   ├── test_lambda.py           # Lambda unit tests
│   ├── build.sh / build.ps1     # Lambda package build scripts
│   ├── README.md                # Lambda deployment guide
│   └── requirements.txt
│
├── Terraform/
│   ├── main.tf                  # Provider config + Terraform Cloud
│   ├── s3.tf                    # Video and results S3 buckets
│   ├── lambda.tf                # Lambda functions + S3 event trigger
│   ├── api_gateway.tf           # HTTP API + routes
│   ├── iam.tf                   # Lambda execution role and policies
│   ├── variables.tf             # Input variables
│   └── outputs.tf               # Deployment outputs
│
└── ops/
    ├── pause-point-deployment.yaml   # K8s Deployment (2 replicas)
    ├── pause-point-service.yaml      # NodePort Service (port 30080)
    ├── hpa.yaml                      # HPA: 2–10 pods, 70% CPU target
    └── README.md                     # Minikube deployment guide

Getting Started

Prerequisites

  • Python 3.11+
  • AWS account with configured credentials
  • OpenAI API key
  • Docker (for containerized deployment)
  • Terraform (for infrastructure provisioning)
  • Minikube + kubectl (for Kubernetes deployment)

1. Provision AWS Infrastructure

cd Terraform

# Set your variables
export TF_VAR_openai_api_key="your-openai-key"

terraform init
terraform plan
terraform apply

This creates the S3 buckets, Lambda functions, API Gateway, and IAM roles.

2. Run the Frontend Locally

cd Front-end

pip install -r requirements.txt

# Set the API Gateway URL (from Terraform output)
export API_GATEWAY_URL=https://your-api-gateway-url.amazonaws.com

uvicorn main:app --host 0.0.0.0 --port 8000 --reload

Open http://localhost:8000 in your browser.

3. Deploy with Kubernetes (Optional)

# Start Minikube
minikube start

# Build the Docker image
cd Front-end
docker build -t pause-point-ai-test:latest .

# Deploy
cd ..
kubectl apply -f ops/pause-point-deployment.yaml
kubectl apply -f ops/pause-point-service.yaml
kubectl apply -f ops/hpa.yaml

# Access the app
minikube service pause-point-service --url

See ops/README.md for the full Minikube deployment guide, including HPA testing.


How It Works

Video Upload

The frontend obtains a presigned PUT URL from the Lambda backend, then the browser uploads the video directly to S3 — bypassing the web server entirely. This avoids bandwidth bottlenecks and keeps the server stateless.

AI Processing Pipeline

When a video lands in S3, an event notification triggers the processor Lambda:

  1. Audio Extraction — ffmpeg (packaged as a Lambda Layer) strips the audio track from the video
  2. Transcription — OpenAI Whisper (whisper-1) converts speech to text
  3. Summarization — GPT-4o-mini analyzes the transcript and produces a structured Markdown summary highlighting key topics, learning points, and step-by-step instructions
  4. Quiz Generation — GPT-3.5-turbo generates 5 multiple-choice questions in structured JSON, each with 4 options, the correct answer, and an explanation

Result Delivery

The frontend polls the results bucket every 5 seconds (up to 5 minutes). Once the result JSON is available, the video detail page renders:

  • An embedded video player
  • The full transcript
  • A collapsible AI summary (rendered from Markdown)
  • Clickable key timestamps that seek the video
  • An interactive quiz with instant answer checking and explanations

Infrastructure as Code

All AWS resources are defined in Terraform and managed through Terraform Cloud:

  • S3 Buckets — Separate buckets for raw videos and processed results, with CORS configured for browser uploads
  • Lambda Functions — Two functions: video processor (triggered by S3 events) and presign handler (invoked via API Gateway)
  • API Gateway — HTTP API with a /presign route for upload URLs, result retrieval, and video listing
  • IAM — Least-privilege execution role for Lambda with S3 and CloudWatch access

Kubernetes Deployment

The frontend runs in a Kubernetes cluster with:

  • Deployment — 2 replicas by default, configurable via API_GATEWAY_URL environment variable
  • Service — NodePort on port 30080 for external access
  • HPA — Horizontal Pod Autoscaler scales between 2–10 replicas targeting 70% CPU utilization

About

An serverless AI-powered educational video processing platform that automatically generates transcripts, summaries, and interactive quizzes from instructional videos.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages