unarr/internal/cmd
Deivid Soto 2fc7ce1de0
Some checks failed
CI / Test (push) Failing after 11s
CI / Build (push) Failing after 2s
CI / Build-1 (push) Failing after 2s
CI / Build-2 (push) Failing after 2s
CI / Build-3 (push) Failing after 1s
CI / Build-4 (push) Failing after 1s
CI / Build-5 (push) Failing after 2s
CI / Lint (push) Failing after 2s
CI / Coverage (push) Failing after 2s
CI / Vet (push) Failing after 2s
Release / release (push) Failing after 2s
Release / docker (push) Has been skipped
feat(vaapi): hybrid CPU-scale + hwupload encode path (QW2, 0.9.14)
Closes QW2. Validated against the dev box's AMD Raphael iGPU
(/dev/dri/renderD128, radeonsi/mesa 25.2.8). The "proper" full-GPU
path via scale_vaapi triggers a known mesa 25 + Raphael bug
("Cannot allocate memory" per session start, encode still succeeds
but logs are spammy) — hybrid CPU scale → format=nv12 → hwupload
→ h264_vaapi encode delivers GPU surfaces to the encoder without
poking the broken scaler.

Three concrete changes in buildHLSFFmpegArgsAt:
  1. New `case "h264_vaapi"` adds `-vaapi_device /dev/dri/renderD128`.
     Multi-GPU hosts (this dev box has NVIDIA on renderD129 + AMD on
     renderD128) need it so the encoder doesn't bind to a non-VAAPI
     render node — without it the encoder fell back to NULL device
     in manual smoke testing.
  2. Filter chain branches on codec: VAAPI uses
     `scale=…,format=nv12,hwupload` while libx264 / NVENC / QSV
     keep the existing `scale=…,format=yuv420p,setparams=…` shape.
     The setparams color metadata block is dropped on VAAPI because
     VAAPI surfaces don't expose VUI fields and the encoder writes
     its own.
  3. Two new unit tests lock the argv shape so a future refactor
     doesn't accidentally merge the paths back together:
     TestBuildHLSFFmpegArgsVAAPI asserts the new flags + the
     ABSENCE of scale_vaapi; TestBuildHLSFFmpegArgsLibx264NoRegression
     verifies the software path keeps yuv420p + setparams + has
     none of the VAAPI extras.

Manual ffmpeg validation on the dev box:
  hybrid encode of 5 s 4K → 720p: 0.66 s wall, 472 % CPU, 268 KB
  output — no errors logged. scale_vaapi variant in comparison
  spammed "Cannot allocate memory" while emitting valid output.
2026-05-27 15:45:55 +02:00
..
agent_client.go feat(agent): add mirror failover, agent client refactor, status 401 detection 2026-05-15 16:26:43 +02:00
auth_browser.go feat(init): add 60s countdown, skip key, and cancel detection to browser auth 2026-03-30 14:07:57 +02:00
auth_browser_test.go feat(auth): browser-based CLI authentication (like Claude Code) 2026-03-29 17:53:18 +02:00
clean.go fix(lint): use default:none to disable errcheck, fix all gofmt and exhaustive 2026-03-31 00:29:16 +02:00
clean_test.go fix(lint): use default:none to disable errcheck, fix all gofmt and exhaustive 2026-03-31 00:29:16 +02:00
completion.go docs: improve CLI help, shell completion, and README 2026-03-28 21:36:27 +01:00
completion_helpers.go docs: improve CLI help, shell completion, and README 2026-03-28 21:36:27 +01:00
config_menu.go feat(library): add server-driven file deletion with allow_delete config 2026-04-10 16:35:12 +02:00
config_menu_test.go feat(cli): upgrade command, rich status, and version cache 2026-03-31 22:05:43 +02:00
daemon.go fix(daemon): defensive IsClosed check in watchSessionReady poll loop 2026-05-27 15:19:51 +02:00
daemon_control.go feat(daemon): enhance service management with start, stop, restart, and status commands for Windows 2026-04-10 19:18:13 +02:00
daemon_install.go feat(daemon): enhance service management with start, stop, restart, and status commands for Windows 2026-04-10 19:18:13 +02:00
daemon_test.go test: add comprehensive test suite for engine, agent and cmd packages 2026-04-08 23:36:00 +02:00
doctor.go chore: rename module from torrentclaw-cli to unarr 2026-03-30 13:06:07 +02:00
doctor_unix.go docs: improve CLI help, shell completion, and README 2026-03-28 21:36:27 +01:00
doctor_windows.go docs: improve CLI help, shell completion, and README 2026-03-28 21:36:27 +01:00
download.go feat(stream)!: retire WebRTC, HLS-only, bump 0.9.4 2026-05-26 18:04:35 +02:00
download_test.go test: add comprehensive test suite for engine, agent and cmd packages 2026-04-08 23:36:00 +02:00
funnel.go feat(funnel): cloudflare quick tunnel embedded subprocess (0.9.5) 2026-05-26 20:39:57 +02:00
helpers.go fix(security): CORS allowlist, URL scheme guard, state perms, ZIP slip, mirror docs 2026-05-15 18:48:59 +02:00
helpers_test.go fix(security): CORS allowlist, URL scheme guard, state perms, ZIP slip, mirror docs 2026-05-15 18:48:59 +02:00
init.go feat(cli): add login command and refactor shared helpers 2026-04-01 12:20:51 +02:00
inspect.go chore: rename module from torrentclaw-cli to unarr 2026-03-30 13:06:07 +02:00
login.go feat(cli): add login command and refactor shared helpers 2026-04-01 12:20:51 +02:00
migrate.go chore: rename module from torrentclaw-cli to unarr 2026-03-30 13:06:07 +02:00
mirrors.go feat(agent): add mirror failover, agent client refactor, status 401 detection 2026-05-15 16:26:43 +02:00
player_session_registry.go feat(stream)!: retire WebRTC, HLS-only, bump 0.9.4 2026-05-26 18:04:35 +02:00
popular.go chore: rename module from torrentclaw-cli to unarr 2026-03-30 13:06:07 +02:00
probe_hwaccel.go feat(stream)!: retire WebRTC, HLS-only, bump 0.9.4 2026-05-26 18:04:35 +02:00
recent.go chore: rename module from torrentclaw-cli to unarr 2026-03-30 13:06:07 +02:00
reload_unix.go feat(daemon): enhance service management with start, stop, restart, and status commands for Windows 2026-04-10 19:18:13 +02:00
reload_windows.go feat(daemon): enhance service management with start, stop, restart, and status commands for Windows 2026-04-10 19:18:13 +02:00
root.go feat(funnel): cloudflare quick tunnel embedded subprocess (0.9.5) 2026-05-26 20:39:57 +02:00
scan.go fix(library): classify resolution by width + height, not height alone 2026-05-27 11:54:29 +02:00
search.go chore: rename module from torrentclaw-cli to unarr 2026-03-30 13:06:07 +02:00
self_update.go fix(security): UPnP opt-in, bounded SSE reader, signed self-update 2026-05-15 17:29:22 +02:00
stats.go chore: rename module from torrentclaw-cli to unarr 2026-03-30 13:06:07 +02:00
status.go feat(agent): add mirror failover, agent client refactor, status 401 detection 2026-05-15 16:26:43 +02:00
stream.go test: add comprehensive test suite for engine, agent and cmd packages 2026-04-08 23:36:00 +02:00
stream_handler.go fix(stream): fix black screen on remote/Tailscale streaming 2026-04-09 16:15:41 +02:00
stream_test.go test: add comprehensive test suite for engine, agent and cmd packages 2026-04-08 23:36:00 +02:00
upgrade.go fix(security): UPnP opt-in, bounded SSE reader, signed self-update 2026-05-15 17:29:22 +02:00
version.go feat(vaapi): hybrid CPU-scale + hwupload encode path (QW2, 0.9.14) 2026-05-27 15:45:55 +02:00
version_cmd.go docs: improve CLI help, shell completion, and README 2026-03-28 21:36:27 +01:00
vpn.go feat(vpn): unarr vpn command + report/arbitrate the WireGuard slot 2026-05-22 08:33:02 +02:00
watch.go chore: rename module from torrentclaw-cli to unarr 2026-03-30 13:06:07 +02:00