Lightweight backend media processing service built with Flask and FFmpeg.
This project demonstrates clean service-layer architecture, subprocess orchestration, and structured media metadata inspection.
- Repeat video (stream looping)
- Frame-accurate video trimming (re-encoding)
- Convert video to MP3
- Inspect metadata using ffprobe (JSON parsing)
The project follows a modular structure:
routes.py— HTTP layer (Flask Blueprint)services/— FFmpeg and metadata orchestrationutils/— validation helpersdomain/— domain model placeholderconfig.py— centralized configuration- Application factory pattern for scalability
Separation of concerns keeps the HTTP layer thin and improves testability.
Trimming uses re-encoding instead of -c copy to ensure frame-accurate cuts rather than keyframe-based approximations.
FFmpeg logic is isolated inside a service layer to avoid coupling transport logic with business logic.
Metadata is extracted using structured JSON output instead of parsing raw CLI output.
Requires FFmpeg installed and available in PATH.
pip install -r requirements.txt
python run.pyServer runs on:
http://127.0.0.1:5000
- Async processing queue (Celery/RQ)
- Structured logging
- Docker support
- Health check endpoint
- Background job cleanup