24
December
2021
16:20

Settings of hardware acceleration video: Brief Instruction

24 December 2021 16:20

On my netbook (AMD C-30 single-core processor, the AMD Radeon HD 6250 video card set up the video acceleration, I share my experience.

For an accelerated at the hardware level of video playback, you need to fulfill three conditions:
1) hardware acceleration due to a graphic adapter with support for hardware acceleration and drivers of a graphic adapter,
2) the inclusion of VA and VDPAU (it is necessary to check that they are involved),
3) Setting up the web browser Mozilla Firefox.

The instructions were carried out according to the guide on https: // wiki.archlinux.org/title/
Hardware_video_acceleration#ATI/AMD

In order:

1) installed the necessary packages (because I have AMD - used amdgpu, а для встроенной графики Intel потребуется пакет Intel-primE.

Only for Ubuntu:

sudo apt install ubuntu-restricted-extraS.

For all Linux OS:

sudo apt-get install linux-firmware mpv vdpaUinfo

If the AMD graphics:

sudo apt-get install xserver-xorg-video-amDGPU

If Intel graphics:

sudo apt instaLL Intel-GPU-TOOLS
sudo intel_gpu_top

If the NVIDI graphicsa - либо использовать фирменный драйвер с закрытым исходным кодом ("nvidia"), or Open-source драйвер "nouveau " - рекомендую. В ОС на основе Ubuntu драйвер Nouveau встроен в систему.
You just need to check the file /etc/X11/xorg.conf which driver is used, "nvidia" или "nouveau". В случае ATI / AMD в файле строчка "Driver " amDGPU ".

Addition from 08/18/2023: The X-server configuration is in the folder /usr/share/X11/xorg.conf.d и файле /etc/X11/xorg.conf.
Practice has shown that the presence of a XO filerg.conf желательно (без него не работают команды inxi -Gxx или inxi -G --extra 2).
You need to reload, select additional recovery parameters ("ADVanced recovery options") и войти в меню "rOOT ", where to execute commands:

X -configure
cp /root/xorg.conf.new /etc/X11/xorG.Conf

2) reboot. We check on any video downloaded from the Internet (file.mp4), What does hardware acceleration of the video (test file is advisable to take with a resolution of 720p, for example 1280x720, the frequency of 25FPS frames and a length of not more than 2 minutes) in the video playback program.

Examples of video file:S.ample - mp4 films.

wget url_видео_файла

mpv --hwdec=auto "filename.mP4 " 

Video clip with a window in full screen will begin. You can evaluate the frequency of personnel by eye - whether there are passes.
After the reproduction of the input, the input focus will be returned to the terminal in which you need to read the last 2 lines:
If there is a mention vaaPi , the hardware acceleration of the video card and the driver works .

In case of playback errors, we get a version of the video card using the Inxi and look for a solution on the Internet with drivers:

lspci | grep -i display
inxi -Gxxz

If the video acceleration is absent, the remaining points do not make sense, we are looking for third -party drivers.
(A guide for installing the NVIDIA video cards in Ubuntu 20.04).
My hardware acceleration in the video player turned on immediately. I continue ...

Check Vainfo

sudo apt-get install vaInfo
vainfo

The conclusion should show that the video card supports at least the main codecs: MPEG2 and H.264.

Vaprofileh264, etc.

libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Mesa Gallium driver 21.2.6 for AMD PALM (DRM 2.50.0 / 5.4.0-139-generic, LLVM 12.0.0)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple : VAEntrypointVLD
      VAProfileMPEG2Main : VAEntrypointVLD
      VAProfileVC1Simple : VAEntrypointVLD
      VAProfileVC1Main : VAEntrypointVLD
      VAProfileVC1Advanced : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264Main : VAEntrypointVLD
      VAProfileH264High : VAEntrypointVLD
      VAProfileNone : VAEntrypointVideoProc

Note: VA is a special software interface (API) developed by Intel for using hardware acceleration. (Video acceleraTion API).

check vdpau

grep -iE 'vdpau | dri driver' /var/log/Xorg.0.log

It must be written that vdpau driver (in this case, Radeon) has been installed:

[ 61.505](II) RADEON(0): [DRI2] DRI driver: r600
[ 61.505](II) RADEON(0): [DRI2] VDPAU driver: r600

NOTE: VDPAU - open source software interface to decorate the video in UNIX. (Video Decodeand Presentation API for Unix)

3) Settings Mozilla Firefox for hardware playback of YouTube:

First of all, you need to install an extension in Firefox " h264i ":
https: //addons.mozilla.org/ru/
FIrefox/addon/h264ify/

Secondly, check that in fireFox включен и работает контейнер WebRender.

about:supporT

In the section "Solution Log" , when the acceleration apparatus is included in the device, the following values :

  • in the column _HW \ Compusiting -availaBle
  • in the column Webrender - availaBle

We tune the configuration a little:
ABOUT: Config
And then changed the keys:
media.ffmpeg.vaapi.enabled = true (включение аппаратного ускорения воспроизведения FFmPEG using VAAPI)
media.navigator.mediadatadecoder_vpx_enabled = trUE (allows the hardware acceleration of WebRTC - video conferences)
media.rdd-vpx.enabled = false (отключение встроенного программного декодера VP8/VP9)
media.peerconnection.video.vp9_enabled = false (disconnection of the slow codec VP9 - addition from 05.07.2024)

We check on the extensions panel that in Firefox включено расширение h264ify. Перезапускаем Firefox.
After the specified configuration, the video is played with a low loading of the central processor.

P.S. Some instructions recommend add Export переменной в ~/.profile , инструкцию для Wayland или XorG. I did not fulfill this point:Instructions.

4) disconnecting the composer of the windows compton (consumes processor resources - note from 05.07.2024) and reboot

 sudo apt remove compton && sudo shutdown -r now

What happened and became :

  • Up the acceleration of the hardware video: YouTube was not played in the window (frozen frame, only sound). Loading a 1-core processor is about 90%.
  • when turned on the hardware acceleration of AMD Radeon HD: The video is played by video 480p in the window without 25FPS venues, and in the full screen video 25 FPS; Video resolution 720p in full screen - 25fps; The maximum resolution of Full HD 1080P is the frame rate of about 25 FPS (at the beginning of playing about 10-15 seconds there are frames - 10-15 frames per second).

Sources:
https: // wiki.archlinux.org/title/Hardware_video_acceleraTion
https: // wiki.archlinux.org/title/Firefox#Hardware_video_acceleraTion
*https: // discourse.ubuntu.com/t/enabling-accelerated-video-decoding-in-firefox-on-ubuntu-21-04/22081



Related publications