A lightweight REST API in Go that handles video uploads, stores them in S3-compatible object storage, and transcodes them into multiple HLS resolutions using FFmpeg.
- Go 1.21+
- FFmpeg
- A queuing solution (
Redis) - An S3-compatible object storage solution (
MinIO)
-
Accept Upload (API Service)
Users upload a.mp4file via the REST API. -
Store Raw Video (Object Storage)
The uploaded video is stored in an S3-compatible object storage solution (MinIO). -
Queue Processing Job (Queuing Solution)
The API does not process videos directly. Instead, it enqueues a job (viaRedis) for background processing. -
Transcode Video (Worker + FFmpeg)
The worker downloads the video and transcodes it into multiple resolutions:- 1080p
- 720p
- 480p
It produces an HLS streaming package with:
.tssegment files- Individual playlists:
1080p.m3u8,720p.m3u8,480p.m3u8 - A master playlist:
master.m3u8
-
Generate Thumbnail
A single JPEG image is extracted from the video.
POST /upload
- Body: multipart/form-data
- file: .mp4 video
- Response: JSON with job ID
- Build binaries
make build- Run the API & Worker
make runEnsure a queuing solution (Redis) and a S3 compatible storage solution (MinIO) are running and accessible.
Run the entire stack using Docker Compose:
docker compose up -dThis will start:
- API service
- Worker service
- Redis
- MinIO