A production-grade video transcoding pipeline built using TurboRepo, NestJS, React, Docker, and FFmpeg.
The system is fully decoupled, supports cloud-native deployments, and converts uploaded videos to HLS with adaptive bitrate. Ideal for building your own YouTube-style infrastructure.
video_streaming/
├── apps/
│ ├── backend/ # NestJS REST APIs (Auth, Upload, Jobs)
│ ├── frontend/ # React app for uploading & viewing progress
│ └── video/ # Worker service that handles video processing
│
├── packages/
│ ├── queue/ # BullMQ job setup
│ ├── database/ # Prisma + PostgreSQL config
│ ├── types/ # Shared TypeScript types
│ ├── utils/ # Common utilities (e.g., S3 handlers)
│ ├── eslint-config/ # Shared ESLint config
│ └── typescript-config/ # Shared tsconfig
Layer | Tech |
---|---|
Monorepo | TurboRepo |
Backend | NestJS, BullMQ, Redis, Prisma |
Frontend | React + Tailwind (upload UI) |
Database | PostgreSQL |
Storage | AWS S3 (input + output) |
Worker | Node.js + Docker + FFmpeg |
From upload to
.m3u8
— fully automated.
- Frontend allows video uploads.
- Backend API receives video → stores it on S3 → enqueues a job in BullMQ.
- Worker Service picks the job and:
- Launches a Docker container.
- Downloads the raw video from S3.
- Runs FFmpeg to transcode it into
.m3u8
HLS format with adaptive bitrate. - Uploads the HLS folder back to S3.
- Logs the
master.m3u8
URL to stdout.
- Worker listens to logs → extracts
HLS_READY:<URL>
→ updates DB with playback URL.
Custom-built lightweight FFmpeg Docker image.
docker run --rm \
-e INPUT_URL=s3://... \
-e OUTPUT_BUCKET=... \
-e AWS_ACCESS_KEY_ID=... \
-e AWS_SECRET_ACCESS_KEY=... \
abhishekshivale21/ffmpeg
- Handles downloading, transcoding, and re-uploading.
- Logs HLS URL for job tracking.
- 🔗 Main Repo: video_streaming
- 🐳 Docker Image: Docker Hub – abhishekshivale21/ffmpeg
- 📓 Blog Post: Read the Blog
pnpm install
pnpm dev
Make sure Redis, PostgreSQL, and Docker are running locally.
AWS credentials should be configured via environment variables or .env
.
MIT © Abhishek Shivale