ffmpeg 32位编译脚本

NDK版本:android-ndk-r14b

ffmpeg版本:4.2.4 / 4.4

Ubuntu版本:15.5

#!/bin/bash

  NDK=/home/linrendi/Desktop/Compile/android-ndk-r14b

  PLATFORM=$NDK/platforms/android-21/arch-arm

  TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64

  PREFIX=/home/linrendi/Desktop/ffmpeg32

  CPU=armv7-a

  function build_one

  {

    ./configure \

  --prefix=$PREFIX \

  --target-os=android \

  --disable-doc \

  --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \

  --arch=arm \

  --cpu=$CPU \

  --disable-asm \

  --sysroot=$PLATFORM \

  --extra-cflags="-I$PLATFORM/usr/include" \

  --cc=$TOOLCHAIN/bin/arm-linux-androideabi-gcc \

  --nm=$TOOLCHAIN/bin/arm-linux-androideabi-nm \

  --disable-shared --enable-static \

  --enable-small --disable-debug \

  --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-symver \

  --enable-neon  --enable-pthreads \

  --disable-devices --disable-encoders \

  --enable-hwaccels --enable-jni --enable-mediacodec \

  --enable-encoder=aac \

  --enable-decoder=h264_mediacodec \

  --enable-hwaccel=h264_mediacodec \

  --enable-encoder=mjpeg \

  --enable-encoder=ljpeg --enable-encoder=jpeg2000 --enable-encoder=jpegls \

  --enable-muxer=mp4 --enable-muxer=mjpeg \

  --enable-runtime-cpudetect \

    make clean

    make -j4

    make install

    $TOOLCHAIN/bin/arm-linux-androideabi-ld \

    -rpath-link=$PLATFORM/usr/lib \

    -L$PLATFORM/usr/lib \

    -L$PREFIX/lib \

    -soname libffmpeg.so -shared -nostdlib -Bsymbolic --whole-archive --no-undefined -o \

    $PREFIX/libffmpeg.so \

    libavcodec/libavcodec.a \

    libavfilter/libavfilter.a \

    libswresample/libswresample.a \

    libavformat/libavformat.a \

    libavutil/libavutil.a \

    libswscale/libswscale.a \

    libavdevice/libavdevice.a \

    -lc -lm -lz -ldl -llog --dynamic-linker=/system/bin/linker \

    $TOOLCHAIN/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a

  }

  build_one

你可能感兴趣的:(ffmpeg 32位编译脚本)