Skip to content

Gagancreates/MediaForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MediaForge

A self-hosted web application for converting and compressing images and videos using FFmpeg.

Image Image Image

Features

  • 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

Quick Start

Using Docker (Recommended)

git clone https://github.com/Gagancreates/MediaForge.git
cd MediaForge
docker-compose up -d

Access at http://localhost:8000

Local Development

  1. Install FFmpeg and Python 3.11+
  2. Install dependencies:
    pip install -r backend/requirements.txt
  3. Run the server:
    ./run.bat  # Windows
    ./run.sh   # Mac/Linux

Technology Stack

  • Backend: FastAPI + Python
  • Processing: FFmpeg
  • Frontend: Vanilla JavaScript
  • Deployment: Docker

Supported Formats

Images: JPG, PNG, WebP, AVIF, BMP, TIFF, GIF Videos: MP4, WebM, AVI, MKV, MOV, FLV Codecs: H.264, H.265, VP8, VP9, MPEG-4

How It Works

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.

API Documentation

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Configuration

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: 4G

Troubleshooting

FFmpeg not found: Ensure FFmpeg is in your PATH

ffmpeg -version

Slow processing: Video encoding is CPU-intensive. Use lower quality settings or H.264 codec for faster processing.

License

MIT License - see LICENSE file for details

Contributing

Contributions welcome! Fork the repo, create a feature branch, and submit a PR.

About

Privacy-focused media converter. Process images and videos locally with zero data retention.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors