android - 使用 Galaxy s6 edge 设备使用 ffmpeg4android 时崩溃

标签 android ffmpeg android-ndk

我正在使用 ffmpeg4android_lib 在我的 android 应用程序中压缩视频,它几乎可以在所有测试设备中使用,但在 Galaxy s6 edge 和 Galaxy s7 edge 中不起作用。

我的代码如下:

String inputFile = FileManager.getInstance().getRealPathFromVideoUri(context, video);
Log.i("INPUT FILE PATH", inputFile);

LoadJNI vk = new LoadJNI();
try {
        String workFolder = context.getApplicationContext().getFilesDir().getAbsolutePath();
        String outputFile = FileManager.getInstance().getFileFullName(ForSaleConstants.VIDEO_FOLDER,
        String.format(ForSaleConstants.VIDEO_NAME_FILE_FORMAT,      ForSaleConstants.VIDEO_NAME_FILE_NAME_PREFIX, System.currentTimeMillis()));

        String complexCommand[] = {
            "ffmpeg", "-y"
            , "-i", inputFile
            , "-strict", "experimental"
            , "-s", "320x240"
            , "-r", "25"
            , "-aspect", "4:3"
            , "-ab", "48000"
            , "-ac", "2"
            , "-vcodec", "mpeg4"
            , "-movflags", "+faststart"
            , "-ar", "22050"
            , "-b", "2097k"
            , outputFile};
            vk.run(complexCommand, workFolder, context.getApplicationContext());
            Log.i("OUTPUT FILE PATH", outputFile);
            return outputFile;
    } catch (Throwable e) {
        ForSaleServerManager.getInstance().logAndroidError("Couldn't compress video file");
        return null;
    }

崩溃如下:
nativeLibraryDirectories=[/data/app/com.forsale.forsale-1/lib/arm64, /data/app/com.forsale.forsale-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libloader-jni.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.netcompss.loader.LoadJNI.<clinit>(LoadJNI.java:13)

最佳答案

最新版本解决了这个问题
从这里下载:
androidwarzone.blogspot.co.il/2011/12/ffmpeg4android.html?m=1

关于android - 使用 Galaxy s6 edge 设备使用 ffmpeg4android 时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37988291/

相关文章:

android - Jetpack Compose TopBar 和 BottomBar Default Elevation 内容未填满其容器

android - Android和iPhone录音

FFMPEG 无法监听 rtmp 并将其转换为 HLS

FFmpeg - 与音频文件持续时间相同的垂直滚动图像叠加

android - 如何在 NDK 项目中的 GL 之上绘制 android UI 元素

android - 如何从 Kotlin 异步闭包保存数据?

android - 如何设置单个recyclerview项[imageview]占据屏幕的一半?

video - ffmpeg concat 产生 DTS 乱序错误

android - 如何确定 Android .so 文件的 ABI(即 armeabi 或 armeabi-v7a)?

android - 编译 FFmpeg : libx264 not found