Score:3

How can I tell if Ubuntu driver is using integrated graphics GPU to hardware decode HEVC when playing videos using VLC?

cn flag

I've found that VLC uses ~17% CPU for x264 FHD videos, ~28% for HEVC FHD videos, and ~80% for HEVC 4k videos.

sudo lshw -c video

produces..

  *-display                 
       description: VGA compatible controller
       product: Cezanne
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: /dev/fb0
       version: c3
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi msix vga_controller bus_master cap_list fb
       configuration: depth=32 driver=amdgpu latency=0 resolution=3840,2160
       resources: irq:40 memory:d0000000-dfffffff memory:e0000000-e01fffff ioport:e000(size=256) memory:fcc00000-fcc7ffff

Processor: AMD® Ryzen 5 5560u with radeon graphics × 12

Graphics: RENOIR (renoir, LLVM 15.0.6, DRM 3.47, 5.19.0-35-generic)

Score:5
cn flag

The solution for me was...

sudo apt remove vlc

then...

sudo apt install mpv

I now get consistent ~8% CPU usage playing UHD HEVC videos vs. ~80% with VLC.

cn flag
pts
No need to remove `vlc`, `mpv` can use hardware acceleration even if VLC is still installed.
Peter Cordes avatar
fr flag
You probably also want to edit `~/.config/mpv/mpv.conf` or `~/.mpv/mpv.conf` with `profile=gpu-hq` and `hwdec=auto` if not already enabled. I've been using MPV for years, so I don't know how much of my config file is still needed, but I also had to set `hwdec-codecs=hevc,vp8,vp9,mpeg1video,mpeg2video,h264,vc1,wmv3` which is appropriate for my Skylake iGPU. (I much prefer MPV to VLC anyway, with good key-binds for accurate seeking and single-stepping fwd / backward, and very fast startup from the command line.)
in flag
@pts Simply removing VLC is probably easier than finding out how that particular Linux desktop environment handles file type associations.
cn flag
@PeterCordes I didn't need to specify hardware decoding in the conf file. It just did it automatically.
Peter Cordes avatar
fr flag
@deanresin: IIRC, an old version of MPV maybe didn't do it by default for *all* the relevant codecs, like maybe by default for H.264 and H.265, but IIRC it wasn't doing HW decode for VC1 / WMV3 without manual config. Hopefully that's changed now, and it will HW decode for anything your HW supports.
Peter Cordes avatar
fr flag
Also, `profile=gpu-hq` is a good idea for video quality if your video hardware is fast enough, if the default is only `gpu`. It'll use a higher-quality scaling algorithm. (You might need to use a faster scaler for 2160p60 videos, if it can't push that many pixels.) That's separate from enabling HW decoding.
Score:5
bs flag

To simply cite another site:

  • In Settings/Preferences
  • look for Input/Codecs tab
  • check out the option Hardware-accelerated decoding
  • select the Automatic option and you are fine

( please comment if you have trouble ;) )

cn flag
I disabled it and I was still getting ~80% CPU usage playing a HEVC 4k video which leads me to believe it is not using hardware acceleration.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.