1

我已经成功地将 ffmpeg 编译为我的项目的静态库,在 Application.xml 中指定了 android-platform 19,如下所示:

APP_PLATFORM := android-19

我在设备(4.4)上测试我的项目,它运行良好。但它会在 4.0 设备上崩溃。

所以我想将 APP_PLATFORM 更改为较低的版本,例如:

APP_PLATFORM := android-17

但是ide出现了这样的错误。

libavcodec/ffv1enc.c:631: error: undefined reference to 'log2'

当我将其更改为更低版本时:

APP_PLATFORM := android-8

出现更多错误:

libavcodec/ffv1enc.c:631: error: undefined reference to 'log2'
libavutil/mem.c:94: error: undefined reference to 'posix_memalign'

我知道由于缺少 libm,log2 引用未定义,但据我所知,Android 在构建时会自动链接到 libm。http://mobilepearls.com/labs/native-android-api/ndk/docs/STABLE-APIS.html

那么如何在编译 ffmpeg 时保持兼容性,以便在较低版本的设备上很好地运行我的项目。

4

1 回答 1

2

我已经通过使用较低版本的 ndk 平台工具重新编译 ffmpeg 解决了这个问题。

然后在 Android.mk 中保持相同的版本。

这些错误不再发生。

于 2015-11-02T10:01:50.250 回答