Skip to content

Repository files navigation

remuXcode

A self-hosted media maintenance tool that automatically converts, cleans, and optimizes your Plex/Jellyfin library — triggered by Sonarr and Radarr webhooks or kicked off manually from the built-in web UI.

When new content is imported, remuXcode receives a webhook, analyzes the file, and runs whichever conversions are needed: DTS/DTS-HD audio gets converted to AC3/EAC3/AAC for broad device compatibility, 10-bit H.264 (or legacy codecs like VC-1 and MPEG-2) gets re-encoded to HEVC or AV1, and foreign-language audio and subtitle tracks get stripped out. All of this runs in the background with no manual intervention.

The web UI lets you browse your entire Sonarr/Radarr library — movies and shows — with poster grids, episode tables, filters, and per-file analysis. Queue individual files, full series, or bulk selections, and monitor everything from the Jobs page.

Features

  • Audio conversion — DTS/DTS-HD → AC3 (5.1), EAC3 (7.1+), or AAC (stereo); configurable bitrate caps; optional keep-original; TrueHD passthrough
  • Video encoding — 10-bit H.264, 8-bit H.264 (optional), and legacy codecs (VC-1, MPEG-2, MPEG-4/XviD/DivX) → HEVC or AV1
  • Dolby Vision retention — re-encode DV sources (including Profile 7 remuxes) to compact HEVC while keeping Dolby Vision as Profile 8.1 with HDR10 fallback, via dovi_tool + FFmpeg RPU passthrough; selectable per job in the Custom Encode modal
  • Hardware acceleration — Intel QSV/VAAPI and NVIDIA NVENC auto-detected at startup; software fallback when no GPU is available
  • Stream cleanup — remove audio and subtitle tracks outside your keep-languages list; preserve forced subtitles, SDH, commentary, and audio description; always-keep-original option for anime and live-action
  • Anime support — per-worker anime-only mode, anime-optimized encoding presets, dual-audio preservation
  • Library browse — Movies and Shows pages backed by Radarr/Sonarr APIs with poster art, filters, sort, multi-select batch queue; deep links back to Radarr/Sonarr
  • Analyze modal — full stream detail (video, audio, subtitle streams) for any file via ffprobe
  • Job queue — persistent SQLite-backed queue, resumable after restart, drag-and-drop reordering, retry failed jobs
  • Webhook-driven — fire-and-forget automation; also fully usable in manual mode
  • Single container — FastAPI backend + SvelteKit frontend, port 7889

See docs/ for the full feature reference.


Screenshots

Dashboard Dashboard — live job progress with poster art, phase badges, and ETA

Movies Movies — Radarr library browse with poster grid, filters, and batch queue

Shows Shows — Sonarr series and episode browser with per-file actions

Jobs Jobs — full job history with per-job log viewer and stream details

Settings Settings — encoding, audio, cleanup, and integration config

Integrations Integrations — Sonarr and Radarr connection status


Quick Start

Option 1 — Prebuilt Image (recommended)

1. Create compose.yml

services:
  remuxcode:
    container_name: remuxcode
    image: ghcr.io/sirjmann92/remuxcode:latest
    ports:
      - "7889:7889"
    volumes:
      - ./config:/app/config         # config.yaml, jobs.db, API key
      - ./logs:/app/logs
      - /mnt/yournas:/share:rw       # match the path Sonarr/Radarr use internally
    devices:
      - /dev/dri:/dev/dri            # optional — Intel QSV/VAAPI GPU passthrough
    environment:
      - TZ=America/Chicago
    restart: unless-stopped

Mount your media at the same path Sonarr/Radarr use inside their containers so webhook file paths need no translation. Add additional volume mounts if your library spans multiple shares.

2. Start

docker compose up -d

config/config.yaml is created automatically on first run with sensible defaults. Open http://localhost:7889/config to configure your encoding, audio, and cleanup settings.

To connect Sonarr and Radarr, edit config/config.yaml and add your URLs and API keys (see Integrations).

Your API key is auto-generated on first start and stored in config/.api_key. It's also shown on the Settings page.


Option 2 — Build from Source

git clone https://github.com/sirjmann92/remuXcode.git
cd remuXcode

Create a compose.yml as above, but replace image: ghcr.io/... with:

build: .

Then:

docker compose up -d --build

Recommended Workflow

Configure Sonarr and Radarr to prefer remux releases — full lossless Blu-ray remuxes with no re-encoding. A remux retains the original video bitrate and lossless audio (DTS-HD MA, TrueHD), giving remuXcode the best possible source to work from.

Re-encoding an already-compressed video introduces generation loss: the encoder makes a second round of approximations on top of the first, compounding artifacts that cannot be undone. Starting from a remux means any re-encoding remuXcode does happens exactly once, from a lossless source.

See docs/integrations.md for suggested quality profile tips and full setup instructions.


Webhook Setup

Sonarr

Settings → Connect → Add → Webhook:

Field Value
URL http://<host>:7889/api/webhook
Method POST
Triggers On Import Complete (recommended)
Headers X-API-Key: <your key>

On Import Complete fires once after a full batch import (e.g. a whole season), delivering all file paths in a single payload — more efficient than per-episode triggers. You can also enable On File Import and/or On File Upgrade for per-file triggers.

Radarr

Settings → Connect → Add → Webhook:

Field Value
URL http://<host>:7889/api/webhook
Method POST
Triggers On Import, On Upgrade
Headers X-API-Key: <your key>

API

Interactive API docs are available at http://localhost:7889/docs.

# Health check
curl http://localhost:7889/health

# Queue a single file for full conversion
curl -X POST http://localhost:7889/api/convert \
  -H "Content-Type: application/json" \
  -d '{"path": "/share/movies/Movie (2024)/movie.mkv", "type": "full"}'

# type options: full | audio | video | cleanup

# Queue all files in a Radarr library (by Radarr movie IDs)
curl -X POST http://localhost:7889/api/convert/movies \
  -H "Content-Type: application/json" \
  -d '{"movie_ids": [123, 456], "type": "full"}'

# Queue all episodes in a Sonarr series (by Sonarr series ID)
curl -X POST http://localhost:7889/api/convert/series \
  -H "Content-Type: application/json" \
  -d '{"series_ids": [42], "type": "audio"}'

# List jobs
curl http://localhost:7889/api/jobs

# Analyze a file
curl "http://localhost:7889/api/analyze?path=/share/movies/Movie/movie.mkv"

Documentation

Page Description
Dashboard Live stats, active jobs, queue management
Movies Browse and process your movie library
Shows Browse and process your TV library
Jobs Job history, filtering, controls
Settings Complete settings reference
Integrations Sonarr/Radarr setup, webhooks, and recommended workflow

License

MIT

About

Automated Reencoding For Sonarr/Radarr Libraries

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages