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

Using QtAV on Android x86 crash at start #1320

Open julienchevet opened 4 years ago

julienchevet commented 4 years ago

QtAV, Qt version and platform

Reproduction steps

  1. Build QtAV for android
  2. Use QtAV in a Qt project with FFMPEG 4.1 libs linked in ANDROID_EXTRA_LIBS
  3. Compile it for android x86
  4. The App compile but crash at start

Expected behavior

App running successfully and playing RTSP stream

Actual behavior

App crash at start with dlopen failed error for libswresample.so

Log file

I project.exampl: Not late-enabling -Xcheck:jni (already on)
W project.exampl: Unexpected CPU variant for X86 using defaults: x86
W System  : ClassLoader referenced unknown path:
D OpenGLRenderer: Skia GL Pipeline
I QtCore  : Start
E linker  : "/data/app/org.qtproject.example-fS0dWAUrJsvYh6LNVhr7HQ==/lib/x86/libswresample.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
E AndroidRuntime: Process: org.qtproject.example, PID: 10224
E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/org.qtproject.example-fS0dWAUrJsvYh6LNVhr7HQ==/lib/x86/libswresample.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
E AndroidRuntime:   at java.lang.Runtime.load0(Runtime.java:928)
E AndroidRuntime:   at java.lang.System.load(System.java:1633)
E AndroidRuntime:   at org.qtproject.qt5.android.QtNative$2.run(QtNative.java:308)
E AndroidRuntime:   at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87)
E AndroidRuntime:   at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
E AndroidRuntime:   at java.lang.Thread.run(Thread.java:764)
I Process : Sending signal. PID: 10224 SIG: 9
wang-bin commented 4 years ago

did you try new ffmpeg packages in https://sourceforge.net/projects/avbuild/files/android/ ? master and 4.3 has no textrel, and should work for you.

julienchevet commented 4 years ago

It doesn't work with FFmpeg 4.3

julienchevet commented 4 years ago

With FFmpeg 4.3 I have got this error:

E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: invalid ELF file "/data/app/com.myapp-rb7Psob8RiU4X8aXiqQuKw==/lib/x86/libswscale.so" load segment[4]: p_offset (0xc1000) + p_filesz (0x0) ( = 0xc1000) past end of file (0xc04a4)