Skip to content
jessielwPublic

Repository files navigation

Mp4Forge

A modern MP4 muxing tool with a desktop GUI interface, powered by MP4Box.

Desktop Application

image image image image image

WebUI (Docker/headless)

image image image image image image

Features

  • Multi-track support: Add multiple video, audio, subtitle, and chapter tracks to a single MP4 container
  • Multi-track MP4 audio selection: Select specific audio tracks from MP4 files containing multiple audio streams
  • Language & metadata: Set language codes, titles, default/forced flags for all tracks
  • Audio delay: Support for audio delay values (automatically detected from filenames or MediaInfo)
  • Chapter support: Import chapters from OGM/XML files or other MP4 containers
  • Queue system: Build and manage multiple muxing jobs in a queue
  • Cross-platform: Available for Windows (8+ x64), macOS, and Linux
  • Theme support: Light, dark, and auto themes
  • Quick access titles: Save and use quick access titles for audio/subtitles

Supported Formats

Video: H.264/AVC, H.265/HEVC, MP4/M4V
Audio: AAC/ADTS, AC-3, E-AC-3, Dolby AC-4 (including Immersive Stereo), DTS, Dolby TrueHD, FLAC, PCM WAV/AIFF, MP2, MP3, Opus, OGG, and MP4/M4A (with multi-track selection)
Subtitles: SRT, SSA, ASS, VTT, MP4/M4V
Chapters: OGM, XML, MP4 (extracted from existing files)
Output: MP4 for video jobs and M4A for audio-only jobs

Desktop Application Requirements

MP4Box must be installed and available in your system PATH, or configured in the application settings.

Dolby AC-4 muxing requires GPAC 26.02 or newer with the AC-4 reframer enabled. Mp4Forge passes through the encoded audio and its presentations. Playback support depends on the player and device. GPAC 26.02 release notes

  • Download MP4Box: GPAC Downloads
  • Or install via package manager:
    • Windows: winget install GPAC.GPAC or choco install gpac
    • macOS: brew install gpac
    • Linux: apt install gpac or yum install gpac

Docker Application Requirements

Everything is self contained and included that you would need.

Installation

Option 1: Download Pre-built Binaries (Recommended)

  1. Go to the Releases page
  2. Download the archive for your platform:
    • Windows: Mp4Forge-Windows.zip
    • macOS (Apple Silicon): Mp4Forge-macOS-ARM64.zip
    • macOS (Intel): Mp4Forge-macOS-Intel.zip
    • Linux: Mp4Forge-Linux.tar.gz
  3. Extract the archive
  4. Run the application:
    • Windows: Run Mp4Forge.exe
    • macOS: Extract the .zip and drag Mp4Forge.app to your Applications folder, then launch from Launchpad or Finder
    • Linux: Run ./Mp4Forge

Option 2: Run from Source

Requirements: Python 3.11 or 3.12, uv

git clone https://github.com/jessielw/MP4-Mux-Tool.git
cd MP4-Mux-Tool
uv sync --all-extras
uv run python frontend_desktop/main.py

Option 3: Docker (Web Interface)

Run MP4Forge with a web interface using Docker:

Compose Example:

services:
  mp4forge:
    image: ghcr.io/jessielw/mp4forge:latest
    platform: linux/amd64
    container_name: mp4forge-web
    ports:
      - "8000:8000"
    volumes:
      # mount for persistent config and logs
      - /SOME_PATH/runtime:/app/runtime
      # mount volume(s) you may need for input/output files
      - /SOME_PATH:/data/SOME_PATH
      - /SOME_PATH2:/data/SOME_PATH2
    environment:
      - PYTHONUNBUFFERED=1
    restart: "no"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
      interval: 60s
      timeout: 10s
      retries: 3
      start_period: 10s

Usage

  1. Add tracks: Use the Video, Audio, Subtitles, and Chapters tabs to add input files

    • Drag & drop files directly onto input fields (desktop only)
    • Use the file browser button
    • For multi-track MP4 audio files, a track selector dialog will appear
  2. Configure metadata: Set language, title, default/forced flags, and delay for each track

  3. Set output: Go to the Output tab and specify your output file path. To create an .m4a file, add tracks in the Audio tab and leave the Video and Subtitles tabs empty.

  4. Add to queue: Click "Add Current Job" to add the muxing job to the queue

  5. Process: Click "Process Queue" to start muxing all queued jobs

Multi-track Audio

When adding an MP4 file with multiple audio tracks to an audio tab, Mp4Forge will display a track selector dialog showing:

  • Track ID
  • Format
  • Channels
  • Bitrate
  • Sample rate
  • Language
  • Title
  • Delay

Select the track you want to use and click OK.

Portable Mode

By default, configuration is stored in your OS user config directory:

  • Windows: %APPDATA%\Mp4Forge\config.toml
  • macOS: ~/Library/Application Support/Mp4Forge/config.toml
  • Linux: ~/.config/Mp4Forge/config.toml

For portable installations, the config is stored in the runtime/ folder alongside the executable (desktop only).

Development

Building from Source

# Install dependencies
uv sync --all-extras

# Run the application
uv run python frontend_desktop/main.py

# Build executables
uv run python build_desktop.py

Tech Stack

Desktop

  • Backend: MP4Box (GPAC)
  • Frontend: PySide6 (Qt6)
  • Build: PyInstaller
  • Package Manager: uv
  • MediaInfo: pymediainfo for track inspection

WebUI

  • Backend: Python/FastAPI/GPAC
  • Frontend: Svelte
  • Build: Docker
  • Package Managers: uv & node
  • MediaInfo: pymediainfo for track inspection

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

See LICENSE for details.

Credits