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.24k stars 60 forks source link

下载了 chromium deb 版本, 在linux下并不能开启 hev 解码啊. #38

Closed nvd11 closed 1 year ago

nvd11 commented 1 year ago

已经下载UA插件把浏览器改成 Mac OS/safari

image

StaZhu commented 1 year ago

Linux 毛病多,即使显卡支持VAAPI,也不是开箱即用的。

愿意折腾可以自己折腾玩,这里不提供技术指导哈。

cherinyy commented 1 year ago

哔哩哔哩只会给 Linux 平台返回 AVC 源,要测试就打开测试页面/视频。

https://lf3-cdn-tos.bytegoofy.com/obj/tcs-client/resources/video_demo_hevc.html

https://lf3-cdn-tos.bytegoofy.com/obj/tcs-client/resources/hevc_main10.mp4

需要添加 --use-gl=egl

我这边遇到的情况的话,似乎调用了解码器,但是播放失败,点击播放按钮即刻变回暂停状态。

image

终端报错

➜  ~ google-chrome-unstable --use-gl=egl
[12904:12904:1208/233459.991241:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is 
[12904:12904:1208/233459.993566:ERROR:gl_display.cc(508)] EGL Driver message (Error) eglQueryDeviceAttribEXT: eglQueryDeviceAttribEXT
[12904:12904:1208/233459.993619:ERROR:gl_angle_util_vulkan.cc(189)] Failed to retrieve vkGetInstanceProcAddr
[12904:12904:1208/233459.993657:ERROR:vulkan_instance.cc(91)] Failed to get vkGetInstanceProcAddr pointer from ANGLE.
[12905:12919:1208/233500.613409:ERROR:ssl_client_socket_impl.cc(985)] handshake failed; returned -1, SSL error code 1, net_error -101
[12904:13043:1208/233502.374577:ERROR:vaapi_video_decoder.cc(1222)] failed Initialize()ing the frame pool
[12904:13053:1208/233508.952481:ERROR:vaapi_video_decoder.cc(1222)] failed Initialize()ing the frame pool
[12904:13055:1208/233509.565387:ERROR:vaapi_video_decoder.cc(1222)] failed Initialize()ing the frame pool
[12904:13057:1208/233510.070194:ERROR:vaapi_video_decoder.cc(1222)] failed Initialize()ing the frame pool
Google Chrome Dev 110.0.5449.0

Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]

OpenGL ES 3.2 Mesa 22.2.3
➜  ~ vainfo 
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.16 (libva 2.16.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.4.4 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
Video Acceleration Information
Decoding
Decode h264 baseline
16x16 to 4096x4096 pixels
Decode h264 main
16x16 to 4096x4096 pixels
Decode h264 high
16x16 to 4096x4096 pixels
Decode vp8
16x16 to 4096x4096 pixels
Decode vp9 profile0
16x16 to 8192x8192 pixels
Decode vp9 profile2
16x16 to 8192x8192 pixels
Decode hevc main
16x16 to 8192x8192 pixels
Decode hevc main 10
16x16 to 8192x8192 pixels
Decode hevc main still-picture
16x16 to 8192x8192 pixels

Log Messages
[13129:13129:1208/233607.313675:ERROR:gpu_init.cc(523)] : Passthrough is not supported, GL is egl, ANGLE is
[13129:13129:1208/233607.315270:ERROR:gl_display.cc(508)] : EGL Driver message (Error) eglQueryDeviceAttribEXT: eglQueryDeviceAttribEXT
[13129:13129:1208/233607.315356:ERROR:gl_angle_util_vulkan.cc(189)] : Failed to retrieve vkGetInstanceProcAddr
[13129:13129:1208/233607.315419:ERROR:vulkan_instance.cc(91)] : Failed to get vkGetInstanceProcAddr pointer from ANGLE.
[13129:13129:1208/233607.317065:WARNING:sandbox_linux.cc(385)] : InitializeSandbox() called with multiple threads in process gpu-process.