Electron Linux 视频硬件加速

Electron Linux Video Hardware Acceleration

我很难为在 Linux (ARM64) 和 Linux (Intel64) 上使用 electron 运行 工作的视频获得硬件加速。我不确定这是否是电子用于铬的标志的问题,或者它是否更多是主机驱动级别的问题。或者,也许这是不可能的。两台机器都是 运行 Chromium 95 snap 64 位。

当 运行 chromium (ARM64) 没有任何标志并且 运行 chrome://gpu 我得到以下信息:

当 运行 chromium (ARM64) 与 --enable-features=VaapiVideoDecoder 我得到以下信息:

这让我相信当使用标志调用 chrome 时,硬件加速应该可以正常工作。只是为了增加这个的复杂性,如果我去 youtube 并检查媒体它看起来可能仍然被禁用(即使有标志):

我已经阅读了许多标题为 'how to enable hardware acceleration in electron' 的文章。其中大部分列出了以下要提供的标志:

app.commandLine.appendSwitch('ignore-gpu-blacklist')
app.commandLine.appendSwitch('enable-gpu-rasterization')
app.commandLine.appendSwitch('enable-accelerated-video')
app.commandLine.appendSwitch('enable-accelerated-video-decode')
app.commandLine.appendSwitch('use-gl', 'desktop')
app.commandLine.appendSwitch('enable-features', 'VaapiVideoDecoder')

我已经尝试了所有这些,但似乎没有任何区别。当 运行 电子视频时,它具有以下属性:

有人能用这个给我指明正确的方向吗?谢谢。

已解决。主要问题是需要在应用程序的硬件 运行 上安装 VaAPI 驱动程序。其次,唯一需要的标志如下:

app.commandLine.appendSwitch('enable-features', 'VaapiVideoDecoder')