在 Windows 上的 QtWebEngine 中制作 mp4/h264 视频 [英] Make mp4/h264 video work in QtWebEngine on Windows

查看:21
本文介绍了在 Windows 上的 QtWebEngine 中制作 mp4/h264 视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将 QtWebEngine 实例指向 html5 测试页面时 (http://www.quirksmode.org/html5/tests/video.html) 我看到了 WebM 视频和 Theora 视频,但没有看到 H.264/MP4.

When I point the QtWebEngine instance at a html5 test page (http://www.quirksmode.org/html5/tests/video.html) I see the WebM video, the Theora video, but not H.264/MP4.

为 Qt5 启用 mp4/mpeg4/avc 支持Linux 上的 WebEngine 说要从源代码构建 qtwebengine,所以我正在构建所有东西.

Enabling mp4/mpeg4/avc support for Qt5 WebEngine on Linux said to build qtwebengine from source, so I'm building everything.

我下载了这个源包:http://download.qt.io/official_releases/qt/5.5/5.5.0/single/qt-everywhere-opensource-src-5.5.0.zip

我按照其他依赖项的说明进行操作,然后尝试使用以下命令进行构建:

I followed the directions for other dependencies, and then tried building with these commands:

configure -prefix %QT_ROOT%uild -opengl dynamic -release -nomake examples -opensource -confirm-license  -qt-libpng -qt-libjpeg -openssl -qt-pcre -no-cups -no-dbus -skip qtwebkit -skip qtconnectivity -skip qtdoc -skip qtgraphicaleffects -skip qtsensors -skip qtserialport -skip qtwebkit-examples -skip qtquick1 -skip qt3d -skip qtwebengine
nmake
nmake install
cd qtwebengine
..uildinqmake WEBENGINE_CONFIG+=use_proprietary_codecs qtwebengine.pro
nmake
nmake install

然后,当我针对我的新版本构建 Web 浏览器示例时,我得到与以前相同的结果.当我试图寻找它是否构建了编解码器的证据时,我看到 ffmpegsumo.dll 已创建.我在 javascript 控制台中没有看到关于此的错误.我已经在 quicksmode 之外的其他测试网页上进行了测试,但也没有结果.

Then when I build the web browser example against my new build, I get the same results as before. When I try to look for evidence that it did or didn't build the codecs, I see that ffmpegsumo.dll was created. I see no errors in the javascript console about this. I've tested with other test web pages beyond quicksmode and no results there either.

推荐答案

我的解决方案是升级到 Qt 5.6.1.否则,我按照原始问题中的说明进行操作,这次得到了有效的结果.最值得注意的是,qmake WEBENGINE_CONFIG+=use_proprietary_codecs 确实确认它正在检查和配置 h264 和 mp3.

My solution was to upgrade to Qt 5.6.1. Otherwise, I followed the directions in the original question and this time got a working result. Most notable, the qmake WEBENGINE_CONFIG+=use_proprietary_codecs did confirm it was checking and configuring h264 and mp3.

这篇关于在 Windows 上的 QtWebEngine 中制作 mp4/h264 视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆