Closed tiagolima123 closed 3 months ago
Please provide all the steps to reproduce the issue.
source code
qml/main.qml
import QtQuick 2.0
import QtMultimedia 5.11
import QtQuick.Window 2.0
Rectangle {
id: root
width: 740
height: 420
color: "black"
VideoOutput {
id: video
width: 740
height: 420
source: mediaPlayer
}
MediaPlayer {
id: mediaPlayer
source: "file:///sdcard/video.mp4"
autoLoad: true
autoPlay: true
}
}
main.qrc
<RCC>
<qresource>
<file alias="main.qml">qml/main.qml</file>
</qresource>
</RCC>
src/main.cpp
#include <QApplication>
#include <QQuickWidget>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QQuickWidget widget;
widget.setSource(QUrl("qrc:/main.qml"));
widget.show();
app.exec();
return EXIT_SUCCESS;
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
project(main LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5 REQUIRED COMPONENTS
Core
Gui
Widgets
Quick
QuickWidgets
Multimedia
)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
include_directories(${PROJECT_NAME}
PRIVATE
include
)
set(SOURCES src/main.cpp)
qt_add_resources(SOURCES main.qrc)
add_executable(${PROJECT_NAME} ${SOURCES})
#link libraries to the project
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Multimedia
Qt5::Quick
Qt5::QuickWidgets
)
qt packages installed
qt5-qtbase/x11,now
qt5-qtdeclarative/x11,now
qt5-qtmultimedia/x11,now
qt5-qtx11extras/x11,now
then I had build with
mkdir build
cd build
cmake ..
make -j
when I run ./main
, it chashes with Segmentation fault
export DISPLAY=:1
./main
logcat
logcat *:W
logcat output
...
backtrace:
06-07 11:43:28.490 14927 14927 F DEBUG : #00 pc 0000000000003e94 /data/data/com.termux/files/usr/lib/libQt5MultimediaQuick.so.5.15.10 (offset 0xa000)
06-07 11:43:28.609 14927 14927 W crash_dump64: dlopen libaed.so fail: dlopen failed: library "libaed.so" not found
I got segfault in libQt5MultimediaQuick.so.5.15.10 in my phone. The libaed.so file could be specific to your device vendor.
I have rebuilt qt5-qtmultimedia and got the following output from the test program.
qrc:/main.qml:2:1: module "QtMultimedia" is not installed
import QtMultimedia 5.11
^
qt5-qtmultimedia does not have some components. Could that be the reason for this issue?
Did you try porting the program to qt6?
Qt6 worked, thank you!
Video in qml on device armv8 is not working
logcat output ... F DEBUG : #00 pc 0000000000003e94 /data/data/com.termux/files/usr/lib/libQt5MultimediaQuick.so.5.15.10 (offset 0xa000)
crash_dump64: dlopen libaed.so fail: dlopen failed: library "libaed.so" not found