• android api 34 编译ffmpeg with libfdk-aac


    1. #!/bin/bash
    2. NDK=$ANDROID_NDK_HOME # 这里需要替换成你本地的 NDK 路径
    3. HOST_TAG=linux-x86_64
    4. TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG
    5. ANDROID_LIB_PATH="$(pwd)/android"
    6. API=34
    7. function build_android
    8. {
    9. echo "Build fdk-aac for android $CPU"
    10. ./configure \
    11. --host=$HOST \
    12. --enable-shared \
    13. --enable-static \
    14. --prefix="$ANDROID_LIB_PATH/$CPU" \
    15. CPPFLAGS="-fPIC"
    16. make clean
    17. make -j8
    18. make install
    19. echo "Build fdk-aac for android $CPU completed"
    20. }
    21. # armeabi-v7a
    22. CPU=armv7-a
    23. HOST=arm-linux-android
    24. export AR=$TOOLCHAIN/bin/llvm-ar
    25. export AS=$TOOLCHAIN/bin/llvm-as
    26. export LD=$TOOLCHAIN/bin/ld
    27. export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
    28. export STRIP=$TOOLCHAIN/bin/llvm-strip
    29. export CC=$TOOLCHAIN/bin/armv7a-linux-androideabi$API-clang
    30. export CXX=$TOOLCHAIN/bin/armv7a-linux-androideabi$API-clang++
    31. #export LD=${CC}
    32. build_android
    33. # arm64-v8a
    34. CPU=armv8-a
    35. HOST=aarch64-linux-android
    36. export AR=$TOOLCHAIN/bin/llvm-ar
    37. export AS=$TOOLCHAIN/bin/llvm-as
    38. export LD=$TOOLCHAIN/bin/ld
    39. export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
    40. export STRIP=$TOOLCHAIN/bin/llvm-strip
    41. export CC=$TOOLCHAIN/bin/aarch64-linux-android$API-clang
    42. export CXX=$TOOLCHAIN/bin/aarch64-linux-android$API-clang++
    43. #export LD=${CC}
    44. build_android
    • 修改ffmpeg-android-maker/scripts/ffmpeg/build.sh 中 configure部分内容,这里添加了disable-doc,否则会报cc1错误
    1. ./configure \
    2. --prefix=${BUILD_DIR_FFMPEG}/${ANDROID_ABI} \
    3. --enable-cross-compile \
    4. --target-os=android \
    5. --arch=${TARGET_TRIPLE_MACHINE_ARCH} \
    6. --sysroot=${SYSROOT_PATH} \
    7. --cc=${FAM_CC} \
    8. --cxx=${FAM_CXX} \
    9. --ld=${FAM_LD} \
    10. --ar=${FAM_AR} \
    11. --as=${FAM_CC} \
    12. --nm=${FAM_NM} \
    13. --ranlib=${FAM_RANLIB} \
    14. --strip=${FAM_STRIP} \
    15. --extra-cflags="-O3 -fPIC $DEP_CFLAGS" \
    16. --extra-ldflags="$DEP_LD_FLAGS" \
    17. --enable-shared \
    18. --disable-static \
    19. --disable-vulkan \
    20. --enable-nonfree \
    21. --enable-libfdk-aac \
    22. --disable-doc \
    23. --pkg-config=${PKG_CONFIG_EXECUTABLE} \
    24. ${EXTRA_BUILD_CONFIGURATION_FLAGS} \
    25. $ADDITIONAL_COMPONENTS || exit 1
    • export PKG_CONFIG_PATH=${FDK_PKG_CONFIG_PATH}:${PKG_CONFIG_PATH},即fdk-aac生成的pkgconfig路径
    • ./ffmpeg-android-maker.sh -abis=arm64 -android=34
  • 相关阅读:
    解题元宇宙,网络游戏中的多元通信方案
    计算机毕业设计之java+ssm协同办公系统
    python 解压rar加密压缩包 提示缺少密码
    Dubbo服务发布与消费过程概述
    1143. 最长公共子序列
    题解:《算法竞赛进阶指南》观光
    激光雷达市场格局“剧变”,这家国产厂商成了最大黑马?
    C++-openssl-aes-加密解密
    Linux高级IO
    Elasticsearch内存分析
  • 原文地址:https://blog.csdn.net/binzhongbi757/article/details/136731410