A NestJS-based REST API for media file operations including probing, conversion, and manipulation using FFmpeg.
- 🎬 Media file probing via URL with automatic metadata extraction
- 💾 Smart caching system (1-hour cache for downloaded files)
- 📊 File size limits (50MB max) for safe processing
- 📝 Interactive API documentation with Swagger/OpenAPI
- 🐳 Docker support with multi-stage builds
- ✅ Built-in health checks
- Node.js (v18 or higher recommended)
- FFmpeg/FFprobe installed and available in PATH
macOS:
brew install ffmpegUbuntu/Debian:
sudo apt-get update
sudo apt-get install ffmpegWindows: Download from ffmpeg.org and add to PATH.
# Clone the repository
git clone https://github.com/lembdev/media-converter-api.git
cd media-converter-api
# Install dependencies
npm installVersion bumping follows conventional commit standards:
fix:→ patch version (0.0.1 → 0.0.2)feat:→ minor version (0.0.1 → 0.1.0)feat!:orBREAKING CHANGE:→ major version (0.0.1 → 1.0.0)
Published Docker images are available at:
# Pull latest version
docker pull lembdev/media-converter-api:latest
# Pull specific version
docker pull lembdev/media-converter-api:0.0.1npm run start:devThe API will be available at http://localhost:3000
# Build the application
npm run build
# Start production server
npm run start:prodInteractive API documentation is available via Swagger UI:
- URL:
http://localhost:3000/api/docs
GET /health
Returns the health status of the application.
POST /probe/url
Content-Type: application/json
{
"url": "https://example.com/video.mp4"
}
Downloads a media file from the provided URL (max 50MB) and extracts metadata using ffprobe. Files are cached for 1 hour to optimize repeated requests.
Response: Complete FFprobe metadata including streams, format, duration, codecs, etc.
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 3000 |
NODE_ENV |
Environment mode | development |
This project is licensed under the MIT License.