You are not logged in.

#1 2022-07-10 01:47:18

Registered: 2022-07-08
Posts: 58

[SOLVED] FFMPEG AMD Hardware Encoding Error.


I have installed the "amdgpu-pro-installer" AUR package:


also the " ffmpeg-amd-full-git" AUR package as well:

Here are some details about my GPU with Arch Linux:

$ lspci -nn | egrep -i "3d|display|vga"
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Lexa XT [Radeon PRO WX 2100] [1002:6995]
$ lshw -C display
       description: VGA compatible controller
       product: Lexa XT [Radeon PRO WX 2100]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: /dev/fb0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom fb
       configuration: depth=32 driver=amdgpu latency=0 resolution=1920,1080
       resources: irq:63 memory:c0000000-cfffffff memory:d0000000-d01fffff ioport:e000(size=256) memory:fea00000-fea3ffff memory:c0000-dffff
$ glxinfo | grep "OpenGL vendor string" | cut -f2 -d":" | xargs
$ glmark2
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
    glmark2 2021.12
    OpenGL Information
    GL_VENDOR:      Mesa/
    GL_RENDERER:    llvmpipe (LLVM 14.0.6, 256 bits)
    GL_VERSION:     4.5 (Compatibility Profile) Mesa 22.1.3
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0
    Surface Size:   800x600 windowed
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[build] use-vbo=false: FPS: 336 FrameTime: 2.976 ms
                                  glmark2 Score: 336 

I get this error when I enter:

fmpeg -y -i video_sample.mp4 -codec:v h264_amf output_file.mp4
ffmpeg version n5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.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      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video_sample.mp4':
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.76.100
  Duration: 00:00:40.87, start: 0.000000, bitrate: 9392 kb/s
  Stream #0:0[0x1](und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p(pc, gbr/bt709/iec61966-2-1), 1920x1080 [SAR 1:1 DAR 16:9], 9391 kb/s, 30.02 fps, 30 tbr, 15360 tbn (default)
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (h264_amf))
Press [q] to stop, [?] for help
[h264_amf @ 0x55e0866bf780] DLL failed to open
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

Why FFMPEG shows this error and why isn't AMDGPU-PRO not loading to Arch Linux after reboot of the AMDGPU-PRO Installer provided from AUR?


Last edited by rajhlinux (2022-07-10 05:47:27)


#2 2022-07-10 05:45:42

Registered: 2022-07-08
Posts: 58

Re: [SOLVED] FFMPEG AMD Hardware Encoding Error.

I ended up installing everything manually following the link guide provided below:

  -For proprietary OpenGL implementation, install amdgpu-pro-libglAUR and optionally lib32-amdgpu-pro-libglAUR for 32 bit applications support.
  -For available OpenCL implementations see GPGPU#AMD/ATI:
          -opencl-amdAUR: ROCr OpenCL and legacy OpenCL (a.k.a. orca)
          -rocm-opencl-runtimeAUR: Part of AMD's ROCm GPU compute stack, officially supporting GFX8 and later cards (Fiji, Polaris, Vega), with unofficial and partial support for Navi10 based cards
          -amdapp-sdkAUR: AMD CPU runtime
          -opencl-mesa: free runtime for AMDGPU and Radeon
  -For proprietary Vulkan implementation, install vulkan-amdgpu-proAUR and optionally lib32-vulkan-amdgpu-proAUR for 32 bit applications support.
  -For Advanced Media Framework implementation, install amf-amdgpu-proAUR.

I did a reboot and OBS and FFMPEG does hardware encoding using h264_amf encoder.

The "amdgpu-pro-installer" package from AUR, did not work for me after a reboot.

Last edited by rajhlinux (2022-07-10 05:46:58)


#3 2023-03-16 09:29:45

Registered: 2021-01-10
Posts: 23

Re: [SOLVED] FFMPEG AMD Hardware Encoding Error.

I use no ffmpeg from AUR, just the normal ffmpeg package installed by pacman repo-extra
And I have an Nvidia card, where I use the Nvidia encoders.
But what is your output of available  AMD encoders?

ffmpeg -encoders | grep -i amd

I'm asking, because I have no experience with AMD cards and I'm thinking to buy my first AMD card. But only when I know that video encoding is working well....


#4 2023-03-16 11:31:51

Forum Moderator
Registered: 2012-01-15
Posts: 4,298

Re: [SOLVED] FFMPEG AMD Hardware Encoding Error.

The OP has not been back since August 2022, so I am going to consider this thread abandoned and close it now.

obelisk, if you still need help, please open a new topic and refer back to this one if you think it applies.

How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.


Board footer

Powered by FluxBB