I installed Ubuntu 16.04 and I have an NVIDIA GTX 1070 OC. I added this PPA:
ppa:graphics-drivers/ppa
And I installed the nvidia-370 package for my GTX 1070 OC. Then I played a 4K video file with HEVC Codec and excepted for hardware acceleration to be enabled to hardware decoding HEVC codec, but mpv player was using the software decoding mod. How can i fix this issue?
Best Answer
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.
0. Check HEVC profile support
Edit: NVIDIA VDPAU driver now supports HEVC Main 10 profile on Linux since version 450.51+
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 profiles support: Switch to the NVIDIA proprietary drivers (see below) and run:
1. Switch to NVIDIA proprietary drivers
You need at least version R367 (
nvidia-367
).Go to
Additional drivers
tab, checkNVIDIA binary driver
andApply
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 chooseVDPAU 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:
That's clearly a misleading and buggy error. Hard to tell, but
1211250229
does meanAV_CODEC_ID_HEVC
(can be checked by compiling withrustc
this rusty code). And we've seen fromvdpauinfo
that HEVC profile1
(=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:
4. Temporarily disable VLC FFmpeg multithreading
As this is not enough, you may now face this issue:
Explainations on this thread at VLC forum:
On the same thread, there's a workaround: In VLC > Tools > Preferences (All) > Input / Codecs > Video codecs > FFmpeg, change the value of
Threads
from0
(auto) to1
.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.