Skip to content

[v1] feat(playback): VideoToolbox hardware transcoding on macOS #438

Closed

Description

@Quick104

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:

  1. Detection (internal/playback/gpudetect.go): on darwin, resolve auto by probing the configured ffmpeg for the VideoToolbox encoders plus a short smoke encode, mirroring the existing NVENC probe (result cached, same as nvencProbeCache). Non-darwin behavior unchanged.
  2. Transcode args (internal/playback/transcode.go): videotoolbox branches at the existing per-accel switch sites — -hwaccel videotoolbox for decode, h264_videotoolbox / hevc_videotoolbox encoders 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.
  3. V3 transformations (internal/playback/transformations_v3.go): make the VideoToolbox encoders reachable in capability/attempt-key resolution.
  4. Config/UI surface: playback.hw_accel enum gains videotoolbox (config validation where applicable, admin Playback settings dropdown in web/src/pages/admin-settings/PlaybackSettings.tsx, setup wizard).
  5. Chapter thumbnails (internal/chapterthumbs/extractor.go): optional videotoolbox decode 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.

Activity

  1. added
    v1.0-proposed
    on Jul 20, 2026
  2. added 2 commits that reference this issue on Aug 10, 2026
    a0600cd
    f701702
  3. added 3 commits that reference this issue on Aug 20, 2026
    2763a89
    8b8b6c2
    4bc9d68
  4. added a commit that references this issue on Aug 27, 2026
    f3da0f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    v1.0-proposed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions