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硬解码报错 #68

Closed Dreaming-in-Gottingen closed 3 months ago

Dreaming-in-Gottingen commented 3 months ago

hi,朱老师,请教一些问题,谢谢! 我下载了你释放的chromium_110.0.5428.0_linux_x64_with_hevc_hw_decode_encode_support.deb在Linux平台运行,显卡试了intel 12集成显卡和摩尔线程的显卡,期望浏览器使用上硬解加速,试之前我也确认了vainfo正常,mpv能正常用硬解。

起浏览器的命令为:chromium-browser-stable --enable-accelerated-video-decode --enable-features=VaapiVideoDecoder,VaapiVideoDecodeLinuxGL /path/to/input_x265.mp4 --enable-logging=stderr --v=3 > sta_v110.log 2>&1

但是硬解没用起来,报错如下:

19817 [2351008:2351079:0321/185134.305228:VERBOSE2:vaapi_video_decoder.cc(144)] VaapiVideoDecoder():
 19818 [2350962:2350993:0321/185134.305303:VERBOSE1:media_stream_manager.cc(1100)] AMB::MakeAudioOutputStream({device_id=}, {params=[format: PCM_LOW_LATENCY, channel_layout:3, channels: 2, sample_rate: 44100, frames_per_buffer: 1024, effects: 128, mic_positions: ]})
 19819 [2350962:2350993:0321/185134.305322:VERBOSE1:media_stream_manager.cc(1100)] PAOS::PulseAudioOutputStream({device_id=default}, {params=[format: PCM_LOW_LATENCY, channel_layout: 3, channels: 2, sample_rate: 44100, frames_per_buffer: 1024, effects: 128, mic_positions: ]}) [this=0x564a303ce820]
 19820 [2350962:2350993:0321/185134.305329:VERBOSE1:media_stream_manager.cc(1100)] AMB::MakeAudioOutputStream => (number of streams=1)
 19821 [2350962:2350993:0321/185134.305335:VERBOSE1:media_stream_manager.cc(1100)] PAOS::Open() [this=0x564a303ce820]
 19822 [2351008:2351079:0321/185134.306456:VERBOSE2:vaapi_video_decoder.cc(613)] ApplyResolutionChange():
 19823 [2351008:2351079:0321/185134.306508:VERBOSE2:vaapi_video_decoder.cc(640)] ApplyResolutionChangeWithScreenSizes():
 19824 [2351008:2351008:0321/185134.309324:ERROR:shared_image_factory.cc(575)] Could not find SharedImageBackingFactory with params: usage: DisplayRead|Scanout, format: YUV_420_BIPLANAR, share_between_threads: 0, gmb_type: platform
 19825 [2351008:2351008:0321/185134.309471:ERROR:shared_image_stub.cc(147)] SharedImageStub: Unable to create shared image
 19826 [2351008:2351008:0321/185134.311173:VERBOSE1:mailbox_video_frame_converter.cc(557)] OnError(): (GenerateSharedImageOnGPUThread@media/gpu/chromeos/mailbox_video_frame_converter.cc:467) Failed to create shared image.
 19827 [2351008:2351008:0321/185134.311230:VERBOSE1:mailbox_video_frame_converter.cc(557)] OnError(): (GenerateSharedImageOnGPUThread@media/gpu/chromeos/mailbox_video_frame_converter.cc:425) InitializeOnGPUThread failed
 19828 [2351008:2351008:0321/185134.311278:VERBOSE1:mailbox_video_frame_converter.cc(557)] OnError(): (GenerateSharedImageOnGPUThread@media/gpu/chromeos/mailbox_video_frame_converter.cc:425) InitializeOnGPUThread failed
 19829 [2351008:2351008:0321/185134.311320:VERBOSE1:mailbox_video_frame_converter.cc(557)] OnError(): (GenerateSharedImageOnGPUThread@media/gpu/chromeos/mailbox_video_frame_converter.cc:425) InitializeOnGPUThread failed
 19830 [2351008:2351079:0321/185134.311951:VERBOSE1:video_decoder_pipeline.cc(675)] OnError(): Frame converter returns null frame.

这个报错在intel的集显和摩尔的独显上都出现,感觉像是解码后的nv12图像要共享出去(这个版本的是先软转到rbga格式,v115后的好像显卡驱动内部做vdec->vpp出rgb格式图像),再与进度条/窗口那些再合成。 这种问题该怎么处理?

StaZhu commented 3 months ago

Sorry for the delay response, did you try Chromium 124 to see if it has been fixed?

From my context here, making Chromium properly using HW decoding on Linux out of box is not easy.

Dreaming-in-Gottingen commented 3 months ago

Chromium v124可以正常硬解了,感谢~

StaZhu commented 3 months ago

Okey :)