arthenica / ffmpeg-kit

FFmpeg Kit for applications. Supports Android, Flutter, iOS, Linux, macOS, React Native and tvOS. Supersedes MobileFFmpeg, flutter_ffmpeg and react-native-ffmpeg.
https://arthenica.github.io/ffmpeg-kit
GNU Lesser General Public License v3.0
4.52k stars 603 forks source link

Problem with android 5.x when using com.arthenica:ffmpeg-kit-audio:6.0-2.LTS library #1070

Open thangnx1011 opened 1 day ago

thangnx1011 commented 1 day ago

Description

com.arthenica:ffmpeg-kit-audio:6.0-2.LTS library meet error with android 5.x (include 5.0.x and 5.1.x) and sometimes with android 6,7 and 8 when converting from video to audio with multi files

Expected behavior

We sugest com.arthenica:ffmpeg-kit-audio:6.0-2.LTS library can support for android 5.x

Current behavior

Currently I am using the com.arthenica:ffmpeg-kit-audio:6.0-2.LTS library to develop a project to convert from video to audio. However, I am having problems almost with Android 5.0.x and 5.1.x (sometimes meet with android 6.0,7.1 and 8.0) when converting videos in MP4, 3gp ... format to audio (MP3, AAC ...)

When I configure with the com.arthenica:ffmpeg-kit-audio:5.1.LTS library, I no longer encounter the error with android 5.0.x but meet error with android 5.1.x

Logs E FATAL EXCEPTION: pool-12-thread-1 Process: com.mediaconverter.mp3videoconverter.videotomp3converter, PID: 3064 java.lang.Error: FFmpegKit failed to start on brand: generic_x86, model: Android SDK built for x86, device: generic_x86, api level: 21, abis: x86, 32bit abis: x86, 64bit abis: . at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:50) at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKit(NativeLoader.java:189) at com.arthenica.ffmpegkit.FFmpegKitConfig.(FFmpegKitConfig.java:145) at com.mediaconverter.mp3videoconverter.videotomp3converter.service.ConvertVideoToAudioTask.start(ConvertVideoToAudioTask.java:54) at com.mediaconverter.mp3videoconverter.videotomp3converter.service.BaseTask$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libavfilter.so" needed by "libffmpegkit.so"; caused by could not load library "libavformat.so" needed by "libavfilter.so"; caused by could not load library "libavcodec.so" needed by "libavformat.so"; caused by cannot locate symbol "_ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc" referenced by "libavcodec.so"... at java.lang.Runtime.loadLibrary(Runtime.java:371) at java.lang.System.loadLibrary(System.java:989) at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:48) at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKit(NativeLoader.java:189)  at com.arthenica.ffmpegkit.FFmpegKitConfig.(FFmpegKitConfig.java:145)  at com.mediaconverter.mp3videoconverter.videotomp3converter.service.ConvertVideoToAudioTask.start(ConvertVideoToAudioTask.java:54)  at com.mediaconverter.mp3videoconverter.videotomp3converter.service.BaseTask$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)

Environment