A lightweight Go service that handles media uploads, validation, and serving. Backed by S3/R2 by default; can route video uploads directly to Cloudflare Stream.
- Presigned uploads — secure direct-to-S3 (or direct-to-Stream) uploads with profile-driven validation
- Image processing — on-demand thumbnails with WebP/JPEG/PNG output
- Video probe — validates duration, dimensions, and codec against profile constraints (ffprobe for R2, Stream API for Stream)
- Cloudflare Stream delivery — opt-in per profile, bytes go straight to Stream with no R2 round-trip
git clone https://github.com/syntaxsdev/mediaflow
cd mediaflow
cp .env.example .env # set S3_BUCKET + AWS / R2 credentials
go mod download
make run # or `make run-air` for hot reloadOr via Docker:
docker run -p 8080:8080 \
-e S3_BUCKET=your-bucket-name \
-e AWS_ACCESS_KEY_ID=your-key \
-e AWS_SECRET_ACCESS_KEY=your-secret \
-v $(pwd)/storage-config.yaml:/app/storage-config.yaml \
syntaxsdev/mediaflow:latest- API reference — endpoints, request/response shapes, error codes
- Configuration —
storage-config.yamlprofiles, fields, env vars - Cloudflare Stream delivery — opt-in flow for video profiles
- Deployment — Docker, ECS, IAM, R2, lifecycle rules
make run— build and runmake run-air— hot reload via Airmake build— build the binarymake build-image— build the Docker imagemake clean— remove artifacts
- Go 1.24.5+
- ffmpeg (only if any profile is
kind: videoanddeliveryis notstream— the runtime image already includes it)
- Fork
- Create a feature branch
- Make changes (add tests where applicable)
- Open a PR
MIT