简体   繁体   English

在Linux上为Qt5 WebEngine启用mp4 / mpeg4 / avc支持

[英]Enabling mp4/mpeg4/avc support for Qt5 WebEngine on Linux

i installed Qt 5.4.1 x64 on LUbuntu and created an app which uses the new QtWebEngine. 我在LUbuntu上安装了Qt 5.4.1 x64,并创建了一个使用新QtWebEngine的应用程序。

I`m trying to display a html5 page with that component which is using the tag. 我正在尝试显示使用该标签的组件的html5页面。 All works fine except if I try to playback a mp4 video. 一切正常,除非我尝试播放mp4视频。 The video area remains black. 视频区域保持黑色。 It works if I use other video types like webm/ogg as source. 如果我使用其他视频类型(例如webm / ogg)作为源,则可以使用。

I know this is due to license restrictions, so that mp4 is deactivated by default in Ubuntu/Linux for Qt. 我知道这是由于许可证限制所致,因此在Ubuntu / Linux for Qt中默认禁用mp4。

What is needed in Qt to activate it to allow mp4 playback and on what do I have pay attention in case of license terms (I read that statically linking the library is allowed?) ? Qt需要什么才能激活它以允许mp4播放,以及在许可条款的情况下需要注意什么(我读到允许静态链接库?)?

I`ve already tried to copy over the x64 distribution of libffmpegsuo.so which is included in Chrome (2,2Mb) over to the Qt directory to /plugins/webengine/ and replaced that one that was already there (1,1 Mb) but it had no effect. 我已经尝试过将Chrome中包含的libffmpegsuo.so的x64发行版(2,2Mb)复制到Qt目录中的/ plugins / webengine /中,并替换已经存在的那个(1,1 Mb)但是没有效果。 In Chrome playback works fine btw. 在Chrome播放中顺便说一句。

If you need more details like paths etc. please tell me. 如果您需要更多详细信息,例如路径等,请告诉我。

Thanks ! 谢谢 !

You can explicitly enable proprietary codecs (H264, MP3) when compiling Qt WebEngine: 您可以在编译Qt WebEngine时显式启用专有编解码器(H264,MP3):

In /path-to-qt-src-dir/qtwebengine execute: 在/ path-to-qt-src-dir / qtwebengine中执行:

qmake WEBENGINE_CONFIG+=use_proprietary_codecs

You should be able to see in the output that H264 codec is enabled, which is not the default configuration. 您应该能够在输出中看到已启用H264编解码器,这不是默认配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM