集成ffmpeg/x264:ERROR: libx264 not found的问题

在配置的时候,要注意一下NDK的安装路径,替换成自己NDK的安装路径。
x264的编译脚本内容为:

export NDK=/home/cmake/Android/Sdk/ndk-bundle
export PLATFORM=$NDK/platforms/android-18/arch-arm/
export TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
export PREFIX=./android/arm

function build_one
{
  ./configure   --prefix=$PREFIX --enable-static \
  --enable-pic \
  --host=arm-linux \
  --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
  --sysroot=$PLATFORM

  make clean
  make -j 4
  make install
}

build_one

echo Android ARM builds finished

ffmpeg的编译脚本为:

#!/usr/bin/env bash  

export NDK=/Users/pingzhang/Documents/tool/android-ndk-r1  
#这下面的架构要与x264的架构保持一致  
export PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64   
export PLATFORM=$NDK/platforms/android-23/arch-arm    
export PREFIX=$NDK/sources/ffmpeg/android    
build_one(){    
./configure --target-os=linux \  
    --extra-cflags="-fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -marm -march=armv7-a" \  
    #指定x264的安装路径  
    --extra-cflags="-I/usr/local/x264/include" \  
    --extra-ldflags="-L/usr/local/x264/lib" \  
    --prefix=$PREFIX --enable-cross-compile \  
    --enable-runtime-cpudetect --disable-asm \  
    --arch=arm --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \  
    --cross-prefix=$PREBUILT/bin/arm-linux-androideabi \  
    --disable-stripping --nm=$PREBUILT/bin/arm-linux-androideabi-nm \  
    --sysroot=$PLATFORM --enable-gpl --enable-shared --disable-static \  
    --enable-small --disable-ffprobe --disable-ffplay --disable-ffmpeg \  
    --enable-gpl \  
    --enable-libx264 \  
    --extra-libs="-lgcc" \  
    --disable-ffserver --disable-debug  
}    

build_one    

make clean    
make -j4    
make install  

你可能感兴趣的:(FFmpeg)