Open srcejon opened 1 day ago
My ffmpeg build works fine with latest NDK r27 and ffmpeg-kit development branch:
$ make ffmpeg
rm -rf /usr/src/libbaresip-android/ffmpeg-kit/prebuilt/android-arm64-28 && \
cd ffmpeg-kit && \
ANDROID_SDK_ROOT=/foo/bar \
ANDROID_NDK_ROOT=/opt/Android/ndk/27.2.12479018 \
./android.sh --api-level=28 --enable-gpl --no-archive \
--disable-arm-v7a --disable-x86-64 --disable-arm-v7a-neon --disable-x86 \
--enable-android-media-codec \
--enable-x264 --enable-libaom --enable-libvpx \
--enable-libpng --skip-ffmpeg-kit
Building ffmpeg-kit library for Android
Architectures: arm64-v8a
Libraries: android-zlib, android-media-codec, libvpx, x264, libaom
Downloading sources: ok
Building arm64-v8a platform on API level 28
x264: ok
libaom: ok
libpng: ok
cpu-features: ok
libvpx: ok
ffmpeg: ok
ffmpeg-kit: skipped
Makefile is available here: https://github.com/juha-h/libbaresip-android (video branch).
You probably don't see the second problem as you are using --skip-ffmpeg-kit
srcejon writes:
You probably don't see the second problem as you are using --skip-ffmpeg-kit
Correct, I skip it, since I only use the libs.
I enabled ffmpeg-kit and then the build failed:
[arm64-v8a] Compile : ffmpegkit <= fftools_ffprobe.c
jni/../ffmpeg-kit-android-lib/src/main/cpp/fftools_ffprobe.c:2868:31: error: unknown type name 'AVHDRVivid3SplineParams'
2868 | const AVHDRVivid3SplineParams *three_spline =
| ^
jni/../ffmpeg-kit-android-lib/src/main/cpp/fftools_ffprobe.c:2869:41: error: no member named 'three_spline' in 'struct AVHDRVividColorToneMappingParams'
2869 | &tm_params->three_spline[j];
| ~~~~~~~~~ ^
jni/../ffmpeg-kit-android-lib/src/main/cpp/fftools_ffprobe.c:3314:46: error: use of undeclared identifier 'AV_FRAME_FLAG_KEY'
3314 | print_int("key_frame", !!(frame->flags & AV_FRAME_FLAG_KEY));
| ^
jni/../ffmpeg-kit-android-lib/src/main/cpp/fftools_ffprobe.c:3368:37: error: use of undeclared identifier 'AV_FRAME_FLAG_INTERLACED'
3368 | !!(frame->flags & AV_FRAME_FLAG_INTERLACED));
| ^
jni/../ffmpeg-kit-android-lib/src/main/cpp/fftools_ffprobe.c:3370:37: error: use of undeclared identifier 'AV_FRAME_FLAG_TOP_FIELD_FIRST'
3370 | !!(frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST));
| ^
jni/../ffmpeg-kit-android-lib/src/main/cpp/fftools_ffprobe.c:3691:29: error: use of undeclared identifier 'AV_PROFILE_UNKNOWN'; did you mean 'AV_FIELD_UNKNOWN'?
3691 | if (par->profile != AV_PROFILE_UNKNOWN) {
| ^~~~~~~~~~~~~~~~~~
| AV_FIELD_UNKNOWN
jni/ffmpeg/../../../prebuilt/android-arm64-28/ffmpeg/lib/../include/libavcodec/codec_par.h:39:5: note: 'AV_FIELD_UNKNOWN' declared here
39 | AV_FIELD_UNKNOWN,
| ^
jni/../ffmpeg-kit-android-lib/src/main/cpp/fftools_ffprobe.c:3886:27: error: no member named 'nb_coded_side_data' in 'struct AVCodecParameters'
3886 | if (stream->codecpar->nb_coded_side_data) {
| ~~~~~~~~~~~~~~~~ ^
jni/../ffmpeg-kit-android-lib/src/main/cpp/fftools_ffprobe.c:3888:47: error: no member named 'nb_coded_side_data' in 'struct AVCodecParameters'
3888 | for (int i = 0; i < stream->codecpar->nb_coded_side_data; i++) {
| ~~~~~~~~~~~~~~~~ ^
jni/../ffmpeg-kit-android-lib/src/main/cpp/fftools_ffprobe.c:3890:52: error: no member named 'coded_side_data' in 'struct AVCodecParameters'
3890 | &stream->codecpar->coded_side_data[i],
| ~~~~~~~~~~~~~~~~ ^
9 errors generated.
android.sh fails with NDK r26 or above.
Error in build.log is:
It seems to be caused by the following lines in android/jni/Android.mk:
If I comment that out, then it builds OK. (That may break builds with older NDKs - r25 seems ok without it)
Next problem is:
Presumably this can be fixed with:
+++ b/android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg_mux_init.c @@ -284,9 +284,9 @@ static int enc_stats_init(OutputStream ost, EncStats es, int pre, static const struct { enum EncStatsType type; const char *str;
Environment
Android
arm64-v8a
,main
,r26d
or28.0.12674087