Plex App on Mac stutters

I’m still seeing persistent heavy stuttering with the Plex macOS app on my Intel Big Sur system and wanted to share some additional context and comparison with a locally-built mpv setup.


Environment

  • Mac: Intel, macOS 11.7.10 Big Sur

  • Plex Client versions tested:

    • 1.104.0.241-2164c90aplayback is smooth, no stutter
    • 1.112.0.359-0d79a49f and other newer builds → strong periodic stutter
  • Plex Media Server:

    • Running on the same Intel Big Sur Mac
    • Media stored on a Synology DS1821+ NAS via iSCSI (NAS is just storage)
  • Content: Mostly H.264/H.265 MKVs over wired LAN


Plex symptoms

On this Mac, with newer Plex client builds:

  • Video + audio cut out briefly about once per second, continuously during playback.

  • This happens regardless of:

    • Direct Play vs Direct Stream
    • Hardware decoding on or off
    • Different titles / resolutions / codecs

The older client 1.104.0.241-2164c90a on the same system does not show this behaviour — playback is smooth there. So the regression seems tied to newer Plex for Mac builds rather than OS/hardware.

I’ve already tried the usual:

  • Quit PMS + Plex app
  • Cleared Plex client/server caches and codec folders
  • Let Plex redownload codecs and rebuild indexes

Stutter persists on newer clients after a clean reset.


Upstream mpv 0.40.0 on the same machine

On the same Big Sur Mac, I built mpv 0.40.0 from source via Homebrew (with ffmpeg 8, libplacebo, Vulkan, etc.). After some build/toolchain fixes, mpv itself plays smoothly with this core config:

# ~/.config/mpv/mpv.conf (core bits)

vo=gpu
profile=high-quality

hwdec=videotoolbox-copy
hwdec-codecs=all

ao=coreaudio

cache=yes
demuxer-max-bytes=200MiB
demuxer-max-back-bytes=50MiB
demuxer-readahead-secs=5.0

osc=yes
keep-open=yes

So on identical hardware/OS and a very similar codec stack, upstream mpv is fine while newer Plex clients stutter.


What I had to fix to get mpv to build/run on Big Sur

This might be relevant to how Plex’s mpv-based player is built and bundled for older macOS (Intel Big Sur).

1. Toolchain: Homebrew LLVM + libc++ availability

  • Needed to build with Homebrew llvm instead of Apple clang.

  • Added flags equivalent to:

    CFLAGS   += -D_LIBCPP_DISABLE_AVAILABILITY
    CXXFLAGS += -D_LIBCPP_DISABLE_AVAILABILITY
    LDFLAGS  += -L$(brew --prefix llvm)/lib/c++ -Wl,-rpath,$(brew --prefix llvm)/lib/c++
    
  • Without this, newer C++ features pulled in by things like libplacebo/ffmpeg hit availability issues with Big Sur’s system libc++.

2. Swift / Cocoa frontend: missing NSLock.withLock

  • mpv’s macOS frontend uses NSLock.withLock { ... }, which isn’t available on my Swift/Foundation combo (Big Sur + Xcode 13).

  • I had to patch osdep/mac/swift_extensions.swift to add a compatibility shim:

    #if compiler(<5.7)
    import Foundation
    
    extension NSLock {
        func withLock<R>(_ body: () throws -> R) rethrows -> R {
            self.lock()
            defer { self.unlock() }
            return try body()
        }
    }
    #endif
    
  • Without this, the Swift part of mpv won’t compile on my machine.

3. libplacebo + Vulkan registry path

  • libplacebo’s Meson config expected vk.xml in a versioned Cellar path that didn’t exist.

  • I had to point it explicitly to the global registry that actually exists on my system, e.g.:

    /usr/local/share/vulkan/registry/vk.xml
    
  • Otherwise src/vulkan/utils_gen.py would fail and the build stopped.

4. Bundling ICU + OpenSSL (keg-only Homebrew libs)

  • I’m using Homebrew icu4c@78 and openssl@3, both keg-only.

  • When building a self-contained mpv.app with TOOLS/osxbundle.py, dylib_unhell.py initially failed to resolve things like:

    • libicudata.78.dylib
    • /usr/local/Cellar/openssl@3/…/libcrypto.3.dylib
  • I patched resolve_lib_path in TOOLS/dylib_unhell.py so that, if the normal logic fails, it also tries:

    • #{Formula["icu4c@78"].opt_lib}/<basename>
    • #{Formula["openssl@3"].opt_lib}/<basename>
    • /usr/local/lib/<basename>
  • After this, osxbundle.py successfully collected all dependencies and produced a working, self-contained mpv.app on Big Sur.

5. Codesigning

  • To keep macOS happy, I ad-hoc signed:

    • /usr/local/bin/mpv
    • libmpv*.dylib
    • The final mpv.app (codesign --deep)

Result: mpv 0.40.0 + libplacebo + ffmpeg 8 + Vulkan plays smoothly on Big Sur, same machine where newer Plex Mac clients stutter.


Extra toolchain context (mpv + Vapoursynth)

Because my Mac setup is a bit unusual/older, I also went out of my way to prove that a modern mpv stack (including Vapoursynth) can run smoothly here:

  • Built Vapoursynth R72 from source via Homebrew using ENV.llvm_clang and -D_LIBCPP_DISABLE_AVAILABILITY so that C++17 features (like std::to_chars) work cleanly on Big Sur with Homebrew’s llvm/libc++.
  • Built libplacebo and mpv 0.40.0 against the same toolchain (Homebrew llvm, ffmpeg 8, vulkan-loader, molten-vk, icu4c@78, openssl@3, etc.).
  • Had to apply the small Swift compatibility shim for NSLock.withLock in mpv’s osdep/mac/swift_extensions.swift to make the macOS frontend build on this older Swift/Xcode combo.
  • mpv is now running very smoothly on this machine (no stuttering, no constant A/V dropouts) with GPU output (vo=gpu + libplacebo, Videotoolbox decode) and my current mpv.conf.

In other words: on the exact same hardware and OS, a current mpv + Vapoursynth + libplacebo pipeline is stable and smooth. The only place I consistently see the 1-second stutter/dropout behaviour is inside the Plex macOS client.


Why I think this matters for Plex

Obviously I don’t know Plex’s exact build system, but given:

  • A modern mpv stack can be made to work reliably on Big Sur with a bit of toolchain and dependency care, and

  • Newer Plex Mac clients stutter badly on the same OS/hardware where:

    • Old Plex client 1.104.0.241 works fine
    • Upstream mpv 0.40.0 works fine

…I suspect something around:

  • How the mpv/libplacebo/ffmpeg stack is built for Intel Big Sur, and/or
  • How Swift/Cocoa + dynamic libraries (ICU, OpenSSL, etc.) are bundled and resolved at runtime inside the Plex app,

might be causing timing / playback issues that show up as 1-second periodic stutter instead of clean crashes.


Happy to help test

If it’s useful, I can:

  • Provide more logs from Plex for Mac while the stutter happens
  • Test experimental / debug builds targeted at Intel Big Sur
  • Share the exact Homebrew/mpv/Vapoursynth patches I’m using