No support for HEVC hardware decoding in Plex Media Player for Mac?

Server Version#: 1.13.9.5456-ecd600442
Player Version#: 2.22.1.917-2a5a2e01

After getting a Mac mini (2018), I was surprised to find that Plex Media Player for macOS does not seem to support playing videos with hardware decoding of HEVC, although the technically similar feature hardware-accelerated streaming is a promoted Plex Media Server feature. Am I right in this assumption and is support for hardware accelerated HEVC playback coming soon?

Both the PMS and PMP are on the same Mac mini (2018). I have also tried with a MacBook Pro (13-inch, 2017, Two Thunderbolt 3 Ports) as client. The same files do play with hardware decoding in VLC or IINA (which also uses mpv). Fortunately, Plex Media Player can play 4K h.265 videos smoothly on my CPU (3,2 GHz 6-core Intel Core i7), but the CPU load increases to around 300 %. Plex for Kodi freezes when trying to play the files.

Hardware acceleration (modern hardware) is enabled in settings. The debug overlay says “Hardware Decoding no (videotoolbox)”. The logs say:

2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vo/opengl-cb: Assuming 60.000000 FPS for display sync. 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Container reported FPS: 25.000000 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Codec list: 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd:     hevc - HEVC (High Efficiency Video Coding) 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd:     hevc - HEVC (High Efficiency Video Coding) 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Opening video decoder hevc 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Probing 'videotoolbox'... 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Hardware decoder for 'hevc' with the given API not found in libavcodec. 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Probing 'videotoolbox-copy'... 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Hardware decoder for 'hevc' with the given API not found in libavcodec. 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Probing 'cuda'... 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Probing 'cuda-copy'... 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Hardware decoder for 'hevc' with the given API not found in libavcodec. 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Probing 'crystalhd'... 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Hardware decoder for 'hevc' with the given API not found in libavcodec. 
2018-11-16 00:08:08 [ DEBUG ] PlayerComponent.cpp @ 593 - vd: Using software decoding.

I have not found much information on this in the Plex forums. Googling around, I have found old posts from 2016 on mpv’s GitHub mentioning that mpv does not support HEVC hardware decoding on macOS (https://github.com/mpv-player/mpv/issues/3689), but I have found newer posts from early 2018 where it seems support now exists (https://github.com/mpv-player/mpv/issues/5755). You don’t seem to mention on the Plex site what version of mpv is used in PMP and mpv don’t provide clear changelogs, but I found this in the PMP logs, suggesting that PMP uses an old version of mpv which I’m guessing doesn’t support HEVC hardware decoding:

2018-11-16 00:08:03 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer: mpv 53a7eec (C) 2000-2017 mpv/MPlayer/mplayer2 projects 
2018-11-16 00:08:03 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer:  built on Wed Aug 30 05:14:14 PDT 2017

As comparison, IINA’s corresponding logs for trying and succeeding with hardware decoding are:

[   0.220][v][vd] Probing 'videotoolbox'...
[   0.220][v][vd] Trying hardware decoding.
[   0.221][v][vd] Selected video codec: hevc (HEVC (High Efficiency Video Coding))

And the mpv version they’re using is slightly newer:

[   0.013][v][cplayer] mpv 0.27.0 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
[   0.013][v][cplayer]  built on Thu Oct 19 18:59:20 HKT 2017

I should also mention that IINA suffers from graphical bugs while playing, which VLC doesn’t.

Is there any progress on this? I have exactly the same issue with the current player:

2018-12-18 23:15:26 [ INFO  ] Log.cpp @ 115 - Starting Plex Media Player version: 2.24.0.924-63fcaa8e build date: 2018-12-11 
2018-12-18 23:15:26 [ INFO  ] Log.cpp @ 116 -   Running on: macOS High Sierra (10.13) [17.7.0] arch x86_64 
2018-12-18 23:15:26 [ INFO  ] Log.cpp @ 117 -   Qt Version: 5.9.5 [x86_64-little_endian-lp64]

mpv seems old:

2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer: mpv 53a7eec (C) 2000-2017 mpv/MPlayer/mplayer2 projects 
2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer:  built on Wed Aug 30 05:14:14 PDT 2017 
2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer: ffmpeg library versions: 
2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer:    libavutil       55.62.100 
2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer:    libavcodec      57.92.100 
2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer:    libavformat     57.72.100 
2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer:    libswscale      4.7.100 
2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer:    libavfilter     6.84.101 
2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer:    libswresample   2.8.100 
2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer: ffmpeg version: git-2017-06-28-97a6171-,97a6171-pmp-260 
2018-12-18 23:15:26 [ DEBUG ] PlayerComponent.cpp @ 593 - cplayer:

from support article Using Hardware Accelerated Streaming:

Tip! : Hardware-accelerated streaming is a premium feature and requires an active Plex Pass subscription.

We are talking about the player here. Not the server.

Hi,
I also have the same problem.
Mac mini 2018, direct play, PMS and PMP on the same mac. No transcoding.
no hw decoding, according to the overlay info.

Same issue here on a 2018 MacBook Pro 15" with i9-8950HK and Radeon Pro Vega 20 on macOS 10.14.2.

Plex Media Player 2.24.0.924-63fcaa8e only uses videotoolbox for h.264, but not HEVC.

When playing the same video files with mpv 0.29.1 installed via homebrew with hwdec=videotoolbox the videotoolbox decoder is also used for HEVC.

Btw. it is definitely related to an outdated mpv library.

I got it working by installing the latest mpv using homebrew and then replacing the libmpv library in Plex Media Player:

brew install mpv
cd "/Applications/Plex Media Player.app/Contents/Frameworks"
mv libmpv.1.dylib libmpv.1.dylib.bak
ln -s /usr/local/opt/mpv/lib/libmpv.1.dylib

After that playing 4K HDR HEVC shows “Hardware Decoding: videotoolbox (videotoolbox)” in the debug overlay and CPU usage is much much lower (~340% to 35%).

This hack will probably be reverted if an update is released, so I disabled automatic updates in PMP.

3 Likes

So I am far less sophisticated than y’all, but I think I’m having the same issue. HEVC HDR files stutter badly on my MacOS app, but worked fine via VLC and IINA (although the image quality and colors look better on the Plex app).

I guess this begs the question: is there anyone out there able to get these files to play smoothly on the Plex MacOS app? If not, this seems like a pretty big, but fixable bug, that should be reported to Plex.

Same here on a MacBook Air 2018 with Intel UHD 617. 4K HDR HEVC files stutter like hell!
VLC has no problems


Hi,
Can we get a response?
Is hw decoding supported for hevc under macos?

Tnx

Can confirm, this works like a charm. Thank you!

Has the latest Plex Media Player for Mac been updated with this new libmpv library?

I am getting mad stuttering direct playing 4k content on the player in Mac.

After doing this I get an error trying to launch Plex Media Player

“Plex Media Player cannot be opened because of a problem”

No, it’s still an old version based on commit 53a7eec of mpv from 2017-08-24.

Just tried with Plex Media Player 2.34.0.983 and mpv 0.29.1_3 in macOS 10.14.5 and it still works fine.

One thing that’s important is that you open and close the Plex Media Player.app once after downloading before you create the symlink or macOS will complain that the app is damaged and will refuse to start it.

Here’s a screenshot that shows it working:

I can confirm that this fixes it. After symlinking the new libmpv library provided by homebrew I no longer have any problems with lagging video. The video also appears to be converting the HDR to SDR via tonemapping properly.

Transcoding 4k to 1080p loses the HDR to SDR tonemapping (it looks washed out and there are crazy artifacts) but I think that’s expected.

Are the developers aware of this? @pcalves

@tom80H Any updates here? Seems like updating the libmpv library shouldn’t be too hard.

Well, it’s not that hard but it does, unfortunately, make other features like de-interlacing unusable due to changes in mpv. :frowning:

(A discussion about a new implementation of mpv and a newer mpv version)

1 Like

Hello, I had this fix working on my 2019 Macbook Air and was able to play high bitrate HEVC 4K movies smoothly, the app updated, and when I try to apply this fix again and run the app I get the error:

Library not loaded: @rpath/libmpv.1.dylib
Referenced from: /Applications/Plex.app/Contents/MacOS/Plex
Reason: no suitable image found. Did find:
/Applications/Plex.app/Contents/MacOS/
/Frameworks/libmpv.1.dylib: code signature in (/Applications/Plex.app/Contents/MacOS/
/Frameworks/libmpv.1.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

if you could please offer any assistance I would be very grateful. Thanks!

[Plex.app] is the name of an application called Plex for Mac.
[Plex Media Player.app] is the name of an application called Plex Media Player.
You are posting in a thread about Plex Media Player,
but you are giving us an error message about Plex for Mac.

Do not use this libmpv adjustment on Plex for Mac.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.