Skip to content

Repository files navigation

WARNING

This was vibecoded. Seems to work, but handle with caution.

ffmpeghelper

A Flask web application for video processing with FFmpeg. Allows you to upload videos and apply rotation, cropping, and compression.

Features

  • Upload Video: Support for MP4, AVI, MOV, MKV, WebM, FLV, WMV, M4V formats
  • Rotate Video: Options for 0°, 90°, 180°, -90° rotation
  • Crop Video: Draw a crop area on the video thumbnail preview
  • Compress Video: Compress to ~8MB for Discord and other platforms with file size limits

Tech Stack

  • Backend: Flask (Python)
  • Frontend: Bootstrap 5 with custom dark theme
  • Video Processing: FFmpeg via typed-ffmpeg
  • Dependency Management: Astral.sh UV
  • Deployment: Docker

Quick Start

Prerequisites

  • Python 3.10+
  • FFmpeg installed on your system
  • UV (Astral.sh's package manager)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/ffmpegger.git
    cd ffmpegger
  2. Install UV (if not already installed):

    # On Windows (PowerShell)
    irm https://astral.sh/uv/install.ps1 | iex
    
    # On macOS/Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
  3. Create virtual environment and install dependencies:

    uv venv
    uv pip install -r pyproject.toml
  4. Run the application:

    # Activate virtual environment
    # Windows:
    .venv\Scripts\activate
    # macOS/Linux:
    source .venv/bin/activate
    
    # Run Flask
    python app.py
  5. Open your browser and navigate to http://localhost:5000

Docker Deployment

Build the Docker image:

docker build -t ffmpegger .

Run the container:

docker run -p 5000:5000 ffmpegger

Using Docker Compose (optional):

version: '3.8'
services:
  ffmpegger:
    build: .
    ports:
      - "5000:5000"
    volumes:
      - ./uploads:/app/uploads
      - ./outputs:/app/outputs

Usage

  1. Upload a Video: Drag and drop a video file or click to browse
  2. Preview: A thumbnail will be generated from the video
  3. Rotate: Select a rotation angle (0°, 90°, 180°, -90°)
  4. Crop: Draw a rectangle on the thumbnail to define the crop area
  5. Compress: Toggle the "Compress to ~8MB" option if needed
  6. Process: Click "Process Video" to apply the changes
  7. Download: Download your processed video

API Endpoints

  • GET / - Main page
  • POST /upload - Upload a video file
  • POST /process - Process video with options
  • POST /regenerate-thumbnail - Regenerate thumbnail with rotation
  • GET /download/<filename> - Download processed video

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages