docker Windows容器中的无头Chrome失败,即使使用--headless开关,也需要DXAVDA dll

vpfxa7rd  于 2023-03-01  发布在  Docker
关注(0)|答案(3)|浏览(215)

我尝试在Windows容器中运行chrome headless,但是chrome崩溃,说明它缺少一些DXVAVDA库。但是我传递了--disable-gpu标志,所以不确定为什么需要它们。有什么想法吗?容器运行在Windows Server 2019虚拟机上

docker run -it mcr.microsoft.com/windows/servercore:ltsc2019 powershell

然后在容器中安装巧克力和 chrome

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install googlechrome -y

然后运行 chrome 无头

& 'C:\Program Files\Google\Chrome\Application\chrome.exe' --headless --disable-gpu --enable-logging --v=1 --dump-dom https:\\www.chromestatus.com

PS C:\> [0211/141947.811:ERROR:network_change_notifier_win.cc(226)] WSALookupServiceBegin failed with: 0
[0211/141947.865:VERBOSE1:webrtc_internals.cc(117)] Could not get the download directory.
[0211/141947.879:VERBOSE1:media_stream_manager.cc(873)] MSM::InitializeMaybeAsync([this=00006DDE0028DF80])
[0211/141947.881:VERBOSE1:media_stream_manager.cc(873)] MDM::MediaDevicesManager()
[0211/141947.882:VERBOSE1:media_stream_manager.cc(873)] MSM::MediaStreamManager([this=00006DDE0028DF80]))
[0211/141948.048:ERROR:dxva_video_decode_accelerator_win.cc(1461)] DXVAVDA fatal error: could not LoadLibrary: mf.dll: The specified module could not be found. (0x7E)
[0211/141948.051:ERROR:dxva_video_decode_accelerator_win.cc(1461)] DXVAVDA fatal error: could not LoadLibrary: mfplat.dll: The specified module could not be found. (0x7E)
[0211/141948.055:ERROR:dxva_video_decode_accelerator_win.cc(1461)] DXVAVDA fatal error: could not LoadLibrary: ms
llew8vvj

llew8vvj1#

我有同样的错误,这消失后,我添加了这个chrome命令行参数:

--disable-software-rasterizer
ruarlubt

ruarlubt2#

我在Windows 10 Enterprise N(一个臭名昭著的不包括“媒体相关技术”的版本)上运行chromedriver时遇到了同样的DXVAVDA丢失库错误。然后我安装了Windows 10 N的媒体功能包(2019年5月),在这里找到(https://support.microsoft.com/en-us/topic/media-feature-pack-for-windows-10-n-may-2019-e3b42214-1186-503a-4f57-0e8d538bc025),这些错误消失了。

8wigbo56

8wigbo563#

这是由于2019核心基础映像中缺少字体。请查看this repo了解如何安装缺少的字体

相关问题