在Linux上为Qt5 WebEngine启用mp4 / mpeg4 / avc支持 [英] Enabling mp4/mpeg4/avc support for Qt5 WebEngine on Linux

查看:2449
本文介绍了在Linux上为Qt5 WebEngine启用mp4 / mpeg4 / avc支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在LUbuntu上安装了Qt 5.4.1 x64,并创建了一个使用新的QtWebEngine的应用程序。



我试图用该组件显示一个html5页面正在使用标签。
除非我尝试播放mp4视频,否则一切正常。视频区域保持黑色。如果我使用其他视频类型,如webm / ogg作为源代码,它可以工作。



我知道这是由于许可证限制,所以mp4默认在Ubuntu / Linux对于Qt。



Qt需要什么才能激活它以允许mp4播放,以及在许可条款的情况下我有什么注意事项(我读到静态链接图书馆被允许?)?



我已经尝试将Chrome(2,2Mb)中包含的libffmpegsuo.so的x64分发文件复制到Qt目录到/ plugins / webengine /并替换已经存在的那个(1,1 Mb),但没有效果。
Chrome浏览器播放效果很好btw。



如果您需要更多详细信息,例如路径等,请告诉我。


$ b $谢谢!

解决方案

您可以在编译Qt WebEngine时明确启用专有编解码器(H264,MP3):



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

  qmake WEBENGINE_CONFIG + = use_proprietary_codecs 

您应该能够在输出中看到启用了H264编解码器,哪个不是默认配置。


i installed Qt 5.4.1 x64 on LUbuntu and created an app which uses the new QtWebEngine.

I`m trying to display a html5 page with that component which is using the tag. All works fine except if I try to playback a mp4 video. The video area remains black. It works if I use other video types like webm/ogg as source.

I know this is due to license restrictions, so that mp4 is deactivated by default in Ubuntu/Linux for Qt.

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?) ?

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. In Chrome playback works fine btw.

If you need more details like paths etc. please tell me.

Thanks !

解决方案

You can explicitly enable proprietary codecs (H264, MP3) when compiling Qt WebEngine:

In /path-to-qt-src-dir/qtwebengine execute:

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.

这篇关于在Linux上为Qt5 WebEngine启用mp4 / mpeg4 / avc支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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