QTMultimedia Collection for Raspberry Pi

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

My console application successfully builds and deploys on pi.

However, I get a message when I try to play the file:

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

I am trying to play the file as follows:

 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(); 

As I understand it, something is wrong with my QTMultimedia compilation. I need help with this. I compiled with these instructions. I installed some gstreamer packages as described above, however, when I compile the QTMultimedia module when qmake starts, it does not detect gstreamer ..

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

+4
source share
1 answer

If QtMultimedia is not created, how can you expect it to work with the application?

This probably means that you are still missing some dependencies or something else is wrong with your env. You may have set the pkgconfig paths incorrectly. You can also try using this guide I wrote: http://thebugfreeblog.blogspot.it/2013/03/bring-up-qt-501-on-raspberry-pi-with.html . I had problems with audio and gstreamer, but some time passed, and since then something has changed.

If after creating and deploying the QtMultimedia module and the gstreamer plug-in you still get this, use the env QT_DEBUG_PLUGIN variable to get some logs.

+2
source

Source: https://habr.com/ru/post/1500473/


All Articles