mpv / mplayer with Radeon / AMD GPU Video Card Driver enable VDPAU GPU Accelerated Video Decoding

The easiest way to know if your videos are playing with GPU acceleration are to watch the process of xplayer, mpv or whatever you are playing.  The CPU usage should be no more than 10% for that process/program if it is using acceleration.

Let's manually play with vdpau to make sure it works before we make it permanent:

First make sure you have libvdpau installed:

sudo apt install vdpau-driver-all

If you run mpv and get an error like this it means you are missing libvdpau:

Playing: MVI_0822.MP4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=eng (*) (aac)
Failed to open VDPAU backend libvdpau_radeonsi.so: cannot open shared object file: No such file or directory
[vo/vdpau] Error when calling vdp_device_create_x11: 1
Error opening/initializing the selected video_out (-vo) device.
Video: no video
AO: [pulse] 48000Hz stereo 2ch float
A: 00:00:08 / 00:01:17 (11%)


 

To enable AMD VDPAU acceleration in mpv (the successor to mplayer) just add this file to make it permanent:

After making changes to the conf below if you open a video with mpv and only hear sound it means there is an issue with your config.  To see any error you can just manually run "mpv video.mp4"

vi ~/.config/mpv/mpv.conf

hwdec=vdpau
vo=vdpau                   # OR vo=vdpau

 

#you can also add this to the config file which may produce better quality/looking playback above but be warned it does not seem to work for some older cards like Kabini 8400:

profile=gpu-hq

vdpauinfo is a great way to see what is supported by your GPU acceleration:

sudo apt install vdpauinfo

 

vdpauinfo
display: :0   screen: 0
API version: 1
Information string: G3DVL VDPAU Driver Shared Library version 1.0

Video surface:

name   width height types
-------------------------------------------
420    16384 16384  NV12 YV12
422    16384 16384  UYVY YUYV
444    16384 16384  Y8U8V8A8 V8U8Y8A8

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                          --- not supported ---
MPEG2_SIMPLE                    3  9216  2048  1152
MPEG2_MAIN                      3  9216  2048  1152
H264_BASELINE                  41  9216  2048  1152
H264_MAIN                      41  9216  2048  1152
H264_HIGH                      41  9216  2048  1152
VC1_SIMPLE                      1  9216  2048  1152
VC1_MAIN                        2  9216  2048  1152
VC1_ADVANCED                    4  9216  2048  1152
MPEG4_PART2_SP                  3  9216  2048  1152
MPEG4_PART2_ASP                 5  9216  2048  1152
DIVX4_QMOBILE                  --- not supported ---
DIVX4_MOBILE                   --- not supported ---
DIVX4_HOME_THEATER             --- not supported ---
DIVX4_HD_1080P                 --- not supported ---
DIVX5_QMOBILE                  --- not supported ---
DIVX5_MOBILE                   --- not supported ---
DIVX5_HOME_THEATER             --- not supported ---
DIVX5_HD_1080P                 --- not supported ---
H264_CONSTRAINED_BASELINE       0  9216  2048  1152
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          --- not supported ---
H264_HIGH_444_PREDICTIVE       --- not supported ---
HEVC_MAIN                      --- not supported ---
HEVC_MAIN_10                   --- not supported ---
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8         16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A8I8 I8A8
R8G8B8A8         16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A8I8 I8A8
R10G10B10A2      16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A8I8 I8A8
B10G10R10A2      16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A8I8 I8A8

Bitmap surface:

name              width height
------------------------------
B8G8R8A8         16384 16384
R8G8B8A8         16384 16384
R10G10B10A2      16384 16384
B10G10R10A2      16384 16384
A8               16384 16384

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL             y
DEINTERLACE_TEMPORAL_SPATIAL     -
INVERSE_TELECINE                 -
NOISE_REDUCTION                  y
SHARPNESS                        y
LUMA_KEY                         y
HIGH QUALITY SCALING - L1        y
HIGH QUALITY SCALING - L2        -
HIGH QUALITY SCALING - L3        -
HIGH QUALITY SCALING - L4        -
HIGH QUALITY SCALING - L5        -
HIGH QUALITY SCALING - L6        -
HIGH QUALITY SCALING - L7        -
HIGH QUALITY SCALING - L8        -
HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              y        48     2048
VIDEO_SURFACE_HEIGHT             y        48     1152
CHROMA_TYPE                      y 
LAYERS                           y         0        4

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                 y 
CSC_MATRIX                       y 
NOISE_REDUCTION_LEVEL            y      0.00     1.00
SHARPNESS_LEVEL                  y     -1.00     1.00
LUMA_KEY_MIN_LUMA                y 
LUMA_KEY_MAX_LUMA                y 

Useful resources:

https://ultra-technology.org/software_settings/mpv-nvidia-driver-with-high-quality/


Tags:

mpv, mplayer, radeon, amd, gpu, enable, vdpau, accelerated, decodingthe, easiest, videos, acceleration, xplayer, cpu, usage, manually, libvdpau, installed, sudo, apt, install, mvi_, mp, vid, audio, alang, eng, aac, backend, libvdpau_radeonsi, directory, vo, vdp_device_create_x, initializing, selected, video_out, ao, hz, stereo, ch, float, successor, conf, config, quot, vi, hwdec, playback, kabini, hq, vdpauinfo, supported, display, api, dvl, width, height, nv, yv, uyvy, yuyv, decoder, capabilities, macbs, mpeg, _simple, _main, _baseline, _high, vc, _advanced, _part, _sp, _asp, divx, _qmobile, _mobile, _home_theater, _hd_, _constrained_baseline, _extended, _progressive_high, _constrained_high, _high_, _predictive, hevc_main, hevc_main_, hevc_main_still, output, nat, bitmap, mixer, feature, sup, deinterlace_temporal, deinterlace_temporal_spatial, inverse_telecine, noise_reduction, sharpness, luma_key, scaling, parameter, min, video_surface_width, video_surface_height, chroma_type, layers, attribute, background_color, csc_matrix, noise_reduction_level, sharpness_level, luma_key_min_luma, luma_key_max_luma,

Latest Articles

  • how to use ifplugd in Linux to execute a command or script when a NIC cable is unplugged or plugged in
  • dd how to backup and restore disk images including compression with gzip
  • mpv / mplayer with Radeon / AMD GPU Video Card Driver enable VDPAU GPU Accelerated Video Decoding
  • Wordpress Reset Blog User Password from MySQL Using Linux Bash and not PHPMyadmin
  • Ubuntu Linux Mint Debian xorg performance and tear-free tuning for AMD Radeon Based Cards
  • Centos 7 Stopped and Disabled Firewalld and ports still blocked
  • MariaDB / MySQL Reset Root Forgotten Password on Centos 7
  • Centos 7 How to install Mysql/Mariadb
  • PHP 7.2, Apache and Centos 7 How To Install
  • Ubuntu Debian Linux Mint r8169 r8168 Network Driver Problem and Solution
  • Linux 3D Performance benchmarks with glxgears 59-60fps solution
  • How To Install Asterisk 16 17 on Debian Ubuntu Linux
  • Linux Ubuntu Debian Centos How To Make a Bootable Windows 7, 8, 10, 2016, 2019 Server USB from ISO
  • How To Restore Windows MBR Bootsector from Linux using syslinux
  • Linux Ubuntu Cannot Print Large Images
  • Cannot Print PDF Solution and Howto Resize
  • Linux Console Login Screen TTY Change Message
  • Apache Cannot Start Listening Already on 0.0.0.0
  • MySQL Bash Query to pipe input directly without using heredoc trick
  • CentOS 6 and 7 / RHEL Persistent DHCP Solution