wang-bin / QtAV

A cross-platform multimedia framework based on Qt and FFmpeg. 基于Qt和FFmpeg的跨平台高性能音视频播放框架. Recommand to use new sdk https://github.com/wang-bin/mdk-sdk
http://qtav.org
3.94k stars 1.5k forks source link

QQmlApplicationEngine failed to load component / plugin cannot be loaded for module "QtAV" #1349

Open ldj9708 opened 3 years ago

ldj9708 commented 3 years ago

QtAV, Qt version and platform

QtAV : QtAV-Qt5.9-VS2017x64-release-2a470d2 from https://sourceforge.net/projects/qtav/files/ci/

Qt version : Qt Creator 4.10.1 Based on Qt 5.13.1 (MSVC 2017, 32 bit) windows10

Reproduction steps

copy openAL bin, include, lib to QT dir from https://sourceforge.net/projects/qtav/files/depends/ QtAV-depends-windows-x86+x64.7z

copy ffmpeg bin, include, lib to QT dir C:\Qt\Qt5.13.2\5.13.2\mingw73_64 from https://sourceforge.net/projects/avbuild/files/windows-desktop/ ffmpeg-master-desktop-MINGW-lite.7z

and run Sample files below.

Expected behavior

QtAV window running

Actual behavior

application output :

12:25:12: Starting D:\QT\build-test_ffmpeg_1-Desktop_Qt_5_13_2_MinGW_64_bit-Release\release\test_ffmpeg_1.exe ... QQmlApplicationEngine failed to load component qrc:/main.qml:5 plugin cannot be loaded for module "QtAV": ????귯?? C:\Qt\Qt5.13.2\5.13.2\mingw73_64\qml\QtAV\QmlAV.dll??(??) ????? ?? ????: ?????? ???ν????? a?? ?? ???????.

12:25:12: D:/QT/build-test_ffmpeg_1-Desktop_Qt_5_13_2_MinGW_64_bit-Release/release/test_ffmpeg_1.exe exited with code -1

Log file

no log file

Sample files (optional)

main.qml

import QtQuick 2.12 import QtQuick.Window 2.12 import QtAV 1.6

Window { visible: true width: 640 height: 480 title: qsTr("Hello World")

Item {
    Video {
        id: video
        source: "test.mp4"
    }
    MouseArea {
        anchors.fill: parent
        onClicked: video.play()
    }
}

}

test_ffmpeg_1.pro

QT += quick greaterThan(QT_MAJOR_VERSION, 4) { QT += av avwidgets } else { CONFIG += av avwidgets }

CONFIG += c++11 DEFINES += QT_DEPRECATED_WARNINGS

SOURCES += \ main.cpp

RESOURCES += qml.qrc

QML_IMPORT_PATH += "D:/ffmpeg/QtAV/qml"

QML_DESIGNER_IMPORT_PATH =

qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target

I fallowed this https://github.com/wang-bin/QtAV/wiki/Deploy-SDK-Without-Building-QtAV

ldj9708 commented 3 years ago

I saw this https://github.com/wang-bin/QtAV/wiki/Can-Not-Run-QtAV-App

so I tried to build project in console.

result is below.

D:>cd D:\QT\test_ffmpeg_1_QTAV\build

D:\QT\test_ffmpeg_1_QTAV\build>qmake ..\test_ffmpeg_1.pro Info: creating stash file D:\QT\test_ffmpeg_1_QTAV\build.qmake.stash

D:\QT\test_ffmpeg_1_QTAV\build>make make -f Makefile.Release make[1]: Entering directory D:/QT/test_ffmpeg_1_QTAV/build' g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -Wall -W -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_AVWIDGETS_LIB -DQT_AV_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../../test_ffmpeg_1_QTAV -I. -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtQuick -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtAVWidgets -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtAV -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtOpenGL -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtWidgets -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtGui -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtANGLE -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtQml -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtNetwork -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtCore -Irelease -I/include -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/mkspecs/win32-g++ -o release/main.o ../main.cpp 'C:\Qt\Qt5.13.2\5.13.2\mingw73_64\bin\rcc.exe' -name qml ../qml.qrc -o release/qrc_qml.cpp g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -Wall -W -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_AVWIDGETS_LIB -DQT_AV_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../../test_ffmpeg_1_QTAV -I. -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtQuick -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtAVWidgets -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtAV -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtOpenGL -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtWidgets -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtGui -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtANGLE -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtQml -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtNetwork -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/include/QtCore -Irelease -I/include -IC:/Qt/Qt5.13.2/5.13.2/mingw73_64/mkspecs/win32-g++ -o release/qrc_qml.o release/qrc_qml.cpp g++ -Wl,-s -Wl,-subsystem,windows -mthreads -o release/test_ffmpeg_1.exe release/main.o release/qrc_qml.o C:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/libQt5Quick.a C:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/libQt5OpenGL.a C:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/libQt5Widgets.a C:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/libQt5Gui.a C:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/libQt5Qml.a C:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/libQt5Network.a C:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/libQt5Core.a -lmingw32 C:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/libqtmain.a -LC:/openssl/lib -LC:/Utils/my_sql/mysql-5.7.25-winx64/lib -LC:/Utils/postgresql/pgsql/lib -lshell32 make[1]: Leaving directoryD:/QT/test_ffmpeg_1_QTAV/build'

and exe file was build, run in console, no thing happened.