mkdir /var/android/ndk
mkdir /var/android/ffmpeg
cd /var/android/ndk
wget https://dl.google.com/android/repository/android-ndk-r16-linux-x86_64.zip
unzip android-ndk-r16-linux-x86_64.zip
mv android-ndk-r16 ./ndk/
cd /var/android/ffmpeg
wget http://ffmpeg.org/releases/ffmpeg-3.2.tar.bz2
tar xvf ffmpeg-3.2.tar.bz2
mv ffmpeg-3.2 ./android-ndk-r13/sources/
cd ndk/android-ndk-r13/sources/ffmpeg-3.2/
vim build_android.sh
NDK=/var/android/ndk/android-ndk-r13
SYSROOT=$NDK/platforms/android-21/arch-arm64/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86
CPU=aarch64
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
function build_one
{
./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-programs \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-doc \
--disable-symver \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=$CPU \
--enable-cross-compile \
--sysroot=$SYSROOT \
--disable-encoders \
--disable-muxers \
--disable-devices \
--disable-everything \
--disable-protocols \
--disable-demuxers \
--disable-decoders \
--disable-bsfs \
--enable-optimizations \
--enable-filters \
--enable-parsers \
--disable-parser=hevc \
--enable-swscale \
--enable-network \
--enable-protocol=file \
--enable-protocol=http \
--enable-protocol=rtmp \
--enable-protocol=rtp \
--enable-protocol=mmst \
--enable-protocol=mmsh \
--enable-protocol=crypto \
--enable-protocol=hls \
--enable-demuxer=hls \
--enable-demuxer=mpegts \
--enable-demuxer=mpegtsraw \
--enable-demuxer=mpegvideo \
--enable-demuxer=concat \
--enable-demuxer=mov \
--enable-demuxer=flv \
--enable-demuxer=rtsp \
--enable-demuxer=mp3 \
--enable-demuxer=matroska \
--enable-decoder=mpeg4 \
--enable-decoder=mpegvideo \
--enable-decoder=mpeg1video \
--enable-decoder=mpeg2video \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}
build_one
chmod 755 build_android.sh
./build_android.sh
/var/android/abi/dist/ffmpeg-4.0에 abi 폴더들 나열됨
각 폴더 include에 so 파일들 있음
'OS > Linux' 카테고리의 다른 글
ubuntu 모스키토 설치 (0) | 2021.07.14 |
---|---|
FFMPEG Compile on Ubuntu (0) | 2021.03.05 |
centos7 Gradle Install (0) | 2020.12.24 |
Centos7 Crontab php 실행안됨 (0) | 2020.12.17 |
Centos7 유저한테 루트 권한 주기 (0) | 2020.09.02 |