Disclaimer: Sorry but it's an answer for VLC, not mpv player. I believe there are bugs or lack of support in mpv player because in my setup, while VLC is working fine with low CPU, mpv player doesn't. You may face the FFmpeg multithreading issue (see point 4).
I've really struggled to get this working, and I'm a bit disapointed of the limited NVIDIA GTX 10*0 (Pascal) HEVC support compared to AMD.
First of all:
Warning: NVIDIA only supports HEVC Main profile on Linux
At the time of writing, NVIDIA driver 367.57 only supports HEVC profile Main, NOT Main 10 and others. See: Feature request on NVIDIA forum. That's a NVIDIA Linux driver limitation, the hardware (GTX10*0) technically supports it (MPC-HC on Windows reads Main 10 easily).
Note that most 4K movies encoded with HEVC now use the HEVC Main 10 profile.
Check media file HEVC profile: You can check your file HEVC profile by right-clicking on your file > Properties > Audio/Video tab > Video > Codec.
Check driver HEVC profile support: Switch to the NVIDIA proprietary drivers (see below) and run:
$ vdpauinfo
Information string: NVIDIA VDPAU Driver Shared Library 367.57 [crop]
Decoder capabilities:
name level macbs width height
----------------------------------------------------
[crop]
HEVC_MAIN 153 262144 8192 8192
HEVC_MAIN_10 --- not supported ---
HEVC_MAIN_STILL --- not supported ---
HEVC_MAIN_12 --- not supported ---
HEVC_MAIN_444 --- not supported ---
1. Switch to NVIDIA proprietary drivers
You need at least version R367 (nvidia-367).
software-properties-gtk &
Go to Additional drivers tab, check NVIDIA binary driver and Apply the changes.
2. Enable hardware acceleration in VLC
Of course, you must enable hardware acceleration in VLC > Tools > Preferences (Simple) > Input / Codecs > Hardware-acceleration decoding = Auto. For NVIDIA, you can choose VDPAU video decoder explicitely.
3. Update VLC to 2.2.4 or 3.0
There are several bugs in VLC 2.2.2 (Ubuntu 16.04), fixed in later versions (see: changelog), that lead to this misleading error:
$ vlc --version
VLC media player 2.2.2 Weatherwax
$ vlc <file>
[crop]
[00007fa4b42cc5d8] vdpau_avcodec generic error: unsupported codec 1211250229 or profile 1
That's clearly a misleading and buggy error. Hard to tell, but 1211250229 does mean AV_CODEC_ID_HEVC (can be checked by compiling with rustc this rusty code). And we've seen from vdpauinfo that HEVC profile 1 (= Main) is supported.
At this time, VLC 2.2.4 is not available from the official VLC PPA (check stable version here). So upgrade to VLC 3.0 from the master branch (check master version here) but keep in mind it's a nightly release:
$ sudo add-apt-repository ppa:videolan/master-daily
$ sudo apt update
$ sudo apt install vlc
$ vlc --version
[crop]
VLC version 3.0.0-git Vetinari
4. Temporarily disable VLC FFmpeg multithreading
As this is not enough, you may now face this issue:
$ vlc <file> --verbose
[crop]
[00007f6bc4ccc688] avcodec decoder warning: thread type 1: disabling hardware acceleration
Explainations on this thread at VLC forum:
It means you're using FFmpeg, which no longer allows enabling hardware
acceleration and threading at the same time. You need to use libav
[but] this is decided while compiling VLC. You can't change it at
run-time.
On the same thread, there's a workaround: In VLC > Tools > Preferences (All) > Input / Codecs > Video codecs > FFmpeg, change the value of Threads from 0 (auto) to 1.
And you're done!
But that's a manual workaround: keep in mind that to watch videos not GPU-accelerated, you should reset the VLC FFmpeg Threads setting to use all your CPU cores... or compile VLC from source with libav.
vdpauinfo(- will list supported ) If good run mpv with--hwdec=vdpau --vo=vdpauoptions, see if it uses hw decoding. – doug Oct 9 '16 at 23:09