默认ServiceProvider::requestService(): 找不到服务 – “org.qt-project.qt.mediaplayer”

huangapple go评论107阅读模式
英文:

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

问题

我正在将我的Qt应用程序构建为Ubuntu-22.04上的AppImage。它构建没有错误,并且应用程序可以正常工作。但问题是它应该显示一个视频,但实际上没有显示。初始版本的应用程序可以成功显示视频,但新版本却不能。然而,当我在Qt Creator中以调试模式运行应用程序时,视频可以正常工作。

错误信息是:"defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"。

我知道论坛上有很多关于这个错误的主题,但我尝试了所有的方法。
我安装了所有推荐的库:

sudo apt-get update
sudo apt-get -y install \
            libclang-dev \
            libdbus-1-dev \
            libfontconfig1-dev \
            libfreetype6-dev \
            libgl1-mesa-dev \
            libharfbuzz-dev \
            libx11-dev \
            libx11-xcb-dev \
            libxcb-glx0-dev \
            libxcb-icccm4-dev \
            libxcb-image0-dev \
            libxcb-keysyms1-dev \
            libxcb-randr0-dev \
            libxcb-render-util0-dev \
            libxcb-shape0-dev \
            libxcb-shm0-dev \
            libxcb-sync0-dev \
            libxcb-xfixes0-dev \
            libxcb-xinerama0-dev \
            libxcb1-dev \
            libxext-dev \
            libxfixes-dev \
            libxi-dev \
            libxkbcommon-dev \
            libxkbcommon-x11-dev \
            libxrender-dev \
            libpulse-dev \
            libunwind-dev \
            libgstreamer1.0-dev \
            libgstreamer-plugins-base1.0-dev \
            libgstreamer-plugins-bad1.0-dev \
            gstreamer1.0-plugins-base \
            gstreamer1.0-plugins-good \
            gstreamer1.0-plugins-bad \
            gstreamer1.0-plugins-ugly \
            gstreamer1.0-gl \
            gstreamer1.0-libav \
            gstreamer1.0-qt5 \
            gstreamer1.0-tools \
            libqt5multimedia5-plugins \
            libqt5core5a \
            libfuse2 \
            ffmpeg \
            ffmpegthumbnailer \
            autoconf \
            automake \
            build-essential \
            cmake \
            git-core \
            libass-dev \
            libgnutls28-dev \
            libmp3lame-dev \
            libsdl2-dev \
            libtool \
            libva-dev \
            libvdpau-dev \
            libvorbis-dev \
            meson \
            ninja-build \
            pkg-config \
            texinfo \
            yasm \
            zlib1g-dev \
            ffmpegthumbs \
            ffmpeg-doc \
            qtbase5-dev \
            qtdeclarative5-dev \
            libavcodec-dev \
            qml-module-qtmultimedia \
            qml-module-qt-labs-settings \
            qml-module-qtquick-controls2 \
            qml-module-qtquick-layouts \
            qml-module-qtquick-window2 \
            qml-module-qtquick-dialogs \
            qml-module-qtquick-controls \
            binutils \
            fuse \
            libglib2.0-0

我甚至使用aqt安装了带有qtmultimedia的Qt:

aqt install-qt --outputdir ./Qt linux desktop 5.15.2 --archives qtmultimedia

如果有人能够提供解决此问题的说明,我将非常感激。

英文:

I'm building my Qt app into an AppImage on Ubuntu-22.04. It builds without errors and the app works. But the problem is that it's supposed to display a video, and it doesn't. The initial version of the app successfully displays the video, but the new version does not. However, the video works correctly when I run the app from Qt Creator in Debug mode.
The error message is:"defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"".

I know there are multiple topics about this error across the forums, but i tried everything.
I installed all the libs that were recommended:

sudo apt-get update
sudo apt-get -y install \
libclang-dev \
libdbus-1-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libharfbuzz-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-glx0-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-shape0-dev \
libxcb-shm0-dev \
libxcb-sync0-dev \
libxcb-xfixes0-dev \
libxcb-xinerama0-dev \
libxcb1-dev \
libxext-dev \
libxfixes-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libxrender-dev \
libpulse-dev \
libunwind-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-bad1.0-dev \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gstreamer1.0-gl \
gstreamer1.0-libav \
gstreamer1.0-qt5 \
gstreamer1.0-tools \
libqt5multimedia5-plugins \
libqt5core5a \
libfuse2 \
ffmpeg \
ffmpegthumbnailer \
autoconf \
automake \
build-essential \
cmake \
git-core \
libass-dev \
libgnutls28-dev \
libmp3lame-dev \
libsdl2-dev \
libtool \
libva-dev \
libvdpau-dev \
libvorbis-dev \
meson \
ninja-build \
pkg-config \
texinfo \
yasm \
zlib1g-dev \
ffmpegthumbs \
ffmpeg-doc \
qtbase5-dev \
qtdeclarative5-dev \
libavcodec-dev \
qml-module-qtmultimedia \
qml-module-qt-labs-settings \
qml-module-qtquick-controls2 \
qml-module-qtquick-layouts \
qml-module-qtquick-window2 \
qml-module-qtquick-dialogs \
qml-module-qtquick-controls \
binutils \
fuse \
libglib2.0-0

I even installed Qt with qtmultimedia with aqt:

aqt install-qt --outputdir ./Qt linux desktop 5.15.2 --archives qtmultimedia

If someone could provide me with instructions for resolving this issue, I would greatly appreciate it.

答案1

得分: 0

我刚刚不得不将Qt mediaservice文件夹及其插件添加到我的构建插件目录中,然后它就可以工作了。

英文:

UPDATE:
I just had to add the Qt mediaservice folder with its plugins into my build's plugins directory and it worked.

huangapple
  • 本文由 发表于 2023年8月8日 19:56:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76859329.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定