I'm trying to build the ffmpeg binaries for android on 3 chipsets. The output file size is too large to include in the project around 15mb.
https://github.com/falnatsheh/ffmpeg-android is the github project repo
the .sh build script for ffmpeg is like this
#!/bin/bash
. abi_settings.sh $1 $2 $3
pushd ffmpeg
case $1 in
armeabi-v7a | armeabi-v7a-neon)
CPU='cortex-a8'
;;
x86)
CPU='i686'
;;
esac
make clean
./configure \
--target-os="$TARGET_OS" \
--cross-prefix="$CROSS_PREFIX" \
--arch="$NDK_ABI" \
--cpu="$CPU" \
--enable-runtime-cpudetect \
--sysroot="$NDK_SYSROOT" \
--enable-pic \
--enable-libx264 \
--enable-pthreads \
--disable-debug \
--disable-ffserver \
--enable-version3 \
--enable-hardcoded-tables \
--disable-ffplay \
--disable-ffprobe \
--enable-gpl \
--enable-yasm \
--disable-doc \
--disable-shared \
--enable-static \
--pkg-config="${2}/ffmpeg-pkg-config" \
--prefix="${2}/build/${1}" \
--extra-cflags="-I${TOOLCHAIN_PREFIX}/include $CFLAGS" \
--extra-ldflags="-L${TOOLCHAIN_PREFIX}/lib $LDFLAGS" \
--extra-libs="-lm" \
--extra-cxxflags="$CXX_FLAGS" || exit 1
make -j${NUMBER_OF_CORES} && make install || exit 1
popd
I tried adding --disable-everything as the first line in configure but then the compiler complains that I didnt set a target-os even though its the next line
In the app I only use ffmpeg to take input mp4 videos and transpose and rotate them here are the two commands
-y -i %s -vf transpose=%d -tune film -metadata:s:v rotate=0 -c:v libx264 -preset ultrafast -crf 27 -c:a copy -bsf:a aac_adtstoasc %s
where %s is a file path
and then concat files
-y -i concat:%s -preset ultrafast -crf 27 -c:v copy -c:a copy -bsf:a aac_adtstoasc %s
If someone can help me with the build script that would be awesome
You can use the shotgun approach. This is just a semi-random list for example purposes and may not fit your needs exactly:
You will have to experiment because you may forget to enable something when you use
--disable-everything
. Refer to./configure --help
.The
--(dis|en)able-*
options can accept a comma separated list as shown in my example.You can turn off some feature, and open the decoding,demultiplexing you need.
such as :
Recommend to you an open source Android and IOS ffmpeg
https://github.com/bbcallen/ijkplayer