Hardware encoding on Intel Core 10th gen in Ubuntu not detected, video blank/black

I want to enable hardware encoding on my Intel Core i5-1035G4 (Intel Iris Plus graphics), but when I try “detect” nothing happens:

- h264_vaapi is not detected, although I believe I got it, because:

  1. I’ve installed via apt ubuntu-restricted-addons package

  2. I’ve checked via vainfo:

    ~$ vainfo
    libva info: VA-API version 1.7.0
    libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_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: Intel iHD driver for Intel® Gen Graphics - 20.1.1 ()
    vainfo: Supported profile and entrypoints
    VAProfileNone : VAEntrypointVideoProc
    VAProfileNone : VAEntrypointStats
    VAProfileMPEG2Simple : VAEntrypointVLD
    VAProfileMPEG2Main : VAEntrypointVLD
    VAProfileH264Main : VAEntrypointVLD
    VAProfileH264Main : VAEntrypointEncSliceLP
    VAProfileH264High : VAEntrypointVLD
    VAProfileH264High : VAEntrypointEncSliceLP
    VAProfileJPEGBaseline : VAEntrypointVLD
    VAProfileJPEGBaseline : VAEntrypointEncPicture
    VAProfileH264ConstrainedBaseline: VAEntrypointVLD
    VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
    VAProfileVP8Version0_3 : VAEntrypointVLD
    VAProfileHEVCMain : VAEntrypointVLD
    VAProfileHEVCMain : VAEntrypointEncSliceLP
    VAProfileHEVCMain10 : VAEntrypointVLD
    VAProfileHEVCMain10 : VAEntrypointEncSliceLP
    VAProfileVP9Profile0 : VAEntrypointVLD
    VAProfileVP9Profile1 : VAEntrypointVLD
    VAProfileVP9Profile2 : VAEntrypointVLD
    VAProfileVP9Profile3 : VAEntrypointVLD
    VAProfileHEVCMain422_10 : VAEntrypointVLD
    VAProfileHEVCMain444 : VAEntrypointVLD
    VAProfileHEVCMain444 : VAEntrypointEncSliceLP
    VAProfileHEVCMain444_10 : VAEntrypointVLD
    VAProfileHEVCMain444_10 : VAEntrypointEncSliceLP

If I try to force-select it, I may, but it renders blank .mp4 file with just audio in it :frowning:

What am I doing wrong?

Debug info:
Shotcut version 20.07.11
Ubuntu 20.04 LTS

~$ ffmpeg -codecs 2>&1 | grep 264
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_omx h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )

Thanks a lot for help!

I’ll try to reboot, yet, just to be sure…
EDIT: nope, reboot has not helped

See https://github.com/mltframework/shotcut/issues/892

VA-API does not have a super stable API, and the older versions we use to make the portable, snap, and appimage build do not work on newer OS versions. The flatpak, however, does use a newer version of the VAAPI libraries that you should try. It works on my Intel-based Ubuntu 20.04 system:

[AVHWDeviceContext @ 0x7fac08019740] Opened VA display via X11 display :99.0.
[AVHWDeviceContext @ 0x7fac08019740] libva: VA-API version 1.5.0
[AVHWDeviceContext @ 0x7fac08019740] libva: va_getDriverName() returns 0
[AVHWDeviceContext @ 0x7fac08019740] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/iris_drv_video.so
[AVHWDeviceContext @ 0x7fac08019740] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/intel-vaapi-driver/iris_drv_video.so
[AVHWDeviceContext @ 0x7fac08019740] libva: Found init function __vaDriverInit_1_5
[AVHWDeviceContext @ 0x7fac08019740] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x7fac08019740] Initialised VAAPI connection: version 1.5
[AVHWDeviceContext @ 0x7fac08019740] VAAPI driver: Intel iHD driver - 1.0.0.
[AVHWDeviceContext @ 0x7fac08019740] Driver not found in known nonstandard list, using standard behaviour.
[mlt_buffer @ 0x7fac08043c80] w:1920 h:1080 pixfmt:nv12 tb:1/25 fr:25/1 sar:0/1 sws_param:
[h264_vaapi @ 0x7fac08001e80] Input surface format is nv12.
[h264_vaapi @ 0x7fac08001e80] Using VAAPI profile VAProfileH264Main (6).
[h264_vaapi @ 0x7fac08001e80] Using VAAPI entrypoint VAEntrypointEncSlice (6).
[h264_vaapi @ 0x7fac08001e80] Using VAAPI render target format YUV420 (0x1).
[h264_vaapi @ 0x7fac08001e80] RC mode: ICQ.
[h264_vaapi @ 0x7fac08001e80] RC quality: 23.
[h264_vaapi @ 0x7fac08001e80] RC framerate: 25/1 (25.00 fps).
[h264_vaapi @ 0x7fac08001e80] Using intra, P- and B-frames (supported references: 8 / 2).
[h264_vaapi @ 0x7fac08001e80] All wanted packed headers available (wanted 0xd, found 0x1f).
[h264_vaapi @ 0x7fac08001e80] Using level 4.

First of all, thanks for your support of this app!

Second, I do not need it right now, can live without it for a while, I still prefer .appImage over anything else, so… if I understood well, there is nothing wrong with my system and/or configuration - it is the feature of your Shotcut builds that this does not work in newest OS’… right? If so - will it be fixed any time soon, or no plans?

Also… If I ran standalone portable version - would it work?


No currently the portable, AppImage, and snap are all the same build with different packaging.

OK, I hereby confirm that it works properly in flatpak package.

Also, flatpak version has this issue fixed when I could not make preview smaller and timeline bigger, here it is in flatpak - dragged timeline subwindows most-top possible:

compare with .appimage:

– cannot make the preview smaller - this is very unpleasant, because I cannot see all the tracks :frowning:

Unfortunately, there is one more thing I consider a bug: although I obviously have Shotcut in flatpak:

$ flatpak list
Name           Application ID                     Version  Branch Installation
SWH            …ktop.LinuxAudio.LadspaPlugins.swh 0.4.17   19.08  system
default        …g.freedesktop.Platform.GL.default          19.08  system
Intel          ….freedesktop.Platform.VAAPI.Intel          19.08  system
openh264       org.freedesktop.Platform.openh264  2.1.0    2.0    system
Yaru-dark Gtk… org.gtk.Gtk3theme.Yaru-dark                 3.22   system
KDE Applicati… org.kde.Platform                            5.14   system
QGnomePlatform ….kde.PlatformTheme.QGnomePlatform          5.14   system
QtSNI          org.kde.PlatformTheme.QtSNI                 5.14   system
QGnomePlatfor… …oration.QGnomePlatform-decoration          5.14   system
Shotcut        org.shotcut.Shotcut                20.07.11 stable system

It seems not installed in Software:

I have the plugin installed, though:

$ sudo apt list | grep gnome-software-plugin-flatpak

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

gnome-software-plugin-flatpak/focal-updates,now 3.36.1-0ubuntu0.20.04.0 amd64 [installed]

(and yes, I made a reboot meanwhile)

( I made the instalation via flatpak install flathub org.shotcut.Shotcut)

So that is one possible bug in appimage (preview impossible smaller) and one in flatpak - cannot see it “installed” in Software GUI app.

… any hints? Thanks a lot!

They use different versions of Qt, which respond differently to desktop scaling and DPI. Here is the AppImage on my system with a small video preview

I see your image is 3006x1948 suggesting that is a factor.

Unfortunately, there is one more thing I consider a bugIt seems not installed in Software

I do not know anything about that and not going to about it myself. You can report it here: GitHub - flathub/org.shotcut.Shotcut and see what they say.

Ad scaling:
yes, I’ve got some scaling on my system due to 3:2 display (BTW, I really do love it - it’s better than 19:9):

Ad not/installed:
Although I have not done anything, it appears properly - installed - now:

Basically, we can close this issue with this conclusion for Shotcut users: use flatpak version for smoothest user experience.

This topic was automatically closed after 90 days. New replies are no longer allowed.