StaZhu / enable-chromium-hevc-hardware-decoding

A guide that teach you enable hardware HEVC decoding & encoding for Chrome / Edge, or build a custom version of Chromium / Electron that supports hardware & software HEVC decoding and hardware HEVC encoding.
MIT License
1.15k stars 56 forks source link

linux 如何开启hevc硬解码 #59

Open Swing945 opened 10 months ago

Swing945 commented 10 months ago

hi,朱老师,感谢您在chrome hevc方面做出的巨大贡献 请问hevc硬解码在linux环境打通了么,需要加哪些参数,有哪些依赖条件,所需版本信息和显卡信息 现在测试ubuntu上115 chrome video acceleration information里没有h265的profile,不知道是什么原因

StaZhu commented 10 months ago

Linux只支持VAAPI,而且得加flag才能开启,当然开启了也不一定能跑的起来….,试试这个吧:--enable-features=VaapiVideoDecoder,VaapiVideoDecodeLinuxGL

如果需要开箱即用的可以下repo里带了软解兜底的Chromium

Swing945 commented 10 months ago

--enable-features=VaapiVideoDecoder,VaapiVideoDecodeLinuxGL 会提示 VaapiVideoDecoder: failed Initialize()ing the frame pool 如果加上--disable-features=UseChromeOSDirectVideoDecoder不会报这个错误 但是没有走vaapi解码,走的是vda解码

lgdsgd2000 commented 9 months ago

@StaZhu https://discourse.ubuntu.com/t/chromium-hardware-accelerated-build-for-intel-based-platforms-available-for-beta-testing/35625 ubuntu有新的intel平台的patch了

Swing945 commented 1 month ago

Linux只支持VAAPI,而且得加flag才能开启,当然开启了也不一定能跑的起来….,试试这个吧:--enable-features=VaapiVideoDecoder,VaapiVideoDecodeLinuxGL

如果需要开箱即用的可以下repo里带了软解兜底的Chromium

这个非常有用,但是必须得在ubuntu23.04以后的版本才能hevc硬解码

Swing945 commented 1 month ago

还有一个问题向大佬请教一下,chrome能够使用vaapi进行硬件编码吗? 看到chrome源码里有vaapi 编码相关的代码,但是不知道怎么使用 MediaRecoder方法里有没有什么属性能调用vaapi进行编码呢?

StaZhu commented 1 month ago

还有一个问题向大佬请教一下,chrome能够使用vaapi进行硬件编码吗? 看到chrome源码里有vaapi 编码相关的代码,但是不知道怎么使用 MediaRecoder方法里有没有什么属性能调用vaapi进行编码呢?

目前编码只支持 Windows,Mac,Android, Linux和ChromeOS的编码实现由于ChromeOS Media Team 认为存在版权问题,目前没有合入。此外 API 支持仅限于 WebCodecs API 和 WebRTC API,MediaRecorder API 目前没有Wire过去。

Swing945 commented 1 month ago

还有一个问题向大佬请教一下,chrome能够使用vaapi进行硬件编码吗? 看到chrome源码里有vaapi 编码相关的代码,但是不知道怎么使用 MediaRecoder方法里有没有什么属性能调用vaapi进行编码呢?

目前编码只支持 Windows,Mac,Android, Linux和ChromeOS的编码实现由于ChromeOS Media Team 认为存在版权问题,目前没有合入。此外 API 支持仅限于 WebCodecs API 和 WebRTC API,MediaRecorder API 目前没有Wire过去。

非常感谢,大佬nb!!!