A guide that teach you build a custom version of chromium on macOS/Windows/Linux that supporting hardware/software HEVC decoding.

Overview

enable-chromium-hevc-hardware-decoding

A guide that teach you build a custom version of chromium on macOS/Windows/Linux that supports hardware/software HEVC decoding.

Get release build?

Get the prebuilt release here: https://github.com/StaZhu/enable-chromium-hevc-hardware-decoding/releases/tag/103.0.5011.0

What's the supported HEVC profile?

Hardware Decoding Support

  1. HEVC Main (Up to 8192x8192 pixels)
  2. HEVC Main10 (Up to 8192x8192 pixels)

Software Decoding Support

Actually all the profile that FFmpeg supports should be supported here, like:

  1. HEVC Main Still Picture
  2. HEVC Rext
  3. HEVC SCC

What's the OS requirement?

Hardware Decoding Requirement

macOS 11.0+

Windows 8+

Linux + Vaapi (Not tested)

Software Decoding Requirement

All OS. like Windows 7, macOS 10.12, etc...

HDR Supports? (Compared with Edge/Safari)

PQ (SDR Screen) PQ (HDR Screen) HLG (SDR Screen) HLG (HDR Screen)
Chromium macOS
Chromium Windows
Chromium Linux Not Tested Not Tested Not Tested Not Tested
Edge Windows
Safari macOS

How to verify HEVC hardware support is enabled?

  1. Open chrome://gpu, and search Video Acceleration Information, you should see Decode hevc main field and Decode hevc main 10 field present if hardware decoding is supported.
  2. Open chrome://media-internals and play some HEVC video if the decoder is VDAVideoDecoder or D3D11VideoDecoder or VaapiVideoDecoder that means the video is using hardware decoding, and if the decoder is FFMpegVideoDecoder that means the video is using software decoding.
  3. Open Activity Monitor on Mac and search VTDecoderXPCService, if the cpu usage larger than 0 when playing video, that means hardware decoding is being used.
  4. Open Windows Task Manager on Windows and switch to Performance -GPU, if Video Decoding usage larger than 0 when playing video, that means hardware decoding is being used.

How to Build?

  1. Follow the official build doc https://www.chromium.org/developers/how-tos/get-the-code/ to prepare the build environment then fetch the source code in main branch.
  2. To enable software decoding feature, you can patch enable-chromium-hevc-hardware-decoding.diff to src/third_party/ffmpeg . (Optional) if node.js has been installed on your machine, then you can copy enable-chromium-hevc-hardware-decoding.js to the root dir (the parent dir of src folder) and run node enable-chromium-hevc-hardware-decoding.js without those manual steps.
  3. (Optional) If you need HEVC range extension profile software decoding ability, you can patch release-decoder-switch-limit.diff to src to make sure HEVC Rext profile can be properly demuxed and software decoded.
  4. (Optional) If you don't like those chrome switch passing, patch release-clear-hevc-testing-limit.diff and release-decoder-switch-limit.diff to build a non-params passing version.
  5. If you are using x64 arch cpu, run gn gen out/Release64 --args="is_component_build = false is_official_build = true is_debug = false symbol_level = 1 enable_nacl = false blink_symbol_level = 0 v8_symbol_level = 0 ffmpeg_branding = \"Chrome\" target_cpu = \"x64\" proprietary_codecs = true media_use_ffmpeg = true enable_platform_encrypted_hevc = true enable_platform_hevc = true enable_platform_hevc_decoding = true", you can change target_cpu to x86 , arm64 , arm if you want to build other cpu archs.
  6. Run autoninja -C out/Release64 chrome to start the build.
  7. Run ./out/Release64/Chromium.app/Contents/MacOS/Chromium --args --enable-clear-hevc-for-testing --enable-features=VideoToolboxHEVCDecoding to open chromium if you are using macOS.
  8. Create a desktop shortcut and passing the args like C:\Users\Admin\Desktop\Chromium\chrome.exe --enable-clear-hevc-for-testing --enable-features=D3D11HEVCDecoding then double click the desktop shortcut to open chromium if you are using Windows.

Change Log

2022-4-21 Add Crbug trace

2022-4-20 Modify readme

2022-4-19 Initial commit

Trace Crbug

Windows: https://crbug.com/1286132

macOS: https://crbug.com/1300444

License

MIT

Comments
  • 无法播放hevc mkv

    无法播放hevc mkv

    感谢

    浏览器支持HEVC是一个划时代的进步。感谢!

    代码

    <body bgcolor=#000000>
    <p align=center>
    <video controls="controls" autoplay>
    <source src="TearsOfSteel_720p_h265.mkv" type="video/mp4">
    </video>
    </p>
    </body>
    

    现象

    黑屏。换H.264的mkv文件,可以正常播放。

    平台

    1. Win11最新版
    2. Chrome最新版

    问题

    1. 现在用--enable-features=PlatformHEVCDecoderSupport能不能播放hevc mkv?
    2. 如果不能,那么什么时候能?
    opened by jim-king-2000 82
  • Linux 所有 hevc 视频无法硬解

    Linux 所有 hevc 视频无法硬解

    测试页的视频都可以软解播放,但是 CPU 占用很高,decoder 占用始终为 0。 测试过使用如下参数:--use-gl=desktop --enable-features=VaapiVideoDecoder --disable-features=UseChromeOSDirectVideoDecoder 加和不加都不能硬解。 显卡:NVIDIA 1660s 系统:Arch Linux 最新 kernel 5.17.7 驱动:nvidia 510.68.02-3 libva-vdpau-driver-vp9-git r57.509d3b2-4

    opened by skbeh 27
  • Support HEVC with Alpha

    Support HEVC with Alpha

    一直以来,H.264 不具备 Alpha 通道的能力,在网页中有很多场景需要半透明的视频,例如:类似于剪映的视频剪辑工具。

    过去,我们只能选择 VP8/VP9 编码,但由于其兼容性不佳,极大的制约了 Alpha 视频的应用。

    我测试了最新的 Chrome canary(Mac),似乎还不支持带有 Alpha 通道 HEVC 视频,Safari 中可以播放:

    <video autoplay controls src="https://rotato.netlify.app/alpha-demo/movie-hevc.mov"></video>
    
    data:text/html;charset=UTF-8,<body style="background: pink;"><video autoplay controls src="https://rotato.netlify.app/alpha-demo/movie-hevc.mov"></video>
    
    opened by yisibl 23
  • intel 核显 Iris Xe 在 Canary 107  中无法正确回放 HDR 内容

    intel 核显 Iris Xe 在 Canary 107 中无法正确回放 HDR 内容

    使用 Chrome 的时候偶然遇到播放HEVC HDR内容时,浏览器窗口闪烁的问题,由于我对 Chrome 和 Chromium 当前的开发情况不是很熟悉,遂来此向作者询问相关问题。

    本 issue 针对 Chrome Beta/Dev/Canary 及 Chromium latest build ,本仓库 Release latest 共五个版本进行测试。


    测试1

    版本:版本 107.0.5286.2(正式版本)dev (64 位)

    启动参数:无

    Video Acceleration Information: 无HEVC支持 image

    实际测试:

    • 测试页无法正确播放,表现为仅音频模式
    • bilibili强制使用HEVC,回报使用DashPlayer + WasmPlayer

    启动参数:--enable-features=PlatformHEVCDecoderSupport

    Video Acceleration Information: HEVC硬解正确支持 image

    实际测试:

    • 测试页部分正确播放,HDR内容(HLG,PQ)表现为整个浏览器窗口闪烁,视频窗口闪过紫色后变黑。
    • bilibili强制使用HEVC,回报使用DashPlayer + WasmPlayer

    测试2

    版本:版本 107.0.5293.0(正式版本)canary (64 位)

    有无启动参数表现均与测试一相同

    测试3

    版本:版本 107.0.5294.0(开发者内部版本) (64 位)

    启动参数:无

    Video Acceleration Information: 无HEVC支持 image

    实际测试:

    • 测试页无法正确播放,也不可仅播放音频 image
    • bilibil无法加载播放器?

    启动参数:--enable-features=PlatformHEVCDecoderSupport

    Video Acceleration Information: 无HEVC支持 image

    实际测试同无启动参数

    测试4

    版本:版本 106.0.5211.0(正式版本) (64 位) 本仓库 release 的 最新版

    启动参数:无

    Video Acceleration Information: HEVC硬解正确支持 image

    实际测试:

    • 测试页部分正确播放,HDR内容(HLG,PQ)表现为整个浏览器窗口闪烁,视频窗口闪过紫色后变黑。
    • bilibili强制使用HEVC,回报使用DashPlayer,任务管理器回报 Video Decode 不为 0, Video Decode 1 为0

    启动参数:--enable-features=PlatformHEVCDecoderSupport

    Video Acceleration Information: HEVC硬解正确支持 image

    实际测试:

    • 测试页部分正确播放,HDR内容(HLG,PQ)表现为整个浏览器窗口闪烁,视频窗口闪过紫色后变黑。
    • bilibili强制使用HEVC,回报使用DashPlayer,任务管理器回报 Video Decode 为 0,Video Decode 1 不为0

    由于我正在使用 Chrome Beta 编写此 issue,故该通道的表现将在稍后补充。目前来看 Chrome Beta 的表现与测试4的表现较为一致

    另外我留意到了这个提交 https://chromium-review.googlesource.com/c/chromium/src/+/3833477 想询问一下这项提交是否与HEVC硬解支持相关


    系统基础信息:

    Windows 11 Professional Insider Preview 
    Build 25197.rs_prerelease.220902-1559
    

    CPU&GPU:

    12th Gen Intel(R) Core(TM) i5-12500H (16 CPUs)
    Intel(R) Iris(R) Xe Graphics (驱动程序版本:30.0.101.1368)
    Monitor Capabilities: HDR Supported (BT2020RGB Eotf2084Supported )
    
    opened by Ink-33 14
  • 没有HEVC,只有VP9的8K呢

    没有HEVC,只有VP9的8K呢

    你好, 我编译了Chrome,版本 110.0.5439.0(正式版本) (64 位),显示 Video Acceleration Information Decoding Decode h264 baseline 64x64 to 4096x4096 pixels Decode h264 main 64x64 to 4096x4096 pixels Decode h264 high 64x64 to 4096x4096 pixels Decode vp9 profile0 64x64 to 8192x8192 pixels Decode vp9 profile2 64x64 to 8192x8192 pixels Encoding Encode h264 baseline 32x32 to 1920x1088 pixels, and/or 30.000 fps Encode h264 main 32x32 to 1920x1088 pixels, and/or 30.000 fps Encode h264 high 32x32 to 1920x1088 pixels, and/or 30.000 fps

    怎么没有HEVC的解码呢?我试了N卡和A卡,都是没有,官方装的107就有,应该不是显卡或者驱动有啥问题了。 是不是编译时还需要修改什么?我只合入了开启Windows、Mac默认的那个patch,就是修改了一句话拿个patch。

    opened by shark-dynamics 10
  • Chrome 107是否会默认开启Webcodecs的hevc支持

    Chrome 107是否会默认开启Webcodecs的hevc支持

    背景: 目前公司用的http-flv,看到Chrome Canary终于支持hevc,所以想撸一个基于Webcodecs转码的flv播放器。

    困境: 但目前Chrome的Video Element硬解是需要改启动参数,对终端用户实在不是很友好。

    1. 请问下Chrome 107是否会默认开启Webcodecs的hevc支持
    2. Video Element的硬解的默认支持是否有计划

    以上,十分感谢!

    opened by auningzzz 5
  • HLG tone-mapping相关问题

    HLG tone-mapping相关问题

    Windows 11 22H2 22621.675 RTX 2060 517.48 Chrome dev 108.0.5359.10

    问题:HDR下打开HLG视频的颜色 与 SDR下打开HLG视频随后切换到HDR显示 不同 测试视频:https://lf-tk-sg.ibytedtos.com/obj/tcs-client-sg/resources/hevc_4k25P_main10_2.mp4 问题图片:(截图存在过曝现象,但还是可以看出颜色不同) HDR下打开该视频: image SDR下打开该视频,然后开启HDR显示: image 第二个看起来像蒙了一层雾 另外edge 108.0.1438.1 dev没有这个问题,两种情况都与第一张图片的效果一致

    opened by lns103 4
  • HEVC硬解在双显卡笔记本上始终使用集显

    HEVC硬解在双显卡笔记本上始终使用集显

    不知道是不是合适在这里问,先尝试一下。 我的笔记本是ThinkPad P1 Gen3,是Quadro T1000独显直出和Intel i7-10750H的集显,Win10 21H2平台,Chrome 106.0.5249.62 (Official Build) (64-bit) (cohort: Stable Installs & Version Pins) Chrome打开了flag,确认HEVC是走硬解的。 播放 https://www.bilibili.com/video/BV11e4y1r7zM 这个视频4K版本,能看到编码用的也是hev1 image 使用外接显示器在Chrome里全屏播放,发现此时解码是用集显在解,图里Video Decode达到80%,同时也有30%左右的3D消耗 image 而独显只有3D这一项的消耗,其余都是0 image


    把视频下载下来用PotPlayer播放: 放外接显示器上,能看到解码全部用了独显,PotPlayer的设备也是独显 image image image 换到笔记本内置显示器上,能看到解码全走了集显,PotPlayer的设备也是集显 image image image


    所以应该是可以在外接显示器上播放的时候,使用独显进行解码的,所以比较奇怪Chrome的行为。

    opened by ayanamist 4
  • HEVC hardware decode support not surfaced for WebRTC media streams?

    HEVC hardware decode support not surfaced for WebRTC media streams?

    Running Chrome Canary 105 with the --enable-feature=PlatformHEVCDecoderSupport commandline parameter, I still don't see the HEVC decode capability being announced by WebRTC: image

    Is the HEVC decode support limited to MSE APIs, or will it make it into WebRTC media streams as well?

    Thanks!

    opened by Diego-Perez-Botero 4
  • Rebase

    Rebase

    @StaZhu Hi its alex again. Can you rebase your patches for the latest ffmpeg. They did a commit here that made it where the patches wont work anymore because they are off by like a line. > https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+/0564e9eec5a741b52804f06c56446cfee582f5cb

    opened by Alex313031 3
  • win11 更新到版本 107.0.5303.0(正式版本)canary (64 位),chrome://gpu/页面没有hevc支持

    win11 更新到版本 107.0.5303.0(正式版本)canary (64 位),chrome://gpu/页面没有hevc支持

    看到readme里面说107.0.5300.0 后会默认支持hevc不用加enable参数,下载了个canary试了一下,发现chrome://gpu/里面没有默认支持hevc,实测也是不支持,同一台设备之前104版本加上enable后,chrome://gpu/可以看到hevc,并且实测也是支持的

    opened by sunjun 3
  • VulkanVideo HEVC

    VulkanVideo HEVC

    https://www.khronos.org/blog/khronos-finalizes-vulkan-video-extensions-for-accelerated-h.264-and-h.265-decode 未来也许可以使用 VulkanVideo 作为 Chromium 的跨平台、跨供应商的硬解实现? 优点:

    1. 目前 Chromium 的 HEVC 硬解实现有 D3D11VA 、MediaCodec 、VideoToolbox 、VAAPI,使用 VulkanVideo 可以实现通用的硬解。
    2. Chromium Windows 目前开启 chrome://flags/#enable-vulkan 会导致 D3D11VA 硬解异常,--use-angle=vulkan 会彻底破坏硬解。
    3. Chromium Linux 目前使用 VAAPI ,NVIDIA GPU 需要安装额外的包,部分发行版的驱动软件包不支持 VAAPI 硬解解码,而 VulkanVideo 只要存在 Vulkan 驱动程序就可以使用。
    4. Chromium Windows NVIDIA GPU可能实现 HEVC Rext 硬解解码
    5. Linux ANI 三家的 Vulkan 驱动程序都已实现 VulkanVideo。

    缺点:

    1. VulkanVideo 作为最近发布的 Vulkan 扩展,尚未得到广泛实施,MoltenVK 目前无计划支持,Qualcomm 目前仅有 Adreno700 系列 GPU 提供 Vulkan 1.3,MediaTek 目前仅有天玑 9200 支持 Vulkan 1.3,且暂不确定 ARM/Qualcomm 是否会为其驱动实现 VulkanVideo。因此需要为 Android、macOS 提供基于 MediaCodec、VideoToolbox 的回退实现。
    opened by arm64-v9a 1
Releases(110.0.5428.0)
Owner
Sta Zhu
Sta Zhu
🆙 Upscayl - Free and Open Source AI Image Upscaler for Linux, MacOS and Windows built with Linux-First philosophy.

Upscayl ?? Free and Open Source AI Image Upscaler Upsacyl.Demo.mp4 Upscayl is a cross-platform application built with the Linux-first philosophy. This

Upscayl 5.1k Sep 21, 2022
Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Inter Process Communication Module for node supporting Unix sockets, TCP, TLS, and UDP. Giving lightning speed on Linux, Mac, and Windows. Neural Networking in Node.JS

Node IPC 43 Dec 9, 2022
Hacker Tools cross-platform desktop App, support windows/MacOS/LInux ....

Hacker Tools cross-platform desktop App, support windows/MacOS/LInux ....

51pwn 29 Jan 8, 2023
🎛 Desktop application (Windows / macOS / Linux) for Home Assistant built with Electron

Home Assistant - Desktop Desktop App (Windows / macOS / Linux) for Home Assistant built with Electron Installation Just download the latest version fo

Pheelix 12 Dec 11, 2022
Next-level academia! Repository for the Native Overleaf project, attempting to integrate Overleaf with native OS features for macOS, Linux and Windows.

Native Overleaf Overleaf is a fantastic webtool for writing and cooperating on LaTeX documents. However, would it not be even better if it were to beh

Floris-Jan Willemsen 40 Dec 18, 2022
A modern ebook manager and reader with sync and backup capacities for Windows, macOS, Linux and Web

简体中文 | English Koodo Reader A cross-platform ebook reader Download | Preview | Roadmap | Document Preview Feature Format support: EPUB (.epub) Scanned

Troye Guo 8.6k Dec 29, 2022
🎛 Desktop application (Windows / macOS / Linux) for Home Assistant built with Electron

Home Assistant - Desktop Desktop App (Windows / macOS / Linux) for Home Assistant built with Electron Installation Just download the latest version fo

Ivan Prodanov 4 Sep 22, 2022
How often do you get asked about the gadgets or software that you use? If the answer is quite often, you should be trying show off out. Curate the list of gadgets and software and share it with your fans and followers.

Show Off - Showcase your setup! How often do you get asked about the gadgets or software that you use? If the answer is quite often, you should be try

Adithya Sreyaj 15 Nov 24, 2022
Makes Base64 en & -decoding simpler as it is.

jQuery.base64.js (feel free to write a bit about it) You can check for btoa and atob support and refer to jQuery.base64 if (!window.btoa) window.btoa

Yannick Albert 120 Sep 23, 2022
An Anime Game launcher for Linux with automatic patching fixing detection of Linux/Wine and telemetry disabling

An Anime Game launcher for Linux with automatic patching fixing detection of Linux/Wine and telemetry disabling

An Anime Team 367 Jan 4, 2023
An open-source, blazing fast code editor for Windows, Mac, and Linux.

Thermite An open-source, blazing fast code editor for Windows, Mac, and Linux. About Thermite is a Blazing Fast, Open-Source, Cross-Platform Code Edit

Keston 4 Oct 25, 2022
Requestly Desktop App (Mac, Linux, Windows)

Requestly Desktop App Requestly Desktop App. Debug your network request across all apps (Safari, Chrome, Firefox, Brave...) using a single app. Direct

Requestly 14 Jan 2, 2023
Edrys is an open-source app that helps you teach remotely.

The Open Remote Teaching Platform ?? Join our newsletter for updates & community showcases! Edrys is an open-source app that helps you teach remotely.

Edrys 236 Dec 13, 2022
This is an unofficial front end for Hacker News, reminiscent of the Windows XP era Outlook email client on a Windows XP default desktop

Hacker XP Hacker News styled as the Windows XP Outlook email client. Try out Hacker XP here! Description This is an unofficial front end for Hacker Ne

null 19 Jul 12, 2022
A table component for your Mantine data-rich applications, supporting asynchronous data loading, column sorting, custom cell data rendering, row context menus, dark theme, and more.

Mantine DataTable A "dark-theme aware" table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagina

Ionut-Cristian Florescu 331 Jan 4, 2023
Kuldeep 2 Jun 21, 2022
Seamless and lightweight parallax scrolling library implemented in pure JavaScript utilizing Hardware acceleration for extra performance.

parallax-vanilla.js Seamless and lightweight parallax scrolling library implemented in pure JavaScript utilizing Hardware acceleration for extra perfo

Erik Engervall 91 Dec 16, 2022
An IoT bottle that tracks water consumption. Winner of Best Health Hack, MLH's Best Hardware Hack, and QB3's Best Big Data for the Improvement of Health Care Winner at CruzHacks 2022.

An IoT bottle that tracks water consumption. Winner of Best Health Hack, MLH's Best Hardware Hack, and QB3's Best Big Data for the Improvement of Health Care Winner at CruzHacks 2022.

Nathanael Garza 2 Jan 21, 2022
Custom touch bar or digital macropad app for GNU/Linux 🐧 using an Android device 📱

?? Boar ??️ Custom touch bar or digital macropad app for GNU/Linux ?? using an Android device ?? Those apps allow creating a keyboard with custom keys

Fabián Velosa 0 Oct 29, 2022