transcode manager now handles multiple media servers

This commit is contained in:
2026-04-20 18:17:13 -04:00
parent e83473ab8e
commit 1a16ca02a9
5 changed files with 255 additions and 69 deletions
+47 -2
View File
@@ -223,13 +223,58 @@ TRANSCODE_CHMOD="755"
TRANSCODE_MANAGER_MODE="smart" # smart | ramdisk | ssd
TRANSCODE_CHECK_EMBY=true
TRANSCODE_EMBY_CONTAINER="Emby"
TRANSCODE_CHECK_EMBY=true # skips threshold checks when no servers active
TRANSCODE_DAILY_LOG="/boot/config/transcode_daily.db"
TRANSCODE_LOG_RETENTION=90
```
### Multi-Server Configuration — `TRANSCODE_SERVERS`
The transcode manager supports any number of media servers sharing the same ramdisk scratch space. One server or ten — the same script handles it. The threshold decision is based on total ramdisk usage across all servers combined.
```bash
TRANSCODE_SERVERS=(
"Emby|http://localhost:8096|your-api-key|emby"
# "Emby-Jayred365|http://HOST2-IP:8096|his-api-key|emby" # temporarily cover his Emby
# "Jellyfin|http://localhost:8097|jellyfin-api-key|jellyfin" # test Jellyfin instance
# "Plex|http://localhost:32400|plex-token|plex" # Plex if needed
)
```
**Format:** `"ContainerName|URL|APIKey|Type"`
| Field | Description |
|-------|-------------|
| `ContainerName` | Exact Docker container name — used for running check |
| `URL` | API base URL including port |
| `APIKey` | Server API key or token |
| `Type` | `emby` \| `jellyfin` \| `plex` — controls API endpoint format |
**How it works with multiple servers:**
Each media server writes its transcode sessions to its own subfolder inside `transcoding-temp`:
```
/mnt/ram-transcode/transcoding-temp/
E0D8DC/ ← Emby session (Live TV segment files)
abc123/ ← Jellyfin session
xyz789/ ← his Emby session
```
They never touch each other's files. The ramdisk is shared scratch space — each server is unaware of the others. The manager aggregates session counts from all servers and makes one threshold decision based on total ramdisk usage.
**Each server container needs the shared propagation mount in Extra Parameters:**
```
--mount type=bind,source=/mnt/ram-transcode,target=/ext-ram-transcode,bind-propagation=shared
```
Set the transcode path in each server's settings to `/ext-ram-transcode` (or whatever target path you use).
**Entries with placeholder API key values are skipped automatically** — comment out entries that aren't in use rather than removing them. The placeholders make it clear what's available to enable.
**⚠️ Tdarr does NOT belong in this array.** Tdarr encodes full files — large working files would fill the ramdisk rapidly and cause constant flips. Keep Tdarr on SSD. A dedicated `tdarr_cleanup.sh` handles Tdarr orphan management separately.
### Sizing the Ramdisk
`tmpfs` only uses RAM actually needed — `RAMDISK_SIZE` is a ceiling, not a reservation.