前言

由于H265专利费用问题,Chrome浏览器并没有支持软解码。在105版本以后,Chrome浏览器通过调用硬件(CPU的集成显卡或者英伟达的独立显卡)的API接口,实现硬解码,绕过了专利费用的问题。


检测硬件是否支持HEVC硬件解码

需要使用DXVAChecker检测软件

下载链接

https://bluesky-soft.com/en/DXVAChecker.html

Chrome 开启HEVC硬件解码_Chrome 开启HEVC硬件解码


浏览器配置

1 打开帮助->关于,查看版本号是否大于104

2 地址栏输入chrome://settings,搜索硬件加速, 使用硬件加速开启

出现如图,说明没有执行这一步

Chrome 开启HEVC硬件解码_Chrome 开启HEVC硬件解码_02

3 地址栏输入chrome://flags,搜索hardware,启用Hardware-accelerate video decode硬件解码

4 创建Chrome快捷方式,鼠标右键点击属性,添加启动运行参数:

--enable-features="PlatformHEVCDecoderSupport" (切记--前面空格)

5通过快捷方式打开,地址栏输入chrome://gpu,搜索Video Acceleration,验证Chrome是否启动成功

Chrome 开启HEVC硬件解码_Chrome 开启HEVC硬件解码_03

6硬件支持

Chrome 开启HEVC硬件解码_Chrome 开启HEVC硬件解码_04

出现如图的提示,需要搜索Problems Detected,查看相关的检测问题

*   Some drivers are unable to reset the D3D device in the GPU process sandbox
    Applied Workarounds: exit_on_context_lost

*   Unpacking overlapping rows from unpack buffers is unstable on NVIDIA GL driver:
    (http://crbug.com/596774)
    Applied Workarounds: unpack_overlapping_rows_separately_unpack_buffer

*   Disable KHR_blend_equation_advanced until cc shaders are updated:
    (http://crbug.com/661715)
    Applied Workarounds: disable(GL_KHR_blend_equation_advanced),
        disable(GL_KHR_blend_equation_advanced_coherent)

*   Decode and Encode before generateMipmap for srgb format textures on Windows:
    (http://crbug.com/634519)
    Applied Workarounds: decode_encode_srgb_for_generatemipmap

*   Expose WebGL's disjoint_timer_query extensions on platforms with site isolation:
    (http://crbug.com/808744), (http://crbug.com/870491)
    Applied Workarounds: enable_webgl_timer_query_extensions

*   Per NVIDIA, software and hardware overlays don't work properly prior to this driver.:
    (http://crbug.com/911349), (http://crbug.com/1113893)
    Applied Workarounds: disable_direct_composition_video_overlays

*   Disable GL_MESA_framebuffer_flip_y for desktop GL:
    (http://crbug.com/964010)
    Applied Workarounds: disable(GL_MESA_framebuffer_flip_y)

*   Disable D3D11VideoDecoder due to crashes on NVIDIA on older drivers:
    (http://crbug.com/1041166)
    Applied Workarounds: disable_d3d11_video_decoder

*   Disable software overlays for Intel GPUs. All Skylake+ devices support hw overlays, older devices peform poorly.:
    (http://crbug.com/1192748)
    Applied Workarounds: disable_direct_composition_sw_video_overlays

*   Only enable video processor super resolution on Intel Gen10+ GPUs and NVIDIA GPUs with 530+ drivers:
    (http://crbug.com/1318380)
    Applied Workarounds: disable_vp_super_resolution

*   Disable hardware MFT Av1 encoder on machines with multiple GPUs except Intel alchemist GPUs:
    (http://crbug.com/1367038)
    Applied Workarounds: disable_accelerated_av1_encode

*   Disable VP9 HW encode on Intel GPUs preceding Ice Lake:
    (http://crbug.com/1217298), (http://crbug.com/1107331)
    Applied Workarounds: disable_accelerated_vp9_encode

*   Only enable video processor auto HDR on NVIDIA GPUs with 550.50+ driver:
    (http://crbug.com/1445741)
    Applied Workarounds: disable_vp_auto_hdr

*   Corruption when consecutive VP9 keyframes are requested from MFVEA on Intel.:
    (http://crbug.com/1473665)
    Applied Workarounds: avoid_consecutive_keyframes_for_vp9

里面的数据特别重要:

*   Disable D3D11VideoDecoder due to crashes on NVIDIA on older drivers:
    (http://crbug.com/1041166)
    Applied Workarounds: disable_d3d11_video_decoder

Chromium 使用 D3D11VideoDecoder 调用 D3D11VA (无需安装插件)完成硬解,和 VLC 等视频播放器用的解码器相同。如果提示上面的错误,说明需要更新显卡驱动


浏览器验证

直接拖拽一个H265编码格式的MP4文件到浏览器,可以播放,说明设置成功


参考

enable-chromium-hevc-hardware-decoding/README.zh_CN.md at main · StaZhu/enable-chromium-hevc-hardware-decoding · GitHub