Failing to Encode on Linux, Immediate error

Operating System: Garuda Linux
KDE Plasma Version: 6.1.2
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.7-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 7950X3D 16-Core Processor
Memory: 62.5 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 XTX
Manufacturer: ASRock
Product Name: X670E Pro RS

Error im getting when trying to use either h.264 or hvec vaapi Codecs which are GPU hardware ones:

mlt_repository_init: failed to dlopen /tmp/.mount_shotcujnARyt/usr/bin/lib/mlt-7/libmltsox.so
  (libsox.so.3: cannot open shared object file: No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
[AVHWDeviceContext @ 0x768de80044c0] Trying to use DRM render node for device 0.
[AVHWDeviceContext @ 0x768de80044c0] libva: VA-API version 1.7.0
[AVHWDeviceContext @ 0x768de80044c0] libva: Trying to open /tmp/.mount_shotcujnARyt/usr/bin/lib/va/radeonsi_drv_video.so
[AVHWDeviceContext @ 0x768de80044c0] libva: dlopen of /tmp/.mount_shotcujnARyt/usr/bin/lib/va/radeonsi_drv_video.so failed: libedit.so.2: cannot open shared object file: No such file or directory
[AVHWDeviceContext @ 0x768de80044c0] libva: va_openDriver() returns -1
[AVHWDeviceContext @ 0x768de80044c0] Failed to initialise VAAPI connection: -1 (unknown libva error).
Failed to create VAAPI device.
[consumer avformat] Failed to initialize VA-API: -5
[h264_vaapi @ 0x768de8001dc0] A hardware frames reference is required to associate the encoding device.
[producer avformat] audio: total_streams 1 max_stream 1 total_channels 2 max_channels 2
[AVIOContext @ 0x768d9484c0c0] Statistics: 25114061 bytes read, 2 seeks
[chain avformat-novalidate] /run/media/bes/Share2/Videos/The First Descendant/The First Descendant_2024.07.04-22.24.mp4
    checking VFR: pkt.duration 128
Failed with exit code 11
Failed with exit code 11

If I switch it to Libx265 codec it works fine but appears to be using the CPU instead…which takes a million years to encode…

It looks like the AppImage does not include the libedit library this VA-API userspace driver needs. I am not sure why it needs it. Is it available in your distribution?

It looks like it is available here: Arch Linux - libedit 20240517_3.1-1 (x86_64)

But you will need to symlink /usr/lib/libedit.so.0.0.73 to libedit.so.2 since its name differs from the ubuntu:20.04-based AppImage. The Ubuntu package for that is Ubuntu – Details of package libedit2 in focal and you can see it is based on the same upstream version 3.1

Alternatively, try the Flatpak, which is a different build and bundle.

Update: I see that I had to block libedit from being bundled by the build script since version 23.03 with the introduction of Qt 6 because it caused other, more significant and highly visible problems.

Thanks, I suspected it may have been because I was using the appimage (because it’s much easier to use of course, just double click and it goes and no installation needed). So basically it doesn’t have access to the GPU driver because it’s an appimage? …if im understanding correctly?

Anyway, I just tossed the flatpak version on my system ill try it out after this current encode is finished.

No, it is because a library that VA-API (the hardware encoding API) needs is not in the AppImage or on your system. The AppImage tries to include many dependencies, but it cannot because that reduces compatibility, ironically, in certain cases. Flatpak is better at bundling dependencies more independently of the installed OS.

It works now in any case, thanks.