Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

下载了你的 chromium_110.0.5481.54_linux_x64_with_hevc_hw_decode_encode_support.deb还是没有hevc硬解 #49

Open
flwwater opened this issue Apr 1, 2023 · 13 comments

Comments

@flwwater
Copy link

flwwater commented Apr 1, 2023

我的gpu是intel核显 UHD730,支持hevc和av1的硬件加速。
但是在chrome://gpu里的decode一栏只有h264,vp8,vp9的硬件加速,不知道hevc和av1到哪里去了。
终端vainfo命令里是显示全部支持的。
我的火狐浏览器里面能h264和av1的硬解,就是不支持hevc。所以想换个换个支持全一点的。结果好不到哪里去.....

chromium里是需要什么参数吗?

@StaZhu
Copy link
Owner

StaZhu commented Apr 1, 2023

大概率是因为你那里VDAVideoDecoder生效了,但是VAAPIVideoDecoder没生效。前者已不在维护了,Chrome后续只会维护后者。

目前Chrome的AV1和HEVC的实现只支持了VAAPIVideoDecoder。所以你想给这俩Codec加速必须把VAAPIVideoDecoder搞好使….,然而这个东西在Linux貌似基建一直比较差劲直到最近的113版本开始支持X11才开始好装。

试一下安装下Chrome Canary 114,并传入 --enable-features=VaapiVideoDecoder,VaapiVideoDecodeLinuxGL 看下是否Ok.

目前在做Mac的杜比音频解码,后续我会编译一版带HEVC软解 + AC3/E-AC3 杜比音频支持的 Chromium 114

@StaZhu
Copy link
Owner

StaZhu commented Apr 1, 2023

哦对 Linux版本的Chrome没有Canary,下Chrome Dev吧

@flwwater
Copy link
Author

flwwater commented Apr 1, 2023

谢谢,那再等一段时间吧,先用h264凑合着......

@flwwater
Copy link
Author

flwwater commented Apr 6, 2023

https://chromium.woolyss.com/#linux
从下面网址下了一个114版本的,加了参数:
--enable-features=VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization
--disable-features=UseChromeOSDirectVideoDecoder,UseSkiaRenderer
--disable-reading-from-canvas
--webgpu
--ignore-gpu-blocklist
--enable-raw-draw
--disable-gpu-driver-workarounds
--use-gl=egl

如图:
图片

encode里到是全了,decode里还是没有hevc和av1的硬解,哎。

@flwwater
Copy link
Author

flwwater commented Apr 6, 2023

注:VaapiVideoDecodeLinuxGL 参数加了还是没变化。

@flwwater
Copy link
Author

flwwater commented Apr 6, 2023

chrome v112
加如下参数:
--enable-gpu-rasterization
--enable-zero-copy
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan

成功开启所有格式的硬解
图片

@flwwater
Copy link
Author

flwwater commented Apr 6, 2023

但是intel_gpu_top里的video是0,还需要研究一下。

@hrzhu
Copy link

hrzhu commented Apr 6, 2023

https://github.com/RobRich999/Chromium_Clang/releases/tag/v114.0.5688.0-r1124910-linux64-deb-avx2
这个版本的 Chromium 网站上显示编译的 all-codecs+ 特性,不加任何启动参数就能解码 HEVC,虽然 chrome://gpu 里解码编码都是空白。测试视频
Google 官方的 Chrome Stable 112.0.5615.49 在那个网站上显示 all-codecs,加了 --enable-features=PlatformHEVCEncoderSupport 也不能播放 HEVC 视频。

想知道 all-codecs 和 all-codecs+ 分辨是啥编译参数决定的。

@StaZhu
Copy link
Owner

StaZhu commented Apr 7, 2023

  1. 写的all codec大概率是指的软解,这个本repo提供的chromium也是包含的(利用FFMpegVideoDecoder做软解),如果想使用硬解,chrome://gpu 必须有显示,但是有显示不代表能成功,你得自己测试,建议用Chrome Dev 113测试。
  2. PlatformHEVCEncoderSupport这个启动参数是用于启动HEVC编码的,跟解码没啥关系,而且只支持Windows和Mac,所以你不需要传这个启动参数。

@hrzhu
Copy link

hrzhu commented Apr 7, 2023

嗯 之前没看清楚 --enable-features=PlatformHEVCEncoderSupport 是编码。又试了下 Google 官方的 Chrome Unstable 114.0.5696.0 在 https://chromium.woolyss.com/#linux 也是显示all-codec,没法解码 HEVC。目前用 https://github.com/RobRich999/Chromium_Clang 提供的 Chromium 实现 FFMpegVideoDecoder 软解(F12 Developer Tools -> 3-dot Menu -> More tools -> Media 里面能看到)。硬解的话用啥启动参数都不行,AVC 都不能硬解,不过我不在意,能解码 HEVC 就行了。Windows 下的 Chrome 默认就能解码 HEVC,突然发现 Linux 下解不了就搜索到这里了。

@lishulincug
Copy link

这边下载chromium_115.0.5481.54_linux_x64_with_hevc_hw_decode_encode_support.deb的包,
启动命令 chromium-browser --enable-features=VaapiVideoDecoder,VaapiVideoDecodeLinuxGL,PlatformHEVCDecoderSupport,Vulkan,VulkanFromANGLE,DefaultANGLEVulkan --ignore-gpu-blocklist --enable-gpu-rasterization --enable-zero-copy

image
h265视频出来了,但似乎走了软解码 支持的参数是这个"prefer-software"。 下载chrome开发版google-chrome-unstable_current_amd64.deb 116.0版本,同样的启动参数 google-chrome --enable-features=VaapiVideoDecoder,VaapiVideoDecodeLinuxGL,PlatformHEVCDecoderSupport,Vulkan,VulkanFromANGLE,DefaultANGLEVulkan --ignore-gpu-blocklist --enable-gpu-rasterization --enable-zero-copy
但是直接不支持解码,是新版的chrome开发版不支持吗?

@flwwater
Copy link
Author

kubuntu 23.04 + chrome v114版本 仅使用如下参数便可开启显卡vaapi硬解。
--enable-features=VaapiVideoDecoder,VaapiVideoDecodeLinuxGL

@StaZhu
Copy link
Owner

StaZhu commented Jun 28, 2023

目前 Chromium Linux 硬解基建有问题,不是开箱即用的,需要特定配置,且仅支持 VAAPI 和 V4L2(116支持的),如果HEVC还是没法硬解(此时其他Codec应该也没法硬解),可以自己尝试编译源码 Debug,编译方式 README.md 里有写,或者用 Repo 里编译好的软解 Chromium。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants