码迷,mamicode.com
首页 > 移动开发 > 详细

[原]如何用Android NDK编译FFmpeg

时间:2014-08-26 22:44:56      阅读:353      评论:0      收藏:0      [点我收藏+]

标签:des   android   style   blog   http   color   os   使用   io   

\我们知道在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.2

 

二、了解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 3 [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/2 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-1394 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 2000 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.264 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.264 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-4/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 [256]

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.2 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     0(default), 1 or 2, amount of assertion testing,
                           2 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 3 [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/2 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-1394 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 2000 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.264 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.264 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-4/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

标签:des   android   style   blog   http   color   os   使用   io   

原文地址:http://www.cnblogs.com/tanlon/p/3938282.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!