相关文章推荐
奔放的梨子  ·  java ...·  1 年前    · 
淡定的地瓜  ·  vue中使用tinymce ...·  1 年前    · 

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

解决方法:

在Linux中,sudo apt-get installlibqt5multimedia5-plugins 可解决

详见:https://forum.qt.io/topic/33298/ubuntu-qt-multimedia-5-upgrade-to-ubuntu-13-04-from-ubuntu-13-10-no-sound/2

以上就是Linux下,qt5中使用Qt Multimedia编译时遇到报错的全文介绍,希望对您学习和使用linux系统开发有所帮助. Building on: linux -g++ (x86_64, CPU features: mmx sse sse2) Building for: linux -aarch64-gnu-g++ (arm64, CPU features: neon) Target compiler: gcc 6.3.1 Configuration: cross_compile use_gold_linker compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 concurrent dbus reduce_exports stl Build options: Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C standard ....................... C11 Using C++ standard ..................... C++14 Using ccache ........................... no Using gold linker ...................... yes Using new DTAGS ........................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: NEON ................................. yes Build parts ............................ libs Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... no Qt Gui ................................. yes Qt Network ............................. yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... yes udev ................................... no Using system zlib ...................... yes Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... no iconv .................................. yes ICU .................................... no Tracing backend ........................ Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no Using system PCRE2 ..................... no Qt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no Linux AF_NETLINK ....................... yes OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ no DTLS ................................... yes SCTP ................................... no Use system proxies ..................... yes Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ no HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. no Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... yes PNG .................................. yes Using system libpng ................ no EGL .................................... no OpenVG ................................. no OpenGL: Desktop OpenGL ....................... no OpenGL ES 2.0 ........................ no OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. no Session Management ..................... yes Features used by QPA backends: evdev .................................. yes libinput ............................... no INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon .............................. no X11 specific: XLib ................................. no EGL on X11 ........................... no QPA backends: DirectFB ............................... no EGLFS .................................. no Linux FB ................................ yes VNC .................................... yes Mir client ............................. no Qt Sql: SQL item models ........................ yes Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows Qt PrintSupport: CUPS ................................... no Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt Testlib: Tester for item models ................. yes Qt SerialBus: Socket CAN ............................. yes Socket CAN FD .......................... yes Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML sequence object .................... yes QML list model ......................... yes QML XML http request ................... yes QML Locale ............................. yes QML delegate model ..................... yes Qt Quick: Direct3D 12 ............................ no AnimatedImage item ..................... yes Canvas item ............................ yes Support for Qt Quick Designer .......... yes Flipable item .......................... yes GridView item .......................... yes ListView item .......................... yes TableView item ......................... yes Path support ........................... yes PathView item .......................... yes Positioner items ....................... yes Repeater item .......................... yes ShaderEffect item ...................... yes Sprite item ............................ yes Qt Scxml: ECMAScript data model for Qt Scxml ...... yes Qt Gamepad: SDL2 ................................... no Qt 3D: Assimp ................................. yes System Assimp .......................... no Output Qt 3D Job traces ................. no Output Qt 3D GL traces .................. no Use SSE2 instructions .................. no Use AVX2 instructions .................. no Aspects: Render aspect ........................ yes Input aspect ......................... yes Logic aspect ......................... yes Animation aspect ..................... yes Extras aspect ........................ yes Qt 3D Renderers: OpenGL Renderer ........................ yes Qt 3D GeometryLoaders: Autodesk FBX ........................... no Qt Wayland Client ........................ no Qt Wayland Compositor .................... no Qt Bluetooth: BlueZ .................................. no BlueZ Low Energy ....................... no Linux Crypto API ....................... no WinRT Bluetooth API (desktop & UWP) .... no Qt Sensors: sensorfw ............................... no Qt Quick Controls 2: Styles ................................. Default Fusion Imagine Material Universal Qt Quick Templates 2: Hover support .......................... yes Multi -touch support .................... yes Qt Positioning: Gypsy GPS Daemon ....................... no WinRT Geolocation API .................. no Qt Location: Qt .labs.location experimental QML plugin . yes Geoservice plugins: OpenStreetMap ........................ yes HERE ................................. yes Esri ................................. yes Mapbox ............................... yes MapboxGL ............................. no Itemsoverlay ......................... yes Qt XmlPatterns: XML schema support ..................... yes Qt Multi media : ALSA ................................... no GStreamer 1.0 .......................... no GStreamer 0.10 ......................... no Video for Linux ........................ yes OpenAL ................................. no PulseAudio ............................. no Resource Policy (libresource qt5 ) ....... no Windows Audio Services ................. no DirectShow ............................. no Windows Media Foundation ............... no Qt Tools: QDoc ................................... no Qt WebEngine: Embedded build ......................... yes Pepper Plugins ......................... no Printing and PDF ....................... no Proprietary Codecs ..................... no Spellchecker ........................... yes Native Spellchecker .................... no WebRTC ................................. no Use System Ninja ....................... no Geolocation ............................ yes WebChannel support ..................... yes Use v8 snapshot ........................ yes Kerberos Authentication ................ no Building v8 snapshot supported ......... yes Use ALSA ............................... no Use PulseAudio ......................... no Optional system libraries used: re2 .................................. no icu .................................. no libwebp, libwebpmux and libwebpdemux . no opus ................................. no ffmpeg ............................... no libvpx ............................... no snappy ............................... no glib ................................. no zlib ................................. yes minizip .............................. no libevent ............................. no jsoncpp .............................. no protobuf ............................. no libxml2 and libxslt .................. no lcms2 ................................ no png .................................. no JPEG ................................. no harfbuzz ............................. no freetype ............................. no x11 .................................. no Required system libraries: fontconfig ........................... no dbus ................................. no nss .................................. no khr .................................. no glibc ................................ yes Required system libraries for qpa-xcb: libdrm ............................... no xcomposite ........................... no xcursor .............................. no xi ................................... no xrandr ............................... no xtst ................................. no Note: Also available for Linux : linux -clang linux -icc Qt 5.5.0上 使用 Q Media Player播放音频,出现如下错误,将 qt 安装目录下的plugins目录下的 media service文件夹拷到运行目录下解决。 本机目录如下: C:\ Qt \ Qt5 .5.0\5.5\msvc2010\plugins\ media service 附播放音频代码如下: 构造函数 创建: const QString soundstr("./resources https://nachega.com/2018/12/19/how-to-solve-defaultserviceproviderrequestservice-no-service-found-for-org- qt -project- qt - media player/ no service found for – org. qt -project. qt . media player 由于 QT Multi Media 依赖于Gstreamer的,因此需要装好gstreamer的几个库: ![d429468da86 文章目录0 背景1 安装2 问题 因为工作原因,需要用到 linux 下的软件,平 使用 Qt 都是 使用 Mac和Windows进行开发。原本以为安装会一帆风顺的进行,结果还是 遇到 了很多坑,此文就是记录这些坑的。 1,下载软件安装包,后缀为.run 2,cd进入安装的文件目录下,输入以下指令: 授予权限,chmod 755 qt -unified- linux -x64-4.0.1-online.run 执行安装,sudo ./ qt -unified- linux -x64-4.0.1-onli Qt 开发,一个播放音频的功能,在开发机(x64)上没问题,但是在另外一台电脑(arm)上无法播放,代码没有什么 报错 提示。而直接点击音频文件,调用播放器是可以正常播放的。因此判断可能是 Qt 层面缺了什么音频相关的支持。运行,程序播放音频成功。 目标,将现有 Qt 项目移植到改系统下进行开发。 准备安装 Qt5 .15.2 , Qt 官方提供的安装包都是x86架构下的,不能直接在arm架构下安装,网上看了很多示例,说可以直接在终端通过命令行来安装: sudo aptitude install libdtkwidget-dev qt5 -default qt creator qt declarative5-dev 这样确实可以安装 Qt ,但是装的是 最近想用 qt 把写好的远控给静态 编译 ,而关于静态 编译 可以查看这位博主,写的很详细 http://blog.csdn.net/wsj18808050/article/details/50909381然而静态 编译 远控客户端 ,我调用了QSoundEffect 类,就一直提示没有这个模块(只要在pro文件 加了 QT += multi media multi media widgets 都会出错)。 解压部分就不过多赘述了。直接进入到重点环节: 编译 部分 以下是代码: sudo ./configure -prefix /opt/ Qt5 .15.2_static -release -static -c++std c++11 - qt -zlib -fontconfig -system-freetype - qt -libpng - qt -libjpeg -no-xcb -skip qt declarative -skip qt androidextras -nomake 在Ubuntu16.04 ,想 使用 QT5 .9 自带的 Qt Multi media 类,进行音视频播放,视频能打开但是不能播放,错误信息如下: Qt :No decoder available for type 'video/x-h264 …;Your GStreamer installation is missing a plug-in. 因为 Qt Multi media 使用 的系统默认 使用 gstream音视频编/解码器,且 QT5 (不知哪个版本之后剥离出来)的安装包已将音视频解码器全部剥离出来了,所以需要自己手动安装。 转载而来如有侵权请留言:http://www.codexiu.cn/ Linux /blog/20140/控制台显示如下错误:defaultServiceProvider::requestService(): no service found for - "org. qt -project. qt . media player"执行 $sudo apt install lib qt5 multi media 5-plug...