README / README.md
Monteeq CI
πŸš€ Deploy from GitHub @ 4eb79b5e42a5d81d582a63b79ba4afd35d266c0b
a8673cc
|
Raw History Blame Contribute Delete
2.16 kB
---
title: Monteeq Video Service
emoji: πŸŽ₯
colorFrom: blue
colorTo: indigo
sdk: docker
app_port: 7860
pinned: false
---
# Monteeq Video Service
High-performance, asynchronous Rust service for processing and transcoding video to HLS.
- **Health Check**: [/health](https://monteeqorg-readme.hf.space/health)
## Configuration
In your Hugging Face Space settings, add the following **Secrets** (AWS S3 β€” match `backend/.env`):
| Secret Name | Value |
|---|---|
| `REDIS_URL` | Redis Cloud connection URL |
| `AWS_ACCESS_KEY_ID` | AWS access key |
| `AWS_SECRET_ACCESS_KEY` | AWS secret key |
| `AWS_STORAGE_BUCKET_NAME` | `monteeq-2` |
| `AWS_S3_REGION_NAME` | `eu-central-1` |
| `AWS_CLOUDFRONT_DOMAIN` | `cdn.monteeq.com` |
Leave `S3_ENDPOINT` unset (or empty) so the service uses native AWS S3.
## Performance knobs
| Variable | Default | Purpose |
|---|---|---|
| `MAX_CONCURRENT_JOBS` | `min(cpus / 2, RAM GB / 1.5, DISK_IO_LIMIT)` | Worker slots. Override when the host reports throttled/shared CPUs. |
| `DISK_IO_LIMIT` | `4` | Upper bound used by the automatic slot calculation. |
| `UPLOAD_CONCURRENCY` | `12` | Parallel S3 segment PUTs. |
## Processing pipeline
1. **Validate** β€” one `ffprobe` call returns dimensions, duration, audio presence and codecs.
2. **Download** β€” streamed from S3 straight to disk (no full-file buffering), with progress reported to Redis.
3. **Plan** β€” if the source is already H.264/AAC and inside the tier cap it is **remuxed** (`-c copy`) instead of re-encoded. Otherwise the ladder is filtered against the source height, so the service never upscales, and the free tier emits a single rendition.
4. **Package** β€” ffmpeg writes HLS to a temp dir while a background task uploads each segment to S3 as soon as it is complete, so transfer overlaps the encode.
5. **Cover** β€” a frame is pulled from an already-encoded segment (~10% into the video), falling back to the source only if needed, then uploaded to `thumbnails/{task_id}.jpg`.
6. **Report** β€” `task:status:{task_id}` carries progress, and `variants` (the playlist names actually produced) so the backend only advertises renditions that exist.