Plex HTPC feedback

This (and others reporting similar in this thread) is due to MPV using dxva2-copy on Windows. For those that don’t know this means that when the hardware has decompressed a video frame, it is copied (hence the name) from the GPU to the CPU. Then to actually display the frame it is then rendered into the frame buffer (which will then go back into the GPU). The reason this is occurring is because the toolchain to build MPV is missing several headers/libraries to use more efficient methods.

As a test I built ANGLE (which is fun for certain definitions of the word) and inserted it into the build toolchain (not the correct solution but sufficient to test) and then rebuilt MPV. This enables MPV to use dxva2-egl which avoids the copying back and forth. Adding support for d3d11egl requires adding shaderc and spirv-cross which is another undertaking.

I’m testing the build with just ANGLE locally and in my limited testing it appears to remove the occasional stuttering that I would see on a 10th gen NUC.

As an aside, sometimes disabling hardware decoding can perform better until the no-copy hardware decoding is available depending on the speed of the CPU. Most H.264 on recent hardware should be decoded fast enough in the CPU.

On Mac MPV is currently using videotoolbox-copy which has similar implications. Fixing this requires some changes in the build infrastructure to build different versions of MPV for different applications so the version built for Desktop/HTPC can target a newer version of MacOS than other applications (which is required to make MPV build with cocoa enabled which is the requirement for non-copy hardware decoding).

3 Likes