Skip to main content
Collapsarr logo

Collapsarr

Never get stuck without a downmix again.

License: GPL v3 CI Docker PyPI Release

Collapsarr is a companion application for Sonarr and Radarr. It watches your library for media missing a lower-channel-count audio track — a 7.1 release with no stereo fallback, a 5.1 file your soundbar can't decode — and adds one automatically via FFmpeg, without touching the track that's already there.

Why

  • No upmixing, ever. Collapsarr only adds tracks the source can actually support (a stereo/2.1/5.1 downmix from a higher channel count) — it will never fake a 5.1 track out of a stereo source.
  • Originals are never at risk. The remux writes to a temp file, validates duration and stream count, then atomically swaps it in. Any failure at any stage leaves the original file completely untouched — no partial writes, no orphaned backups.
  • Fits into the *arr stack you already run. Sonarr/Radarr integration (webhooks + periodic scan), a dark UI in the same style as the rest of the family, and a REST API following the same conventions.

Features

  • Sonarr and Radarr integration — instance config, connectivity check, remote path mapping, multiple concurrent instances
  • Per-target, per-language detection that stacks additional targets without duplicating what's already there
  • FFmpeg remux: stream-copies existing tracks, encodes new audio (AAC for Stereo, AC3 @ 448kbps for 2.1/5.1)
  • Job queue with configurable concurrency — triggered by webhook, periodic full-library scan, on-demand scan, or manual per-file trigger
  • Full job history: status, timestamps, FFmpeg exit code, error text
  • Web UI in the same dark theme as Sonarr/Radarr/Bazarr — Wanted view, Activity/History, per-file detail view with a manual trigger
  • Webhook + Discord notifications on job failure or app health issues (e.g. FFmpeg missing)
  • REST API with *arr-convention auth (API key)

Quick start

Docker (recommended):

services:
  collapsarr:
    image: odxnsson/collapsarr:latest
    container_name: collapsarr
    ports:
      - "8282:8282"
    volumes:
      - ./config:/config
      - /path/to/media:/media
    environment:
      - PUID=1000
      - PGID=1000
    restart: unless-stopped

Then open http://localhost:8282. restart: unless-stopped above means the container comes back automatically whenever it stops unexpectedly or the Docker daemon restarts (e.g. after a host reboot) — see Running on startup if you need it to survive a reboot on a bare-metal/PyPI install instead.

PyPI (bare-metal):

pip install collapsarr
COLLAPSARR_DATABASE_PATH=~/.local/share/collapsarr/collapsarr.db collapsarr

The default database path (/config/collapsarr.db) assumes the Docker image's mounted /config volume — on a bare-metal install /config usually doesn't exist or isn't writable, so set COLLAPSARR_DATABASE_PATH to a location your user owns, as above (the parent directory is created for you). Requires FFmpeg on PATH — see Requirements below. Open http://localhost:8282; see Configuration for the full list of environment variables, and Running on startup for a systemd unit.

Requirements

  • Python 3.12+

  • FFmpeg — external system dependency, checked at startup and reported on the health page if missing. Bundled in the Docker image; install it yourself for a bare-metal/PyPI setup:

    OS Command
    Debian / Ubuntu sudo apt install ffmpeg
    Fedora sudo dnf install ffmpeg
    Arch sudo pacman -S ffmpeg
    macOS (Homebrew) brew install ffmpeg
    Windows (winget) winget install ffmpeg

    Verify with ffmpeg -version. Official builds/source: ffmpeg.org/download.html.

Development

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Run the checks
pytest
ruff check .
mypy

# Run the server (defaults to http://0.0.0.0:8282)
python -m collapsarr
# then: curl http://localhost:8282/health
#   ->  {"status":"ok","version":"...","warnings":[]}
#   (or, if FFmpeg is missing: {"status":"degraded","version":"...",
#    "warnings":[{"code":"ffmpeg_missing","message":"..."}]})

Configuration

All settings load from environment variables (prefixed COLLAPSARR_) with sensible defaults, and an optional .env file is read from the working directory. See .env.example.

Variable Default Description
COLLAPSARR_DATABASE_PATH /config/collapsarr.db SQLite database file path. Override this on bare-metal installs — the default assumes Docker's /config volume.
COLLAPSARR_DATABASE_URL (derived from path) Full SQLAlchemy URL override.
COLLAPSARR_HOST 0.0.0.0 API server bind address.
COLLAPSARR_PORT 8282 API server bind port.
COLLAPSARR_LOG_LEVEL INFO Log level.

Running on startup

Docker: the restart: unless-stopped line in the Quick start compose file already handles this — Docker restarts the container whenever it stops unexpectedly or the Docker daemon itself restarts. On Linux this happens automatically on boot, since dockerd runs as a systemd service enabled by default (systemctl is-enabled docker to confirm). On Docker Desktop (macOS/Windows), enable Settings → General → Start Docker Desktop when you log in so the daemon — and in turn the container — comes up after a reboot.

Bare-metal / PyPI install: run Collapsarr as a systemd service so it starts on boot and restarts if it crashes. Create /etc/systemd/system/collapsarr.service:

[Unit]
Description=Collapsarr
After=network.target

[Service]
Type=simple
User=collapsarr
Group=collapsarr
WorkingDirectory=/opt/collapsarr
EnvironmentFile=/opt/collapsarr/.env
ExecStart=/opt/collapsarr/.venv/bin/collapsarr
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Adjust User/Group, WorkingDirectory, and the .venv path to match where you installed it; EnvironmentFile should point at an .env containing the COLLAPSARR_* variables from Configuration (see .env.example). Then enable and start it:

sudo systemctl daemon-reload
sudo systemctl enable --now collapsarr

Check status/logs with systemctl status collapsarr and journalctl -u collapsarr -f.

Docs

Fuller docs live on the GitHub Wiki.

License

GPLv3.

Metadata

Release files for collapsarr 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collapsarr 0.1.4
File Size Uploaded
collapsarr-0.1.4.tar.gz 395.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for collapsarr 0.1.4
File Interpreter ABI Platform
collapsarr-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 587.4 kB

Release files / collapsarr-0.1.4.tar.gz

Download URL collapsarr-0.1.4.tar.gz
Size 395.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1485d56c26d491511027945d6623743ee697d76c122fff4508cc0ce09534bbf0
BLAKE2b-256 checksum
How to use checksums
a2d5b212aed8fc0949b3acb80ea1d62b3f23de951f77d127a5073fb3784b4225
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Release files / collapsarr-0.1.4-py3-none-any.whl

Download URL collapsarr-0.1.4-py3-none-any.whl
Size 191.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9913dd302ec04048daf3b9945a77432dee899ff60a3c5f244e75dc8a9d2fbced
BLAKE2b-256 checksum
How to use checksums
696e1e3e2c3a2e18b743c37181cad199228d27144634f2aba3dbd7da0779d527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.4 This release

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page