Repository navigation
Description
Summary
Problem:
Silo has no hardware-accelerated transcoding on macOS. ResolveHWAccelWithFFmpeg (internal/playback/gpudetect.go) hard-returns "none" on any non-Linux OS, and the ffmpeg argument builder (internal/playback/transcode.go) only implements qsv / vaapi / nvenc. A Mac running Silo natively — including as a standalone transcode node (--mode transcode) — falls back to software x264/x265 even though Apple Silicon's media engine can sustain multiple simultaneous 4K HEVC encodes at a fraction of the power.
Why it matters:
Macs (especially M-series minis) are popular always-on home-server hardware and make excellent transcode workers. VideoToolbox is exposed through stock ffmpeg (-hwaccel videotoolbox, h264_videotoolbox / hevc_videotoolbox — enabled by default in Homebrew/macOS ffmpeg builds), so no native Swift/AppKit component is needed — only Go-side support in the existing pipeline. Note h264_videotoolbox is already listed in the V3 encoder capability list (transformations_v3.go) but is never selectable.
Proposed change:
Add videotoolbox as a first-class hw_accel value:
- Detection (
internal/playback/gpudetect.go): ondarwin, resolveautoby probing the configured ffmpeg for the VideoToolbox encoders plus a short smoke encode, mirroring the existing NVENC probe (result cached, same asnvencProbeCache). Non-darwin behavior unchanged. - Transcode args (
internal/playback/transcode.go):videotoolboxbranches at the existing per-accel switch sites —-hwaccel videotoolboxfor decode,h264_videotoolbox/hevc_videotoolboxencoders with appropriate rate-control flags. First iteration decodes to software frames so the existing software filter graph (scaling, tone-mapping, subtitle handling) applies unchanged; HW decode + HW encode is where nearly all the win is. Full-VT frame path (scale_vt) is a follow-up optimization. - V3 transformations (
internal/playback/transformations_v3.go): make the VideoToolbox encoders reachable in capability/attempt-key resolution. - Config/UI surface:
playback.hw_accelenum gainsvideotoolbox(config validation where applicable, admin Playback settings dropdown inweb/src/pages/admin-settings/PlaybackSettings.tsx, setup wizard). - Chapter thumbnails (
internal/chapterthumbs/extractor.go): optionalvideotoolboxdecode branch; safe to defer.
Known VideoToolbox constraints (design around, not blockers):
- No CRF-style rate control — use bitrate-targeted encoding (matches Silo's existing ladder/bitrate-driven args).
- No AV1 encode (decode only on M3+); AV1 targets keep using software or
copy. - HDR→SDR tone-mapping has no VT-native filter — covered by the software-frame filter path above.
Deployment notes (docs, not code): VideoToolbox requires a native macOS process — Docker on Mac is a Linux VM with no GPU access. Recommended topology: main server anywhere + a native Mac transcode node with the media library mounted at the same paths. The existing node-pool/transcode-node machinery needs no changes (nodes resolve their own hwaccel).
Whether this feels core, plugin-related, or deployment-specific:
Core — it extends the existing internal/playback hardware-acceleration matrix to a third platform, additive-only (new enum value; no API changes beyond the detection endpoint naturally reporting videotoolbox).
AI-use disclosure
Issue drafted by Claude Code with human oversight.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(playback): VideoToolbox hardware transcoding on macOS
feat(playback): VideoToolbox hardware transcoding on macOS
feat(playback): VideoToolbox hardware transcoding on macOS
feat(playback): VideoToolbox hardware transcoding on macOS
feat(playback): VideoToolbox hardware transcoding on macOS
feat(playback): VideoToolbox hardware transcoding on macOS (Silo-Serv…