Raspberry Pi 的 QTMultimedia 编译 [英] QTMultimedia compilation for Raspberry Pi

查看:120
本文介绍了Raspberry Pi 的 QTMultimedia 编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只需要从在 Raspberry Pi 上运行的 QT 5.1 应用程序播放简单的音频 wav 或 mp3 文件.

I just need to play simple audio wav or mp3 file from QT 5.1 application running on Raspberry Pi.

我的控制台应用程序已成功构建并部署到 pi.

My console application is successfully building and deploying to pi.

但是,当我尝试播放文件时收到一条消息:

However I'm getting a message when I try to play the file:

defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"

我尝试像这样播放文件:

I try to play the file like this:

QMediaPlaylist * playlist = new QMediaPlaylist;
playlist->addMedia(QUrl::fromLocalFile(hall1_5min));
playlist->addMedia(QUrl::fromLocalFile(hall1_start));
playlist->setCurrentIndex(1);
QMediaPlayer * player = new QMediaPlayer;
player->setPlaylist(playlist);
player->play();

据我所知,我的 QTMultimedia 编译有问题.我需要帮助.我已经按照这些说明进行了编译.我已经安装了上面提到的一些 gstreamer 软件包,但是,当我编译 QTMultimedia 模块时运行 qmake 时 - 它没有检测到 gstreamer ..

As I understand there is something wrong with my QTMultimedia compilation.. I need help with that. I've compiled with these instructions. I've installed some gstreamer packages as mentioned above, However, when I compile QTMultimedia module when running qmake - it doesn't detect gstreamer..

如何使用明确指定的 gstreamer 或其他媒体服务驱动程序编译 QTMultimedia?

How can I compile QTMultimedia with explicitly specified gstreamer or other media service driver?

推荐答案

如果 QtMultimedia 没有被构建,你怎么能期望它运行应用程序?

If QtMultimedia is not being built, how can you expect it to work running the application?

这可能意味着您仍然缺少一些依赖项,或者您的环境有其他问题.也许您没有正确设置 pkgconfig 路径.你也可以试试我写的这个指南:http://thebugfreeblog.blogspot.it/2013/03/bring-up-qt-501-on-raspberry-pi-with.html.我在使用音频和 gstreamer 时遇到了问题,但一段时间过去了,从那时起可能发生了一些变化.

That probably means you're still missing some dependencies or something else is wrong with your env. Maybe you didn't set pkgconfig paths correctly. You can also try with this guide I wrote: http://thebugfreeblog.blogspot.it/2013/03/bring-up-qt-501-on-raspberry-pi-with.html. I had issues with audio and gstreamer, but some time has passed and something might have changed since then.

如果在构建和部署 QtMultimedia 模块和 gstreamer 插件后,您仍然可以使用 QT_DEBUG_PLUGIN 环境变量来获取一些日志.

If after building and deploying the QtMultimedia module and the gstreamer plugin you still get that, use the QT_DEBUG_PLUGIN env variable to get some logs.

这篇关于Raspberry Pi 的 QTMultimedia 编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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