A self-hosted web application for converting and compressing images and videos using FFmpeg.
- Convert images between JPG, PNG, WebP, AVIF, BMP, TIFF, and GIF
- Convert videos between MP4, WebM, AVI, MKV, MOV, and FLV
- Compress to specific target file sizes with intelligent algorithms
- No file size limits or data retention
- Modern UI with drag-and-drop support and live comparison
- Self-hosted with complete privacy
git clone https://github.com/Gagancreates/MediaForge.git
cd MediaForge
docker-compose up -dAccess at http://localhost:8000
- Install FFmpeg and Python 3.11+
- Install dependencies:
pip install -r backend/requirements.txt
- Run the server:
./run.bat # Windows ./run.sh # Mac/Linux
- Backend: FastAPI + Python
- Processing: FFmpeg
- Frontend: Vanilla JavaScript
- Deployment: Docker
Images: JPG, PNG, WebP, AVIF, BMP, TIFF, GIF Videos: MP4, WebM, AVI, MKV, MOV, FLV Codecs: H.264, H.265, VP8, VP9, MPEG-4
Image Compression: Uses binary search (70-95 quality range) to hit target file size within 5% accuracy in up to 5 iterations.
Video Compression: Calculates optimal bitrate based on target size and duration, then uses 2-pass encoding for best quality.
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Modify timeout in backend/services/ffmpeg_service.py:
def run_ffmpeg_command(cmd: List[str], timeout: int = 3600):For Docker memory limits, edit docker-compose.yml:
deploy:
resources:
limits:
memory: 4GFFmpeg not found: Ensure FFmpeg is in your PATH
ffmpeg -versionSlow processing: Video encoding is CPU-intensive. Use lower quality settings or H.264 codec for faster processing.
MIT License - see LICENSE file for details
Contributions welcome! Fork the repo, create a feature branch, and submit a PR.