Hardware Accelerated Video Decoding on Linux

🧩 Syntax:
# For HP Victus with Ryzen 5 5600H and Radeon RX 550M (AMD open-source GPU driver configuration) install these packages to get GPU related stuff working perfectly:
yay -S vulkan-radeon libva-mesa-driver lib32-libva-mesa-driver mesa-vdpau lib32-mesa-vdpau

# Use the following packages to analyze GPU usage and other important driver information
yay -S libva-utils vdpauinfo vulkan-tools radeontop amdgpu_top nvtop

# Other than the AV1 format all the codecs can be decoded by RX 550M GPU and integrated GPU. Use `vainfo` to find the ones which are enabled.
# Use enhanced-h264ify to disable certain codecs that aren't supported for hardware decoding.  https://github.com/alextrv/enhanced-h264ify

# Launching any application with the following environment variable `DRI_PRIME=1` will launch them with dedicated GPU. This is helpful when launching applications that may need more graphical power. Not realy helpful in the case of using with browsers because hardware accelerated video decoding doesn't happen with dedicated GPU. For video decoding in mpv, and vlc, the default integrated GPU is good enough.
  - https://wiki.archlinux.org/title/PRIME#For_open_source_drivers_-_PRIME
  - https://wiki.gentoo.org/wiki/AMDGPU

# Update: As of Chromium: 114.0.5735.35, hardware accelerated video decoding can be enabled on X11 just by lauching browser with the following flags

--ignore-gpu-blocklist --enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiVideoDecodeLinuxGL,VaapiIgnoreDriverChecks --disable-features=UseChromeOSDirectVideoDecoder,UseSkiaRenderer

# mpv by-default runs without any hardware accelerated video decoding. See this section - https://mpv.io/manual/stable/#options-hwdec
Enable hardware video decoding at runtime using Ctrl+H. press i or shit+i on keyboard to confirm this. It will show hwdec=vaapi if it's accelerated.
If you want to test available hardware decoding methods, pass --hwdec=auto --hwdec-codecs=all and look at the terminal output.

# VLC by default runs with hardware accelerated video decoding