Skip to content

About

Distributed media pipeline: Whisper transcription + BART summarization behind a Redis queue (React, Express, PostgreSQL, MinIO, Docker Compose)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

MediaPipe AI - Video/Audio Processing Pipeline

A production-grade AI Media Processing Pipeline with React frontend, Express API gateway, Python AI worker, and PostgreSQL database, all orchestrated via Docker Compose.

Architecture

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│   React Client │────▶│  Express API GW  │────▶│  PostgreSQL DB  │
│   (Port 5173)   │     │   (Port 3000)    │     │   (Port 5432)   │
└─────────────────┘     └────────┬─────────┘     └─────────────────┘
                                  │
                         ┌────────▼─────────┐
                         │   Redis Queue    │
                         │   (Port 6379)    │
                         └────────┬─────────┘
                                  │
                         ┌────────▼─────────┐
                         │  Python Worker  │
                         │  Whisper + BART │
                         └────────┬─────────┘
                                  │
                         ┌────────▼─────────┐
                         │  MinIO (S3)     │
                         │  File Storage   │
                         │  (Port 9000)    │
                         └─────────────────┘

Prerequisites

  • Docker
  • Docker Compose

Quick Start

# 1. Clone the repository
git clone <repository-url>
cd mediapipe-ai

# 2. Copy environment file
cp .env.example .env

# 3. Start all services
docker compose up -d

# 4. Open the web UI
# Visit http://localhost:5173

Service Ports

Service Port Description
Client 5173 React frontend
API 3000 Express API gateway
PostgreSQL 5432 Database
Redis 6379 Job queue
MinIO 9000 S3-compatible storage

Supported File Formats

Type Formats
Video mp4, mkv, mov, webm
Audio mp3, wav, m4a, ogg

Maximum file size: 500MB

API Reference

Method Route Description
POST /api/upload Upload file and create job
GET /api/jobs List all jobs (paginated)
GET /api/jobs/:id Get job details
DELETE /api/jobs/:id Delete job and files
GET /api/health Health check endpoint

Upload Response

{
  "id": "uuid",
  "filename": "video.mp4",
  "status": "queued",
  "created_at": "2024-01-01T00:00:00Z"
}

Jobs List Response

{
  "jobs": [...],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 100,
    "pages": 5
  }
}

Job Detail Response

{
  "id": "uuid",
  "filename": "video.mp4",
  "status": "done",
  "transcript": "...",
  "summary": "...",
  "duration_s": 120.5,
  "created_at": "2024-01-01T00:00:00Z"
}

Running Tests

API Tests

cd api
npm test

Worker Tests

cd worker
pip install -r requirements-dev.txt
pytest

Swapping Whisper Model

The worker uses the base model by default. To use a different model:

  1. Edit .env:

    WHISPER_MODEL=medium
    
  2. Available models: tiny, base, small, medium, large

Note: Larger models require more memory and processing time.

Known Limitations

  • Whisper base model has limited accuracy compared to larger models
  • Single worker process (no horizontal scaling)
  • No authentication/authorization
  • No user management
  • No persistent storage beyond MinIO

Development

For development with hot reload:

docker compose -f docker-compose.yml -f docker-compose.dev.yml up

Environment Variables

# Postgres
POSTGRES_USER=mediapipe
POSTGRES_PASSWORD=secret
POSTGRES_DB=mediapipe

# Redis
REDIS_URL=redis://redis:6379

# MinIO
MINIO_ENDPOINT=minio:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
MINIO_BUCKET=media-uploads

# API
PORT=3000
CLIENT_ORIGIN=http://localhost:5173

# Worker
WHISPER_MODEL=base

License

MIT

About

Distributed media pipeline: Whisper transcription + BART summarization behind a Redis queue (React, Express, PostgreSQL, MinIO, Docker Compose)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages