You are not logged in.

#1 2021-07-03 13:22:56

bernd_b
Member
Registered: 2013-07-30
Posts: 140

mesa breaks hardware encoding?

I use here and then hardware encoding with ffmpeg like this:

ffmpeg -vaapi_device /dev/dri/renderD128 -i "Exampe_Input.mkv" -vf 'format=nv12,hwupload' -c:v hevc_vaapi -compression_level 1 -rc_mode 1 -qp 25 -c:a copy -c:s copy -map 0:v -map 0:a? -map 0:s? -metadata title=Example_Output ./done_x265/Example_Output.x265.qp25.mkv

One day, everything seemed to work as normal (no error messages or similiar things), but the output files showed only a black screen with mpv/vlc.

After fooling around I got the old behavour back (meaning an output with video ...) with dowgrading mesa to 21.0.3. Everything from 21.1.x seems to break the output of the reencoding with ffmpeg using the hevc_vaapi codec.

Here are the packages in total I (think I) had to downgrade to get a working desktop and(!) working hardware-encoding:

mesa 21.0.3-3
lib32-mesa 21.0.3-3

mesa-vdpau 21.0.3-3
lib32-mesa-vdpau 21.0.3-3

libva-mesa-driver 21.0.3-3
lib32-libva-mesa-driver-21.0.3-3

xf86-video-amdgpu 19.0.1-1

llvm 11.1.0-1
llvm-libs 11.1.0-1

Maybe of use:

cat /proc/cpuinfo 
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 23
model		: 17
model name	: AMD Ryzen 5 2400G with Radeon Vega Graphics

Offline

#2 2021-07-04 12:11:40

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 9,336

Re: mesa breaks hardware encoding?

First, remove lib32-mesa-vdpau & mesa-vdpau [1] .

second, run vainfo with both mesa versions .
Post both outputs so we can compare them


[1] VDPAU was always tricky to get to work and didn't bring much anyway.
As far as I know nowadays it has no benefits over using vaapi.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2021-07-04 13:25:06

bernd_b
Member
Registered: 2013-07-30
Posts: 140

Re: mesa breaks hardware encoding?

O.K, lets start

pacman -R lib32-mesa-vdpau mesa-vdpau
checking dependencies...
:: lib32-mesa optionally requires lib32-mesa-vdpau: for accelerated video playback
:: mesa optionally requires mesa-vdpau: for accelerated video playback

Packages (2) lib32-mesa-vdpau-21.0.3-3  mesa-vdpau-21.0.3-3

Total Removed Size:  19.95 MiB

:: Do you want to remove these packages? [Y/n] Y
:: Processing package changes...
(1/2) removing mesa-vdpau                                                          [################################################] 100%
(2/2) removing lib32-mesa-vdpau                                                    [################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

Vainfo No. 1:

vainfo
vainfo: VA-API version: 1.12 (libva 2.11.1)
vainfo: Driver version: Mesa Gallium driver 21.0.3 for AMD Radeon(TM) Vega 11 Graphics (RAVEN, DRM 3.40.0, 5.12.14-arch1-1, LLVM 11.1.0)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc

And:

pacman -Su
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (6) lib32-mesa-21.1.3-1  libva-mesa-driver-21.1.3-1  llvm-12.0.0-2  llvm-libs-12.0.0-2  mesa-21.1.3-1
             xf86-video-amdgpu-19.1.0-2

Total Download Size:     0.07 MiB
Total Installed Size:  601.78 MiB
Net Upgrade Size:       52.14 MiB

:: Proceed with installation? [Y/n] Y
:: Retrieving packages...
 xf86-video-amdgpu-19.1.0-2-x86_64                      71.3 KiB   666 KiB/s 00:00 [################################################] 100%
(6/6) checking keys in keyring                                                     [################################################] 100%
(6/6) checking package integrity                                                   [################################################] 100%
(6/6) loading package files                                                        [################################################] 100%
(6/6) checking for file conflicts                                                  [################################################] 100%
(6/6) checking available disk space                                                [################################################] 100%
:: Processing package changes...
(1/6) upgrading llvm-libs                                                          [################################################] 100%
(2/6) upgrading mesa                                                               [################################################] 100%
(3/6) upgrading lib32-mesa                                                         [################################################] 100%
(4/6) upgrading libva-mesa-driver                                                  [################################################] 100%
(5/6) upgrading llvm                                                               [################################################] 100%
(6/6) upgrading xf86-video-amdgpu                                                  [################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

VaInfo No. 2:

vainfo 
vainfo: VA-API version: 1.12 (libva 2.11.1)
vainfo: Driver version: Mesa Gallium driver 21.1.3 for AMD Radeon(TM) Vega 11 Graphics (RAVEN, DRM 3.40.0, 5.12.14-arch1-1, LLVM 12.0.0)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc

I hope I got everything right. Tried a new hw-encoding after update: sound but no video. I made a one minue clip, so I can upload the (broken?) output somewhere if this helps.

Offline

#4 2021-07-04 13:46:17

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 9,336

Re: mesa breaks hardware encoding?

No issues in those outputs, vainfo appears identical with either mesa version .

ffmpeg tends to output lots of info in terminal, can you post the output of the command with mesa 21.x ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2021-07-04 14:17:30

bernd_b
Member
Registered: 2013-07-30
Posts: 140

Re: mesa breaks hardware encoding?

Of course:

ffmpeg -vaapi_device /dev/dri/renderD128 -i "test.mkv" -t 00:01:00 -vf 'format=nv12,hwupload' -c:v hevc_vaapi -compression_level 1 -rc_mode 1 -qp 25 -c:a copy -map 0:v -map 0:a? -metadata title=test ./done_x265/test.x265.qp25.mkv
ffmpeg version n4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, matroska,webm, from 'test.mkv':
  Metadata:
    encoder         : libebml v0.7.9 + libmatroska v0.8.1
    creation_time   : 2017-08-23T10:38:08.000000Z
  Duration: 02:06:13.48, start: 0.000000, bitrate: 11484 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 763.221000
      Metadata:
        title           : 00:00:00.000
    Chapter #0:1: start 763.221000, end 1265.347000
      Metadata:
        title           : 00:12:43.221
    Chapter #0:2: start 1265.347000, end 1952.659000
      Metadata:
        title           : 00:21:05.347
    Chapter #0:3: start 1952.659000, end 2589.378000
      Metadata:
        title           : 00:32:32.659
    Chapter #0:4: start 2589.378000, end 3407.988000
      Metadata:
        title           : 00:43:09.378
    Chapter #0:5: start 3407.988000, end 4008.546000
      Metadata:
        title           : 00:56:47.988
    Chapter #0:6: start 4008.546000, end 4453.032000
      Metadata:
        title           : 01:06:48.546
    Chapter #0:7: start 4453.032000, end 5024.394000
      Metadata:
        title           : 01:14:13.032
    Chapter #0:8: start 5024.394000, end 5796.791000
      Metadata:
        title           : 01:23:44.394
    Chapter #0:9: start 5796.791000, end 6417.244000
      Metadata:
        title           : 01:36:36.791
    Chapter #0:10: start 6417.244000, end 7138.798000
      Metadata:
        title           : 01:46:57.244
    Chapter #0:11: start 7138.798000, end 7573.483000
      Metadata:
        title           : 01:58:58.798
  Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x800, SAR 1:1 DAR 12:5, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
  Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
  Stream #0:2(dut): Subtitle: subrip (default)
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_vaapi))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hevc_vaapi @ 0x5596bc7893c0] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).
[hevc_vaapi @ 0x5596bc7893c0] Quality attribute is not supported: will use default quality level.
Output #0, matroska, to './done_x265/test.x265.qp25.mkv':
  Metadata:
    title           : test
    encoder         : Lavf58.76.100
  Chapters:
    Chapter #0:0: start 0.000000, end 60.000000
      Metadata:
        title           : 00:00:00.000
  Stream #0:0: Video: hevc (Main), vaapi_vld(tv, progressive), 1920x800 [SAR 1:1 DAR 12:5], q=2-31, 23.98 fps, 1k tbn (default)
    Metadata:
      encoder         : Lavc58.134.100 hevc_vaapi
  Stream #0:1(eng): Audio: dts (DTS) ([1] [0][0] / 0x2001), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
frame= 1439 fps=109 q=-0.0 Lsize=   17654kB time=00:00:59.98 bitrate=2410.9kbits/s speed=4.53x    
video:6552kB audio:11052kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.280937%

Offline

#6 2021-07-04 14:51:33

bernd_b
Member
Registered: 2013-07-30
Posts: 140

Re: mesa breaks hardware encoding?

I fooled around and installed mesa-git, and the same ffmpeg call gives me video output back again:

pacman -Qs mesa-git
local/mesa-git 21.2.0_devel.141998.ffea6226041-1

Offline

#7 2021-07-05 13:58:04

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 9,336

Re: mesa breaks hardware encoding?

[hevc_vaapi @ 0x5596bc7893c0] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).

[hevc_vaapi @ 0x5596bc7893c0] Quality attribute is not supported: will use default quality level.

One of those may be the cause.
Glad you found a workaround, but it may take several months before relevant changes are in a stable verson ,
Maybe you could search for an upstream bugreport about this ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2021-07-06 19:51:43

bernd_b
Member
Registered: 2013-07-30
Posts: 140

Re: mesa breaks hardware encoding?

Both messages do also appear when using mesa-git.

The second is due to the option "-compression_level 1", leaving it out leads to only the first message remaining. This option seems to be not supported in my case/ by my hardware, don't know why I set it once.

Will try to search upstream for further hints.

Offline

Board footer

Powered by FluxBB