标题:webEngine加载mp3 报错render_media_log.cc
作者:shixingya
日期:2018-11-08 16:08
内容:
Qt5.10.0VS2015 x86环境 ,webEngine加载mp3 报错如下
[16232:22712:1108/161553.555:ERROR:render_media_log.cc(30)] MediaEvent: PIPELINE_ERROR DEMUXER_ERROR_COULD_NOT_OPEN
ie
[16232:20608:1108/161553.558:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"FFmpegDemuxer: open context failed"}
大家有遇到过的,说一下解决办法
#1 [shixingya 11-09 18:26]
参考
https://www.pressc.cn/1044.html
nmake后报错
注意: 包含文件:../../3rdparty/chromium\sandbox/win/src/sandbox_rand.h
注意: 包含文件:../../3rdparty/chromium\sandbox/win/src/win_utils.h
../../3rdparty/chromium/sandbox/win/src/process_mitigations.cc(169): error C2039: “AllowThreadOptOut”: 不是“_PROCESS_MITIGATION_DYNAMIC_CODE_POLICY”的成员
C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um\winnt.h(11182): note: 参见“_PROCESS_MITIGATION_DYNAMIC_CODE_POLICY”的声明
../../3rdparty/chromium/sandbox/win/src/process_mitigations.cc(225): error C2039: “PreferSystem32Images”: 不是“_PROCESS_MITIGATION_IMAGE_LOAD_POLICY”的成员
C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um\winnt.h(11225): note: 参见“_PROCESS_MITIGATION_IMAGE_LOAD_POLICY”的声明
../../3rdparty/chromium/sandbox/win/src/process_mitigations.cc(249): error C2065: “THREAD_DYNAMIC_CODE_ALLOW”: 未声明 的标识符
../../3rdparty/chromium/sandbox/win/src/process_mitigations.cc(263): error C2065: “ThreadDynamicCodePolicy”: 未声明的 标识符
../../3rdparty/chromium/sandbox/win/src/process_mitigations.cc(385): error C2065: “PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_ALWAYS_ON_ALLOW_OPT_OUT”: 未声明的标识符
../../3rdparty/chromium/sandbox/win/src/process_mitigations.cc(390): error C2065: “PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_PREFER_SYSTEM32_ALWAYS_ON”: 未声明的标识符
........................
........................
........................
ninja: build stopped: subcommand failed.
NMAKE : fatal error U1077: “call”: 返回代码“0x1”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “(”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “cd”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “cd”: 返回代码“0x2”
Stop.
#2 [shixingya 11-09 18:30]
发现有人遇到了同样的问题 https://stackoverflow.com/questions/45070377/error-building-qt-for-visual-studio-ninja-build-stopped-subcommand-failed
#3 [shixingya 11-09 18:37]
好想要一个支持MP3播放的 QWebEngine呀, 有兄弟用VS2015编译好的吗,要5.10.0版本
#4 [shixingya 11-14 09:56]
https://bugreports.qt.io/browse/QTBUG-71764
问题在这里进行跟进 ,需要Updata系统SDK版本:
Hmm. Interesting. This MSDN page indicated that it should exist, but looking at the relevant line in winnt.h indicated otherwise:
typedef struct _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY {
union {
DWORD Flags;
struct {
DWORD ProhibitDynamicCode : 1;
DWORD ReservedFlags : 31;
} DUMMYSTRUCTNAME;
} DUMMYUNIONNAME;
} PROCESS_MITIGATION_DYNAMIC_CODE_POLICY, *PPROCESS_MITIGATION_DYNAMIC_CODE_POLICY;
So it seems like the Chromium code is trying to use stuff not available in the Windows SDK version it's being compiled towards... This CEF page mentions 10.0.10586, which is the version I have, but this CEF page talks about 10.0.15063 (and Visual Studio 2017, whereas the first one talks about VS2015!)
Reading more: This Chromium page (https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md) indicated that VS2017 is indeed required, and we need the Windows SDK 10.0.15063 or newer. Alright, let's switch back to the Win10 VM where I have VS2017 and let's check the Windows SDK version listed there.
现在我的QtWebEngine已经可以播放MP3 大家需要编译好的库,可以加我微信;