Skip to content

audio-only pathway optimisation #23

Closed

Description

@DrHurt

What should the engine do?

Use AVPlayer direct playback for all supported audio-only use cases. No HLS needed. Supports both HTTP & local storage files.

AVPlayer already supports most common audio (mp3 & m4a). This includes music & audiobooks.

Very few, niche, use cases would require ffmpeg.

Motivating media or use case

  • energy efficient native hardware pipelines on battery operated devices
  • Apple’s higher quality decoders compared to ffmpeg
  • Apple-exclusive features like reduce loud sounds, enhance dialogue apply via system-wide settings toggle
  • Easier metadata integration with rest of system.

Area

Codec / container support

Host app / integration context

No response

Would you be willing to open a PR?

No

Activity

  1. added
    enhancement
    on Jun 4, 2026
  2. superuser404notfound commented on Jun 4, 2026

    @superuser404notfound
    Owner

    Good call, this is in now.

    I have shipped a native-first hybrid that follows the same approach the video path already uses (native AVPlayer by default, software decode only for the gaps):

    • AVPlayer-decodable audio (AAC/M4A, MP3, ALAC, AC-3/E-AC-3, LPCM, and FLAC) now plays through a lean AVPlayer reading the source URL directly. No HLS, no loopback, no display-criteria handshake, so it gets the hardware-accelerated, energy-efficient pipeline and the native system integration you described.
    • Codecs AVPlayer cannot decode (Opus, Vorbis, APE, WavPack) fall back to the existing FFmpeg path, so coverage stays complete.

    One nice surprise: FLAC did not even need the fallback. AVFoundation has decoded FLAC since iOS/tvOS 11, so it routes to AVPlayer too. Verified end to end against AAC, MP3, and FLAC (native path) and Opus (FFmpeg fallback).

    Routing is a simple codec whitelist, so adding more native codecs later is a one-line change. Thanks for the suggestion.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions