我们知道在Ubuntu下直接编译FFmpeg是很简单的,主要是先执行./configure,接着执行make命令来编译,完了紧接着执行make install执行安装。那么如何使用Android的NDK编译出来可以在Android下面可以使用的FFmpeg动态链接库呢?写下这篇文章就是学习如何裁剪并且编译出来可以使用的动态库。

一、获取FFmpeg源码:

  首先在编译之前,得获取一份FFmpeg的源码,如果你没有git并且也不打算使用,你可以去FFmpeg官网http://ffmpeg.org/去下载Zip包。你也可以使用git来获取源码:

  

 git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg
git reset --hard
git clean -f -d
git checkout -B stable 2.3.

二、了解FFmpeg中configure选项:

  执行./configure --help可以得到如下选项:

Usage: configure [options]
Options: [defaults in brackets after descriptions] Help options:
--help print this message
--list-decoders show all available decoders
--list-encoders show all available encoders
--list-hwaccels show all available hardware accelerators
--list-demuxers show all available demuxers
--list-muxers show all available muxers
--list-parsers show all available parsers
--list-protocols show all available protocols
--list-bsfs show all available bitstream filters
--list-indevs show all available input devices
--list-outdevs show all available output devices
--list-filters show all available filters Standard options:
--logfile=FILE log tests and output to FILE [config.log]
--disable-logging do not log configure debug information
--fatal-warnings fail if any configure warning is generated
--prefix=PREFIX install in PREFIX []
--bindir=DIR install binaries in DIR [PREFIX/bin]
--datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
--docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
--libdir=DIR install libs in DIR [PREFIX/lib]
--shlibdir=DIR install shared libs in DIR [PREFIX/lib]
--incdir=DIR install includes in DIR [PREFIX/include]
--mandir=DIR install man page in DIR [PREFIX/share/man]
--enable-rpath use rpath to allow installing libraries in paths
not part of the dynamic linker search path Licensing options:
--enable-gpl allow use of GPL code, the resulting libs
and binaries will be under GPL [no]
--enable-version3 upgrade (L)GPL to version [no]
--enable-nonfree allow use of nonfree code, the resulting libs
and binaries will be unredistributable [no] Configuration options:
--disable-static do not build static libraries [no]
--enable-shared build shared libraries [no]
--enable-small optimize for size instead of speed
--disable-runtime-cpudetect disable detecting cpu capabilities at runtime (smaller binary)
--enable-gray enable full grayscale support (slower color)
--disable-swscale-alpha disable alpha channel support in swscale
--disable-all disable building components, libraries and programs
--enable-incompatible-libav-abi enable incompatible Libav fork ABI [no]
--enable-raise-major increase major version numbers in sonames [no] Program options:
--disable-programs do not build command line programs
--disable-ffmpeg disable ffmpeg build
--disable-ffplay disable ffplay build
--disable-ffprobe disable ffprobe build
--disable-ffserver disable ffserver build Documentation options:
--disable-doc do not build documentation
--disable-htmlpages do not build HTML documentation pages
--disable-manpages do not build man documentation pages
--disable-podpages do not build POD documentation pages
--disable-txtpages do not build text documentation pages Component options:
--disable-avdevice disable libavdevice build
--disable-avcodec disable libavcodec build
--disable-avformat disable libavformat build
--disable-avutil disable libavutil build
--disable-swresample disable libswresample build
--disable-swscale disable libswscale build
--disable-postproc disable libpostproc build
--disable-avfilter disable libavfilter build
--enable-avresample enable libavresample build [no]
--disable-pthreads disable pthreads [auto]
--disable-w32threads disable Win32 threads [auto]
--disable-os2threads disable OS/ threads [auto]
--disable-network disable network support [no]
--disable-dct disable DCT code
--disable-dwt disable DWT code
--disable-error-resilience disable error resilience code
--disable-lsp disable LSP code
--disable-lzo disable LZO decoder code
--disable-mdct disable MDCT code
--disable-rdft disable RDFT code
--disable-fft disable FFT code Hardware accelerators:
--disable-dxva2 disable DXVA2 code [autodetect]
--disable-vaapi disable VAAPI code [autodetect]
--disable-vda disable VDA code [autodetect]
--disable-vdpau disable VDPAU code [autodetect] Individual component options:
--disable-everything disable all components listed below
--disable-encoder=NAME disable encoder NAME
--enable-encoder=NAME enable encoder NAME
--disable-encoders disable all encoders
--disable-decoder=NAME disable decoder NAME
--enable-decoder=NAME enable decoder NAME
--disable-decoders disable all decoders
--disable-hwaccel=NAME disable hwaccel NAME
--enable-hwaccel=NAME enable hwaccel NAME
--disable-hwaccels disable all hwaccels
--disable-muxer=NAME disable muxer NAME
--enable-muxer=NAME enable muxer NAME
--disable-muxers disable all muxers
--disable-demuxer=NAME disable demuxer NAME
--enable-demuxer=NAME enable demuxer NAME
--disable-demuxers disable all demuxers
--enable-parser=NAME enable parser NAME
--disable-parser=NAME disable parser NAME
--disable-parsers disable all parsers
--enable-bsf=NAME enable bitstream filter NAME
--disable-bsf=NAME disable bitstream filter NAME
--disable-bsfs disable all bitstream filters
--enable-protocol=NAME enable protocol NAME
--disable-protocol=NAME disable protocol NAME
--disable-protocols disable all protocols
--enable-indev=NAME enable input device NAME
--disable-indev=NAME disable input device NAME
--disable-indevs disable input devices
--enable-outdev=NAME enable output device NAME
--disable-outdev=NAME disable output device NAME
--disable-outdevs disable output devices
--disable-devices disable all devices
--enable-filter=NAME enable filter NAME
--disable-filter=NAME disable filter NAME
--disable-filters disable all filters External library support:
--enable-avisynth enable reading of AviSynth script files [no]
--disable-bzlib disable bzlib [autodetect]
--enable-fontconfig enable fontconfig
--enable-frei0r enable frei0r video filtering
--enable-gnutls enable gnutls [no]
--disable-iconv disable iconv [autodetect]
--enable-ladspa enable LADSPA audio filtering
--enable-libaacplus enable AAC+ encoding via libaacplus [no]
--enable-libass enable libass subtitles rendering [no]
--enable-libbluray enable BluRay reading using libbluray [no]
--enable-libbs2b enable bs2b DSP library [no]
--enable-libcaca enable textual display using libcaca
--enable-libcelt enable CELT decoding via libcelt [no]
--enable-libcdio enable audio CD grabbing with libcdio
--enable-libdc1394 enable IIDC- grabbing using libdc1394
and libraw1394 [no]
--enable-libfaac enable AAC encoding via libfaac [no]
--enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
--enable-libflite enable flite (voice synthesis) support via libflite [no]
--enable-libfreetype enable libfreetype [no]
--enable-libfribidi enable libfribidi [no]
--enable-libgme enable Game Music Emu via libgme [no]
--enable-libgsm enable GSM de/encoding via libgsm [no]
--enable-libiec61883 enable iec61883 via libiec61883 [no]
--enable-libilbc enable iLBC de/encoding via libilbc [no]
--enable-libmodplug enable ModPlug via libmodplug [no]
--enable-libmp3lame enable MP3 encoding via libmp3lame [no]
--enable-libnut enable NUT (de)muxing via libnut,
native (de)muxer exists [no]
--enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
--enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
--enable-libopencv enable video filtering via libopencv [no]
--enable-libopenjpeg enable JPEG de/encoding via OpenJPEG [no]
--enable-libopus enable Opus de/encoding via libopus [no]
--enable-libpulse enable Pulseaudio input via libpulse [no]
--enable-libquvi enable quvi input via libquvi [no]
--enable-librtmp enable RTMP[E] support via librtmp [no]
--enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
--enable-libshine enable fixed-point MP3 encoding via libshine [no]
--enable-libsmbclient enable Samba protocol via libsmbclient [no]
--enable-libsoxr enable Include libsoxr resampling [no]
--enable-libspeex enable Speex de/encoding via libspeex [no]
--enable-libssh enable SFTP protocol via libssh [no]
--enable-libstagefright-h264 enable H. decoding via libstagefright [no]
--enable-libtheora enable Theora encoding via libtheora [no]
--enable-libtwolame enable MP2 encoding via libtwolame [no]
--enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
--enable-libv4l2 enable libv4l2/v4l-utils [no]
--enable-libvidstab enable video stabilization using vid.stab [no]
--enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
--enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
--enable-libvorbis enable Vorbis en/decoding via libvorbis,
native implementation exists [no]
--enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
--enable-libwavpack enable wavpack encoding via libwavpack [no]
--enable-libwebp enable WebP encoding via libwebp [no]
--enable-libx264 enable H. encoding via x264 [no]
--enable-libx265 enable HEVC encoding via x265 [no]
--enable-libxavs enable AVS encoding via xavs [no]
--enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-/Xvid encoder exists [no]
--enable-libzmq enable message passing via libzmq [no]
--enable-libzvbi enable teletext support via libzvbi [no]
--enable-decklink enable Blackmagick DeckLink output [no]
--enable-openal enable OpenAL 1.1 capture support [no]
--enable-opencl enable OpenCL code
--enable-opengl enable OpenGL rendering [no]
--enable-openssl enable openssl [no]
--enable-x11grab enable X11 grabbing [no]
--disable-xlib disable xlib [autodetect]
--disable-zlib disable zlib [autodetect] Toolchain options:
--arch=ARCH select architecture []
--cpu=CPU select the minimum required CPU (affects
instruction selection, may crash on older CPUs)
--cross-prefix=PREFIX use PREFIX for compilation tools []
--progs-suffix=SUFFIX program name suffix []
--enable-cross-compile assume a cross-compiler is used
--sysroot=PATH root of cross-build tree
--sysinclude=PATH location of cross-build system headers
--target-os=OS compiler targets OS []
--target-exec=CMD command to run executables on target
--target-path=DIR path to view of build directory on target
--target-samples=DIR path to samples directory on target
--tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
--toolchain=NAME set tool defaults according to NAME
--nm=NM use nm tool NM [nm -g]
--ar=AR use archive tool AR [ar]
--as=AS use assembler AS []
--windres=WINDRES use windows resource compiler WINDRES [windres]
--yasmexe=EXE use yasm-compatible assembler EXE [yasm]
--cc=CC use C compiler CC [gcc]
--cxx=CXX use C compiler CXX [g++]
--dep-cc=DEPCC use dependency generator DEPCC [gcc]
--ld=LD use linker LD []
--pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [pkg-config]
--pkg-config-flags=FLAGS pass additional flags to pkgconf []
--ranlib=RANLIB use ranlib RANLIB [ranlib]
--doxygen=DOXYGEN use DOXYGEN to generate API doc [doxygen]
--host-cc=HOSTCC use host C compiler HOSTCC
--host-cflags=HCFLAGS use HCFLAGS when compiling for host
--host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
--host-ld=HOSTLD use host linker HOSTLD
--host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
--host-libs=HLIBS use libs HLIBS when linking for host
--host-os=OS compiler host OS []
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS []
--extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS []
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS []
--extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS []
--extra-libs=ELIBS add ELIBS []
--extra-version=STRING version string suffix []
--optflags=OPTFLAGS override optimization-related compiler flags
--build-suffix=SUFFIX library name suffix []
--enable-pic build position-independent code
--enable-thumb compile for Thumb instruction set
--enable-lto use link-time optimization Advanced options (experts only):
--malloc-prefix=PREFIX prefix malloc and related names with PREFIX
--disable-symver disable symbol versioning
--enable-hardcoded-tables use hardcoded tables instead of runtime generation
--disable-safe-bitstream-reader
disable buffer boundary checking in bitreaders
(faster, but may crash)
--enable-memalign-hack emulate memalign, interferes with memory debuggers
--enable-sram allow use of on-chip SRAM
--sws-max-filter-size=N the max filter size swscale uses [] Optimization options (experts only):
--disable-asm disable all assembly optimizations
--disable-altivec disable AltiVec optimizations
--disable-amd3dnow disable 3DNow! optimizations
--disable-amd3dnowext disable 3DNow! extended optimizations
--disable-mmx disable MMX optimizations
--disable-mmxext disable MMXEXT optimizations
--disable-sse disable SSE optimizations
--disable-sse2 disable SSE2 optimizations
--disable-sse3 disable SSE3 optimizations
--disable-ssse3 disable SSSE3 optimizations
--disable-sse4 disable SSE4 optimizations
--disable-sse42 disable SSE4. optimizations
--disable-avx disable AVX optimizations
--disable-xop disable XOP optimizations
--disable-fma3 disable FMA3 optimizations
--disable-fma4 disable FMA4 optimizations
--disable-avx2 disable AVX2 optimizations
--disable-armv5te disable armv5te optimizations
--disable-armv6 disable armv6 optimizations
--disable-armv6t2 disable armv6t2 optimizations
--disable-vfp disable VFP optimizations
--disable-neon disable NEON optimizations
--disable-inline-asm disable use of inline assembly
--disable-yasm disable use of nasm/yasm assembly
--disable-mips32r2 disable MIPS32R2 optimizations
--disable-mipsdspr1 disable MIPS DSP ASE R1 optimizations
--disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
--disable-mipsfpu disable floating point MIPS optimizations
--disable-fast-unaligned consider unaligned accesses slow Developer options (useful when working on FFmpeg itself):
--disable-debug disable debugging symbols
--enable-debug=LEVEL set the debug level []
--disable-optimizations disable compiler optimizations
--enable-extra-warnings enable more compiler warnings
--disable-stripping disable stripping of executables and shared libraries
--assert-level=level (default), or , amount of assertion testing,
causes a slowdown at runtime.
--enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
--valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
leaks and errors, using the specified valgrind binary.
Cannot be combined with --target-exec
--enable-ftrapv Trap arithmetic overflows
--samples=PATH location of test samples for FATE, if not set use
$FATE_SAMPLES at make invocation time.
--enable-neon-clobber-test check NEON registers for clobbering (should be
used only for debugging purposes)
--enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
should be used only for debugging purposes)
--enable-random randomly enable/disable components
--disable-random
--enable-random=LIST randomly enable/disable specific components or
--disable-random=LIST component groups. LIST is a comma-separated list
of NAME[:PROB] entries where NAME is a component
(group) and PROB the probability associated with
NAME (default 0.5).
--random-seed=VALUE seed value for --enable/disable-random NOTE: Object files are built at the place where configure is launched.

这些选项,这些选项是需要我们设置,有些选项可以是FFmpeg优化选项,可以针对CPU进行优化,也有一些选项可以不用编译进去,这样就可以减少编译出来的FFmpeg动态链接库的体积。

三、设置NDK:

  

export ANDROID_NDK=/path/to/your/android/ndk/root
export FF_BUILD_ROOT=`pwd`
export FF_BUILD_NAME=ffmpeg
export FF_ANDROID_PLATFORM=android-14
export FF_TOOLCHAIN_PATH=$FF_BUILD_ROOT/build/$FF_BUILD_NAME/toolchain
export FF_SYSROOT=$FF_TOOLCHAIN_PATH/sysroot
export FF_MAKE_TOOLCHAIN_FLAGS="--install-dir=$FF_TOOLCHAIN_PATH"
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh  $FF_MAKE_TOOLCHAIN_FLAGS  --platform=$FF_ANDROID_PLATFORM  --toolchain=$FF_TOOLCHAIN_NAME

在这一点上,我们可以使用Android工具链独立位于$ TOOLCHAINE建立我们的FFmpeg的。关于Android独立的工具链更多细节可以在Android的NDK的文档中找到。

四、设置FFmpeg:

在前面我们知道了FFmpeg有设置选项并且知道每一个选项是什么意思,在这里我们需要的就是设置这些选项,如上面所写如果都这么写的话就麻烦死了,于是下面这些都是可以在bash中执行的脚本语言:

FF_PREFIX=$FF_BUILD_ROOT/build/$FF_BUILD_NAME/output
FF_CROSS_PREFIX=arm-linux-androideabi
PATH=$FF_TOOLCHAIN_PATH/bin:$PATH
CC="ccache ${FF_CROSS_PREFIX}-gcc"
LD=${FF_CROSS_PREFIX}-ld
AR=${FF_CROSS_PREFIX}-ar
STRIP=${FF_CROSS_PREFIX}-strip
FF_CFLAGS="-O3 -Wall -pipe \
-std=c99 \
-ffast-math \
-fstrict-aliasing -Werror=strict-aliasing \
-Wno-psabi -Wa,--noexecstack \
-DANDROID -DNDEBUG"

前面说了的,我们可以对configure设置进行裁剪,在这里可以参考我们第二步中的confingure选择我们需要的选项进行设置:

FF_CFG_FLAGS="$FF_CFG_FLAGS --arch=arm --cpu=cortex-a8"
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-neno"
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-thumb" FF_EXTRA_CFLAGS="$FF_EXTRA_CFLAGS -march=armv7-a -mcpu=cortex-a8 -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb"
FF_EXTRA_LDFLAGS="$FF_EXTRA_LDFLAGS -Wl,--fix-cortex-a8" # Standard options:
FF_CFG_FLAGS="$FF_CFG_FLAGS --prefix=$FF_PREFIX" #Licensing options:
#allow use of GPL code, the resulting libs
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-gpl"
#upgrade (L)GPL to version [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-version3"
#allow use of nonfree code, the resulting libs and binaries will be unredistributable [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-nonfree" #Configuration options:
#do not build static libraries [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-static"
#build shared libraries [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-shared"
#optimize for size instead of speed
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-small"
#disable detecting cpu capabilities at runtime (smaller binary)
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-runtime-cpudetect"
#enable full grayscale support (slower color)
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-gray"
#disable alpha channel support in swscale
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-swsacle-alpha" #Program options:
#do not build command line programs
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-programs"
#disable ffmpeg build
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-ffmpeg"
#disable ffplay build
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-ffplay"
#disable ffprobe build
FF_CFG_FLAGS="$FF_CFG_FLAGS --diable-ffprobe"
#disable ffserver build
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-ffserver" #Documentation options:
#do not build documentation
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-doc"
#do not build HTML documentation pages
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-htmlpages"
#do not build man documentation pages
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-manmpages"
#do not build POD documentation pages
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-podpages"
#do not build text documentation pages
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-txtpages" #Componet options:disable libpostproc build
#disable libavdevice build
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-avdevice"
#disable libavcodec build
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-avcodec"
#disable libavformat build
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-avformat"
#disable libavutil build
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-avutil"
#disable libswresample build
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-swresample"
#disable libswscale build
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-swscale"
#disable libpostproc build
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-postproc"
#disable libavfilter build
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-avfilter"
#enable libavresample build [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-avresample"
#disable pthreads [auto]
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-pthreads"
#disable Win32 threads [auto]
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-w32threads"
#disable OS/ threads [auto]
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-os2threads"
#disable network support [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-network"
#disable DCT code
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-dct"
#disable DWT code
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-dwt"
#disable LSP code
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-lsp"
#disable LZO decoder code
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-lzo"
#disable MDCT code
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-mdct"
#disable RDFT code
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-rdft"
#disable FFT code
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-fft" #Hardware accelerators:
#disable DXVA2 code [autodetect]
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-dxva2"
#disable VAAPI code [autodetect]
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-vaapi"
#enable VDA code
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-vda"
#disable VDPAU code [autodetect]
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-vdpau" #Individual component options:
#disable all components listed below
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-everythins"
#disable all encoders
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-encoders"
#disable all decoders
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-decoders"
#disable decoder aac
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=aac"
#disable decoder aac_latm
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=aac_latm"
#disable decoder ac3
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=ac3"
#disable decoder ape
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=ape"
#disable decoder flac
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=flac"
#disable decoder flv
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=flv"
#disable decoder h261
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=h261"
#disable decoder h263
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=h263"
#disable decoder h263i
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=h263i"
#disable decoder h263p
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=h263p"
#disable decoder h264
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=h264"
#disable decoder mp3
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=mp3"
#disable decoder mp3float
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=mp3float"
#disable decoder mp3on4
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=mp3on4"
#disable decoder mp3on4float
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=mp3on4float"
#disable decoder mpeg4
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=mpeg4"
#disable decoder msmpeg4v1
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=msmpeg4v1"
#disable decoder msmpeg4v2
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=msmpeg4v2"
#disable decoder msmpeg4v3
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=msmpeg4v3"
#disable decoder pcm_*
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=pcm_*"
#disable decoder ra_144
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=ra_144"
#disable decoder ra_288
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=ra_288"
#disable decoder ralf
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=ralf"
#disable decoder rv10
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=rv10"
#disable decoder rv20
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=rv20"
#disable decoder rv30
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=rv30"
#disable decoder rv40
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=rv40"
#disable decoder theora
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=theora"
#disable decoder vc1
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=vc1"
#disable decoder vorbis
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=vorbis"
#disable decoder vp3
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=vp3"
#disable decoder vp5
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=vp5"
#disable decoder vp6
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=vp6"
#disable decoder vp6a
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=vp6a"
#disable decoder vp6f
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=vp6f"
#disable decoder vp8
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=vp8"
#disable decoder webp
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=webp"
#disable decoder wmalossless
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=wmalossless"
#disable decoder wmapro
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=wmapro"
#disable decoder wmav1
FF_CFG_FLAGS="$FF_CFG_FLAGS --eanble-decoder=wmav1"
#disable decoder wmav2
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=wmav2"
#disable decoder wmv1
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=wmv1"
#disable decoder wmv2
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=wmv2"
#disable decoder wmv3
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-decoder=wmv3" #disable all hwaccels
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-hwaccels"
#disable all muxers
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-muxers"
#disable all muxer mpegts
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-muxer=mpegts" #disable all demuxers
FF_CFG_FLAGS="$FF_CFG_FLAGS --diable-demuxers"
#disable demuxer aac
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=aac"
#disable demuxer ac3
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=ac3"
#disable demuxer ape
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=ape"
#disable demuxer asf
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=asf"
#disable demuxer concat
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=concat"
#disable demuxer data
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=data"
#disable demuxer flac
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=flac"
#disable demuxer flv
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=flv"
#disable demuxer h261
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=h261"
#disable demuxer h263
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=h263"
#disable demuxer h264
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=h264"
#disable demuxer hls
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=hls"
#disable demuxer latm
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=latm"
#disable demuxer loas
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=loas"
#disable demuxer m4v
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=m4v"
#disable demuxer matroska
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=matroska"
#disable demuxer mov
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=mov"
#disable demuxer mp3
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=mp3"
#disable demuxer mpegps
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=mpegps"
#disable demuxer mpegts
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=mpegts"
#disable demuxer mpegtsraw
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=mpegtsraw"
#disable demuxer mpegvideo
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=mpegvideo"
#disable demuxer ogg
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=ogg"
#disable demuxer pcm_*
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=pcm_*"
#disable demuxer rm
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=rm"
#disable demuxer rtp
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=rtp"
#disable demuxer rtsp
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=rtsp"
#disable demuxer swf
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=swf"
#disable demuxer tta
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=tta"
#disable demuxer vc1
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=vc1"
#disable demuxer vc1t
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=vc1t"
#disable demuxer wav
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=wav"
#disable demuxer xmv
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-demuxer=xmv"
#disable demuxer xwma
FF_CFG_FLAGS="$FF_CFG_FLAGS --eanble-demuxer=xwma" #disable all parsers
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-parsers"
#disable parser aac
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=aac"
#disable parser aac_latm
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=aac_latm"
#disable parser ac3
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parse=ac3"
#disable parser adx
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=adx"
#disable parser bmp
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=bmp"
#disable parser cavsvideo
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=cavsvideo"
#disable parser cook
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=cook"
#disable parser dca
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=dca"
#disable parser dirac
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=dirac"
#disable parser dnxhd
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=dnxhd"
#disable parser dvbsub
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=dvbsub"
#disable parser dvd_nav
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=dvd_nav"
#disable parser dvdsub
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=dvdsub"
#disable parser flac
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=flac"
#disable parser gsm
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=gsm"
#disable parser h261
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=h261"
#disable parser h263
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=h263"
#disable parser h264
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=h264"
#disable parser mjpeg
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=mjpeg"
#disable parser mlp
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=mlp"
#disable parser mpeg4video
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=mpeg4video"
#disable parser mpegaudip
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=mpegaudip"
#disable parser mpegvideo
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=mpegvideo"
#disable parser png
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=png"
#disable parser pnm
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=pnm"
#disable parser rv30
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=rv30"
#disable parser rv40
#FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=rv40"
#disable parser vc1
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=vc1"
#disable parser vorbis
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=vorbis"
#disable parser vp3
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=vp3"
#disable parser vp8
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-parser=vp8" #disable all bsfs
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-bsfs"
#disable all protocols
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-protocols"
#disable all devices
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-devices"
#disable all filters
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-filters" #External library support
#enable reading of AviSynth script files [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-avisynth"
#disable bzlib [autodetect]
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-bzlib"
#enable fontconfig
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-fontconfig"
#enable frei0r video filtering
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-frei0r"
#enable gnutls [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-gnutls"
#disable iconv [autodetect]
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-iconv"
#enable LADSPA audio filtering
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-ladspa"
#enable AAC+ encoding via libaacplus [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libaacplus"
#enable libass subtitles rendering [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libass"
#enable BluRay reading using libbluray [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libbluray"
#enable textual display using libcaca
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libcaca"
#enable CELT decoding via libcelt [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libcelt"
#enable audio CD grabbing with libcdio
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libcdio"
#enable IIDC- grabbing using libdc1394 and libraw1394 [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libdc1394"
#enable AAC encoding via libfaac [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libfaac"
#enable AAC de/encoding via libfdk-aac [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libfdk-aac"
#enable flite (voice synthesis) support via libflite [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libflite"
#enable libfreetype [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libfreetype"
#enable Game Music Emu via libgme [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libgme"
#enable GSM de/encoding via libgsm [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libgsm"
#enable iec61883 via libiec61883 [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libiec61883"
#enable iLBC de/encoding via libilbc [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libilbc"
#enable ModPlug via libmodplug [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libmodplug"
#enable MP3 encoding via libmp3lame [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libmp3lame"
#enable NUT (de)muxing via libnut, native (de)muxer exists [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libnut"
#enable AMR-NB de/encoding via libopencore-amrnb [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libopencore-amrnb"
# enable AMR-WB decoding via libopencore-amrwb [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libopencore-amrwb"
#enable video filtering via libopencv [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libopencv"
#enable JPEG de/encoding via OpenJPEG [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libopenjpeg"
#enable Opus decoding via libopus [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libopus"
#enable Pulseaudio input via libpulse [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libpulse"
#enable quvi input via libquvi [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libquvi"
#enable RTMP[E] support via librtmp [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-librtmp"
#enable Dirac de/encoding via libschroedinger [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libschroedinger"
#enable fixed-point MP3 encoding via libshine [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libshine"
#enable Include libsoxr resampling [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libsoxr"
#enable Speex de/encoding via libspeex [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libspeex"
#enable SFTP protocol via libssh [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libssh"
#enable H. decoding via libstagefright [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libstagefright-h264"
#enable Theora encoding via libtheora [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libtheora"
#enable MP2 encoding via libtwolame [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libtwolame"
#enable Ut Video encoding and decoding via libutvideo [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libutvideo"
#enable libv4l2/v4l-utils [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libv4l2"
#enable video stabilization using vid.stab [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libvidstab"
#enable AAC encoding via libvo-aacenc [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libvo-aacenc"
#enable AMR-WB encoding via libvo-amrwbenc [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libvo-amrwbenc"
#enable Vorbis en/decoding via libvorbis, native implementation exists [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libvorbis"
#enable VP8 and VP9 de/encoding via libvpx [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libvpx"
#enable wavpack encoding via libwavpack [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libwavpack"
#enable H. encoding via x264 [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libx264"
#enable AVS encoding via xavs [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libxavs"
#enable Xvid encoding via xvidcore, native MPEG-/Xvid encoder exists [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libxvid"
#enable message passing via libzmq [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libzmq"
#enable teletext support via libzvbi [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libzvbi"
#enable OpenAL 1.1 capture support [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-openal"
#enable OpenCL code
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-opencl"
#enable openssl [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-openssl"
#enable X11 grabbing [no]
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-x11grab"
#disable zlib [autodetect]
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-zlib" #Advanced options (experts only):
FF_CFG_FLAGS="$FF_CFG_FLAGS --cross-prefix=${FF_CROSS_PREFIX}"
FF_CFG_FLAGS="$FF_CFG_FLAGS -enable-cross-compile"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --sysroot=PATH"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --sysinclude=PATH"
FF_CFG_FLAGS="$FF_CFG_FLAGS --target-os=$FF_TARGET_OS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --target-exec=CMD"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --target-path=DIR"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --toolchain=NAME"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --nm=NM"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --ar=AR"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --as=AS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --yasmexe=EXE"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --cc=CC"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --cxx=CXX"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --dep-cc=DEPCC"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --ld=LD"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --host-cc=HOSTCC"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --host-cflags=HCFLAGS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --host-cppflags=HCPPFLAGS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --host-ld=HOSTLD"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --host-ldflags=HLDFLAGS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --host-libs=HLIBS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --host-os=OS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --extra-cflags=ECFLAGS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --extra-cxxflags=ECFLAGS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --extra-ldflags=ELDFLAGS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --extra-libs=ELIBS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --extra-version=STRING"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --optflags=OPTFLAGS"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --build-suffix=SUFFIX"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --malloc-prefix=PREFIX"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --progs-suffix=SUFFIX"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --arch=ARCH"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --cpu=CPU"
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-pic"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-sram"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-thumb"
FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-symver"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-hardcoded-tables"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-safe-bitstream-reader"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-memalign-hack"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-lto" #Optimization options(experts only)
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-asm"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-altivec"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-amd3dnow"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-amd3dnowext"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-mmx"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-mmxext"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-sse"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-sse2"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-sse3"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-ssse3"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-sse4"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-sse42"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-avx"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-fma4"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-armv5te"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-armv6"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-armv6t2"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-vfp"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-neon"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-vis"
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-inline-asm"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-yasm"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-mips32r2"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-mipsdspr1"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-mipsdspr2"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-mipsfpu"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-fast-unaligned" # Developer options (useful when working on FFmpeg itself):
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-coverage"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-debug"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-debug=LEVEL"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-optimizations"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-extra-warnings"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-stripping"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --assert-level=level"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-memory-poisoning"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --valgrind=VALGRIND"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-ftrapv"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --samples=PATH"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-xmm-clobber-test"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-random"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-random"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-random=LIST"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-random=LIST"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --random-seed=VALUE"

五、编译ffmpeg:

FF_MAKEFLAGS=
if which nproc >/dev/null
then
FF_MAKEFLAGS=-j`nproc`
elif [ "$UNAMES" == "Darwin" ] && which sysctl >/dev/null
then
FF_MAKEFLAGS=-j`sysctl -n machdep.cpu.thread_count`
fi if [ -f "./config.h" ]; then
echo "\n resume configure \n"
else
./configure $FF_CFG_FLAGS \
--extra-cflags="$FF_CFLAGS $FF_EXTRA_CFLAGS" \
--extra-ldflags="$FF_EXTRA_LDFLAGS"
make clean
fi cp config.* $FF_PREFIX
make $FF_MAKEFLAGS
make install

六、如果一切正常,我们可以得到libavcodec.so,libavformat.so等开头的目录,我们需要将这些.o文件链接成一个.so动态库:

rm libavcodec/log2_tab.o
rm libavutil/log2_tab.o
rm libswresample/log2_tab.o
$CC -lm -lz -shared --sysroot=$FF_SYSROOT -Wl,--no-undefined -Wl,-z,noexecstack $FF_EXTRA_LDFLAGS \
compat/*.o \
libavutil/*.o \
libavutil/arm/*.o \
libavcodec/*.o \
libavcodec/arm/*.o \
libavformat/*.o \
libswresample/*.o \
libswresample/arm/*.o \
libswscale/*.o \
-o $FF_PREFIX/libffmpeg.so

七、构建完成之后我们可以strip一下动态库,去掉一些无用的信息,这样可以降低动态链接库的体积:

arm-linux-androideabi-strip --strip-unneeded libffmpeg.so

注:本文参考https://vec.io/posts/how-to-build-ffmpeg-with-android-ndk编写。

[原]如何用Android NDK编译FFmpeg的更多相关文章

  1. 用Android NDK编译FFmpeg

    附(2018-01-06):     有一个将x264及lame等库集成进去了且基于android的ffmpeg的编译方法,地址参见:       https://github.com/writing ...

  2. Android NDK 编译FFmpeg(不需要复杂的环境变量设置)

    环境: CentOS6.2——64位 借鉴:https://vec.io/posts/how-to-build-ffmpeg-with-android-ndk 在根目录下创建work文件夹:cd  / ...

  3. anroid ndk编译ffmpeg 引用librtmp libx264

    Ffmpeg 无处不在,自然android系统少不了它,折腾了不少时间完成 ndk编译ffmpeg,生成so库中引用了外部库librtmp,libx264.条条大路通罗马, 也许还有别的更好的方法去完 ...

  4. Linux下NDK编译FFMPEG包含neon参数

    FFMPEG编译成Android库已经有很多案例了,编译优化neon的也很多,以下是我通过实践成功的案例,这里主要讲编译的配置文件,其他设置可结合Linux下使用NDK编译FFMPEG(libstag ...

  5. 64位 CentOS NDK 编译 FFMPEG

    64位 CentOS NDK 编译 FFMPEG 一.           参考文章: http://www.cnblogs.com/baopu/p/4733029.html http://www.c ...

  6. 手把手图文并茂教你用Android Studio编译FFmpeg库并移植

    转载请把头部出处链接和尾部二维码一起转载,本文出自逆流的鱼yuiop:http://blog.csdn.net/hejjunlin/article/details/52661331 之前曾写过一篇&l ...

  7. android NDK编译(导入).a文件和编译多个so文件(转)

    源:android NDK编译(导入).a文件和编译多个so文件 一.编译一个静态库 libstatic_android.a LOCAL_PATH := $(call my-dir) include ...

  8. Android NDK编译之undefined reference to 'JNI_CreateJavaVM'

    利用Android NDK编译动态库,在C文件中调用了两个JNI函数:JNI_GetDefaultJavaVMInitArgs和JNI_CreateJavaVM.编译的时候始终报以下错误: XXX: ...

  9. 使用android ndk编译x86 so在linux下使用的问题

    一直以为android ndk编译x86 so库可以在linxu下运行,结果我试了几次都行不通.后来想了一下,android ndk编译的库应该只能在android设备或模拟器上运行才有效,后来改用 ...

随机推荐

  1. atitit.为什么java体系开发效率这样低的原因and解决

    atitit.为什么java体系开发效率这样低的原因and解决 #---开发理念问题(影响度:很大的,2-3倍效率) mvc<>webform server control ajax< ...

  2. 菜鸟日记-HTML-表格与表单

    一.表格 <table></table> width:宽度.可以用像素或百分比表示. border:边框,常用值0 cellpadding:内容跟单元格边框的边距.常用值0 a ...

  3. Leetcode 121 Best Time to Buy and Sell Stock 动态规划

    由于题意太长,请自己翻译,很容易懂的. 做法:从前向后遍历数组,记录当前出现过的最低价格,作为买入价格,并计算以当天价格出售的收益,作为可能的最大收益,整个遍历过程中,出现过的最大收益就是所求.动态规 ...

  4. 详解Bootstrap缩略图组件及警示框组件

    缩略图组件 缩略图在网站中最常用的就是产品列表页面,一行显示几张图片,有的在图片底下带有标题.描述内容.按钮等信息.bootstrap框架将这部分独立成一个模块组件,通过类名.thumbnail配合b ...

  5. javaweb回顾第四篇Servlet异常处理

    前言:很多网站为了给用户很好的用户体验性,都会提供比较友好的异常界面,现在我们在来回顾一下Servlet中如何进行异常处理的. 1:声明式异常处理 什么是声明式:就是在web.xml中声明对各种异常的 ...

  6. 在线教程的游戏化-20分钟做了个demo

    首先,不准说做得撇,因为其一,我只用了20分钟不到:其二,第一次尝试,以前想过,但是一直没有搞过,二话不说,先来截图,下载地址在最下面. 因为第一次尝试,所以很多事件自己还没有闹明白,不过基本上还是看 ...

  7. 为什么Android的图片质量会比iPhone的差?

           经常看到有人问:“安卓版微信发出去的图片怎么那么渣!比iPhone的差远了!”.不只是微信,很多应用安卓版的图片质量就是要比iPhone版逊色很多,这到底是怎么回事? 我们团队最初也纠结 ...

  8. Autosizer应用程序窗口控制工具

    Autosizer是一个系统辅助软件,窗口控制工具,它能指定程序窗口的大小位置置顶等,可以将窗口最大化,最小化,比如在需要截图的时候可以讲窗口设定大小640*480,然后用FSCapture捕捉活动窗 ...

  9. StringBuffer&StringBuilder区别详解

    序言 StringBuffer与StringBuilder是java.lang包下被大家熟知的两个类.其异同为:一.长度都是可扩充的:二.StringBuffer是线程安全的,StringBuilde ...

  10. Linux每天定时重启Tomcat服务

    1:查看crond 服务状态(确认Linux任务计划服务开启) service crond status crond (pid  1937) is running... 2:编写重启Tomcat的sh ...