29.Android Studio下FFmpeg的編譯和使用(三.FFmpeg配置和編譯指令碼)
FFmpegPlayer.git" target="_blank" rel="nofollow,noindex">專案原始碼
編譯過程中涉及到很多ndk中的so庫和標頭檔案以及交叉編譯的工具,在命令執行的時候會在ndk相應的目錄下去查詢,所以我們可以使用export命令事先將這些路徑設定到環境變數,使用的時候可以很方便的找到
//NDK加入環境變數,以我的ndk存放路徑為例 export NDK=/root/renzhenming/ffmpeg/android-ndk-r14b //ndk的platforms資料夾中存放的是各個版本架構下的so庫和標頭檔案 export PLATFORM=$NDK/platforms/android-21/arch-arm //指定交叉編譯工具的路徑 export TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 //指定輸出型別,以armv7-a為例 export CPU=armv7-a //指定so檔案編譯後的輸出路徑 export PREFIX=./android/$CPU
相關命令解析
指令碼中定義了一個方法build_ffmpeg,最終它被呼叫兩次生成支援neon和硬解碼的so庫和不支援neon和硬解碼的so庫
configure :是ffmpeg中已有的一個配置檔案,我們的指令碼其實也就是去執行這個檔案,所有生成so的工作都在這裡進行
prefix : 指定最終生成的so的安裝目錄
target-os : 指定目標系統,早期很多指令碼在2.x上把這個指定為linux,可以,但是ffmpeg更新之後,在3.x的版本之上會導致問題,標頭檔案找不到之類的,這是一點差異
cross-prefix:指定交叉編譯的字首,在交叉編譯的情況下,比如交叉編譯使用的gcc,那麼會在gcc前加上這個字首,就是一個完整的gcc工具的路徑,可以通過這個路徑找到這個工具(/home/renzhenming/ffmpeg/android-ndk-r14b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc)
sysroot:指定這套系統依賴的庫和標頭檔案位置,就是我們配置的PLATFORMS,交叉編譯在本系統中是找不到這些庫的,可以把這些庫看作是交叉編譯的環境。如果在編譯時指定了-sysroot就是為編譯時指定了邏輯目錄。編譯過程中需要引用的庫,標頭檔案,如果要到/usr/include目錄下去找的情況下,則會在前面加上邏輯目錄。
extra-cflags:是使用$(CC)(cc中指定的編譯器)編譯C檔案的選項,給gcc提供的一系列引數,這個可配可不配。 -fPIC編譯動態連結庫的引數, -mfpu指定協處理器,-mfloat-abi=softfp軟浮點
cc : linux下cc一般是一個符號連線,指向gcc,一般是makefile裡面的一個名字,即巨集定義,就把他當做一個已經定義好的變數,可以指定編譯器即可,ffmpeg是c語言寫的,這裡指定gcc為編譯器,g++是c++編譯器
nm:符號檢視工具,nm 命令顯示關於指定 File 中符號的資訊,檔案可以是物件檔案、可執行檔案或物件檔案庫。如果檔案沒有包含符號資訊,nm 命令報告該情況,但不把它解釋為出錯條件。 nm 命令預設情況下報告十進位制符號表示法下的數字值。
enable-shared:編譯成動態庫,大概在3.4之前的ffmpeg版本,我們編譯的時候需要修改configure檔案中的一些引數,因為預設生成的so庫檔名有問題,無法直接呼叫,3.4不再需要手動修改
enable-runtime-cpudetect :開啟執行期cpu檢測,不支援的指令可以自動被替換
enable-gpl:ffmpeg要求商用中如果開啟這個gpl,那麼你的程式碼要開源,否則不準開啟,不開啟有些庫無法使用
enable-small:打出來的so更小
enable-asm:允許彙編,指令優化
支援硬解碼,開啟後jni可以呼叫java的原始碼
--enable-jni
--enable-mediacodec
解碼器
--enable-decoder=h264_mediacodec
硬體加速
--enable-hwaccel=h264_mediacodec \
完整的編譯指令碼
這個指令碼目前經過驗證,可以正常的進行編譯3.4版本和3.4.4版本的ffmpeg,前提是需要保證每一個配置引數的正確,一般如果編譯出現問題,大多是由於ndk的幾個路徑錯誤,NDK/PLATFORM/TOOLCHAIN這三個變數核對一下是否和你的ndk目錄一致
#!/bin/bash echo "進入編譯ffmpeg指令碼" NDK=/home/ren/ffmpeg/android-ndk-r14b #5.0 PLATFORM=$NDK/platforms/android-21/arch-arm TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 CPU=arm #輸出路徑 PREFIX=./android/$CPU function build_ffmpeg { echo "開始編譯ffmpeg" ./configure \ --prefix=$PREFIX \ --target-os=android \ --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \ --arch=arm \ --cpu=$CPU\ --extra-libs=-lgcc \ --sysroot=$PLATFORM \ --extra-cflags="$CFLAG" \ --cc=$TOOLCHAIN/bin/arm-linux-androideabi-gcc \ --nm=$TOOLCHAIN/bin/arm-linux-androideabi-nm \ --enable-shared \ --enable-runtime-cpudetect \ --enable-gpl \ --enable-small \ --enable-cross-compile \ --disable-debug \ --disable-static \ --disable-doc \ --disable-ffmpeg \ --disable-ffplay \ --disable-ffprobe \ --disable-ffserver \ --disable-postproc \ --disable-avdevice \ --disable-symver \ --disable-stripping \ $ADD #開啟16個執行緒 make -j16 make install echo "編譯結束!" } ########################################################### echo "編譯支援neon和硬解碼" CPU=armv7-a PREFIX=./android/armv7-a-neon-hard #-fPIC 作用於編譯階段,告訴編譯器產生與位置無關程式碼(Position-Independent Code), #則產生的程式碼中,沒有絕對地址,全部使用相對地址,故而程式碼可以被 #載入器載入到記憶體的任意位置,都可以正確的執行。這正是共享庫所要 #求的,共享庫被載入時,在記憶體的位置不是固定的。 #如果不加-fPIC,則載入.so檔案的程式碼段時,程式碼段引用的資料物件需要重 #定位, 重定位會修改程式碼段的內容,這就造成每個使用這個.so檔案程式碼段 #的程序在核心裡都會生成這個.so檔案程式碼段的copy.每個copy都不一樣, #取決於 這個.so檔案程式碼段和資料段記憶體對映的位置. 也就是 #不加fPIC編譯出來的so,是要再載入時根據載入到的位置再次重定位的.(因 #為它裡面的程式碼並不是位置無關程式碼) #如果被多個應用程式共同使用,那麼它們必須每個程式維護一份.so的程式碼 #副本了.(因為.so被每個程式載入的位置都不同,顯然這些重定位後的程式碼 #也不同,當然不能共享) #我們總是用fPIC來生成so,也從來不用fPIC來生成.a; #-mfpu=neon 浮點協處理器指令,使用硬體浮點的時候,我們需要給編譯器傳遞一些引數,讓編譯器編譯出硬體浮點單元處理器能識別的指令。引數-mfpu就是用來指定要產生哪種硬體浮點運算指令,常用的右vfp和neon等. #-mfloat-abi=soft使用這個引數時,其將呼叫軟浮點庫(softfloat lib)來持 #對浮點的運算,GCC編譯器已經有這個庫了,一般在libgcc裡面。這 #時根本不會使用任何浮點指令,而是採用常用的指令來模擬浮點運算。 #但使用的ARM晶片不支援硬浮點時,可以考慮使用這個引數。 #-mfloat-abi=softfp #-mfloat-abi=hard #這兩個引數都用來產生硬浮點指令,至於產生哪種型別的硬浮點指令, #需要由-mfpu=xxx引數來指令。這兩個引數不同的地方是: #-mfloat-abi=softfp生成的程式碼採用相容軟浮點呼叫介面(即使用-mfloat-abi=soft時的呼叫介面), #這樣帶來的好處是:相容性和靈活性。庫可以採用-mfloat-abi=soft編 #譯,而關鍵的應用程式可以採用-mfloat-abi=softfp來編譯。特別是在庫 #由第三方釋出的情況下。 #-mfloat-abi=hard生成的程式碼採用硬浮點(FPU)呼叫介面。這樣要求所有 #庫和應用程式必須採用這同一個引數來編譯,否則連線時會出現介面不 #相容錯誤。 #預設情況下,gcc在下面目錄中搜索標頭檔案: #/usr/local/include/ #/usr/include/ #在下面目錄中搜索庫: #/usr/local/lib/ #/usr/lib/ CFLAG="-I$PLATFORM/usr/include -fPIC -DANDROID -mfpu=neon -mfloat-abi=softfp " #--enable-asm程式集優化 ADD="--enable-asm \ #neon指令集,開發者可以為需要高效能的應用程式編寫NEON指令來實現相應功能 #NEON:SIMD(SingleInstructionMultipleData單指令多重資料)指令集,其針對多媒體 #和訊號處理程式具備標準化的加速能力。 --enable-neon \ #新增jni支援,那麼ffmpeg可以呼叫java程式碼 --enable-jni \ # 硬解碼相關 --enable-mediacodec \ --enable-decoder=h264_mediacodec \ --enable-hwaccel=h264_mediacodec " build_ffmpeg ########################################################### echo "編譯不支援neon和硬解碼" CPU=armv7-a PREFIX=./android/$CPU #VFP:(VectorFloatPoint),向量浮點運算單元,arm11(s3c6410支援 #VFPv2),Cortex-#A8(s5pv210)支援VFPv3. #-mfpu=name(neonorvfpvx)指定FPU單元 #-mfloat-abi=name(soft、hard、softfp):指定軟體浮點或硬體浮點或相容軟浮點呼叫 #介面 #如果只指定-mfpu,那麼預設編譯不會選擇選擇硬體浮點指令集 #如果只指定-mfloat-abi=hard或者softfp,那麼編譯會使用硬體浮點指令集 CFLAG="-I$PLATFORM/usr/include -fPIC -DANDROID -mfpu=vfp -mfloat-abi=softfp " ADD= build_ffmpeg
ffmpeg編譯引數解析
來自./configure --help
Help options: --helpprint this message --quietSuppress showing informative output --list-decodersshow all available decoders --list-encodersshow all available encoders --list-hwaccelsshow all available hardware accelerators --list-demuxersshow all available demuxers --list-muxersshow all available muxers --list-parsersshow all available parsers --list-protocolsshow all available protocols --list-bsfsshow all available bitstream filters --list-indevsshow all available input devices --list-outdevsshow all available output devices --list-filtersshow all available filters Standard options: --logfile=FILElog tests and output to FILE [ffbuild/config.log] --disable-loggingdo not log configure debug information --fatal-warningsfail if any configure warning is generated --prefix=PREFIXinstall in PREFIX [/usr/local] --bindir=DIRinstall binaries in DIR [PREFIX/bin] --datadir=DIRinstall data files in DIR [PREFIX/share/ffmpeg] --docdir=DIRinstall documentation in DIR [PREFIX/share/doc/ffmpeg] --libdir=DIRinstall libs in DIR [PREFIX/lib] --shlibdir=DIRinstall shared libs in DIR [LIBDIR] --incdir=DIRinstall includes in DIR [PREFIX/include] --mandir=DIRinstall man page in DIR [PREFIX/share/man] --pkgconfigdir=DIRinstall pkg-config files in DIR [LIBDIR/pkgconfig] --enable-rpathuse rpath to allow installing libraries in paths not part of the dynamic linker search path use rpath when linking programs (USE WITH CARE) --install-name-dir=DIRDarwin directory name for installed targets Licensing options: --enable-gplallow use of GPL code, the resulting libs and binaries will be under GPL [no] --enable-version3upgrade (L)GPL to version 3 [no] --enable-nonfreeallow use of nonfree code, the resulting libs and binaries will be unredistributable [no] Configuration options: --disable-staticdo not build static libraries [no] --enable-sharedbuild shared libraries [no] --enable-smalloptimize for size instead of speed --disable-runtime-cpudetect disable detecting CPU capabilities at runtime (smaller binary) --enable-grayenable full grayscale support (slower color) --disable-swscale-alphadisable alpha channel support in swscale --disable-alldisable building components, libraries and programs --disable-autodetectdisable automatically detected external libraries [no] Program options: --disable-programsdo not build command line programs --disable-ffmpegdisable ffmpeg build --disable-ffplaydisable ffplay build --disable-ffprobedisable ffprobe build --disable-ffserverdisable ffserver build Documentation options: --disable-docdo not build documentation --disable-htmlpagesdo not build HTML documentation pages --disable-manpagesdo not build man documentation pages --disable-podpagesdo not build POD documentation pages --disable-txtpagesdo not build text documentation pages Component options: --disable-avdevicedisable libavdevice build --disable-avcodecdisable libavcodec build --disable-avformatdisable libavformat build --disable-swresampledisable libswresample build --disable-swscaledisable libswscale build --disable-postprocdisable libpostproc build --disable-avfilterdisable libavfilter build --enable-avresampleenable libavresample build [no] --disable-pthreadsdisable pthreads [autodetect] --disable-w32threadsdisable Win32 threads [autodetect] --disable-os2threadsdisable OS/2 threads [autodetect] --disable-networkdisable network support [no] --disable-dctdisable DCT code --disable-dwtdisable DWT code --disable-error-resilience disable error resilience code --disable-lspdisable LSP code --disable-lzodisable LZO decoder code --disable-mdctdisable MDCT code --disable-rdftdisable RDFT code --disable-fftdisable FFT code --disable-faandisable floating point AAN (I)DCT code --disable-pixelutilsdisable pixel utils in libavutil Individual component options: --disable-everythingdisable all components listed below --disable-encoder=NAMEdisable encoder NAME --enable-encoder=NAMEenable encoder NAME --disable-encodersdisable all encoders --disable-decoder=NAMEdisable decoder NAME --enable-decoder=NAMEenable decoder NAME --disable-decodersdisable all decoders --disable-hwaccel=NAMEdisable hwaccel NAME --enable-hwaccel=NAMEenable hwaccel NAME --disable-hwaccelsdisable all hwaccels --disable-muxer=NAMEdisable muxer NAME --enable-muxer=NAMEenable muxer NAME --disable-muxersdisable all muxers --disable-demuxer=NAMEdisable demuxer NAME --enable-demuxer=NAMEenable demuxer NAME --disable-demuxersdisable all demuxers --enable-parser=NAMEenable parser NAME --disable-parser=NAMEdisable parser NAME --disable-parsersdisable all parsers --enable-bsf=NAMEenable bitstream filter NAME --disable-bsf=NAMEdisable bitstream filter NAME --disable-bsfsdisable all bitstream filters --enable-protocol=NAMEenable protocol NAME --disable-protocol=NAMEdisable protocol NAME --disable-protocolsdisable all protocols --enable-indev=NAMEenable input device NAME --disable-indev=NAMEdisable input device NAME --disable-indevsdisable input devices --enable-outdev=NAMEenable output device NAME --disable-outdev=NAMEdisable output device NAME --disable-outdevsdisable output devices --disable-devicesdisable all devices --enable-filter=NAMEenable filter NAME --disable-filter=NAMEdisable filter NAME --disable-filtersdisable all filters --disable-v4l2_m2mdisable V4L2 mem2mem code [autodetect] External library support: Using any of the following switches will allow FFmpeg to link to the corresponding external library. All the components depending on that library will become enabled, if all their other dependencies are met and they are not explicitly disabled. E.g. --enable-libwavpack will enable linking to libwavpack and allow the libwavpack encoder to be built, unless it is specifically disabled with --disable-encoder=libwavpack. Note that only the system libraries are auto-detected. All the other external libraries must be explicitly enabled. Also note that the following help text describes the purpose of the libraries themselves, not all their features will necessarily be usable by FFmpeg. --disable-alsadisable ALSA support [autodetect] --disable-appkitdisable Apple AppKit framework [autodetect] --disable-avfoundationdisable Apple AVFoundation framework [autodetect] --enable-avisynthenable reading of AviSynth script files [no] --disable-bzlibdisable bzlib [autodetect] --disable-coreimagedisable Apple CoreImage framework [autodetect] --enable-chromaprintenable audio fingerprinting with chromaprint [no] --enable-frei0renable frei0r video filtering [no] --enable-gcryptenable gcrypt, needed for rtmp(t)e support if openssl, librtmp or gmp is not used [no] --enable-gmpenable gmp, needed for rtmp(t)e support if openssl or librtmp is not used [no] --enable-gnutlsenable gnutls, needed for https support if openssl is not used [no] --disable-iconvdisable iconv [autodetect] --disable-jackdisable libjack support [autodetect] --enable-jnienable JNI support [no] --enable-ladspaenable LADSPA audio filtering [no] --enable-libassenable libass subtitles rendering, needed for subtitles and ass filter [no] --enable-libblurayenable BluRay reading using libbluray [no] --enable-libbs2benable bs2b DSP library [no] --enable-libcacaenable textual display using libcaca [no] --enable-libceltenable CELT decoding via libcelt [no] --enable-libcdioenable audio CD grabbing with libcdio [no] --enable-libdc1394enable IIDC-1394 grabbing using libdc1394 and libraw1394 [no] --enable-libfdk-aacenable AAC de/encoding via libfdk-aac [no] --enable-libfliteenable flite (voice synthesis) support via libflite [no] --enable-libfontconfigenable libfontconfig, useful for drawtext filter [no] --enable-libfreetypeenable libfreetype, needed for drawtext filter [no] --enable-libfribidienable libfribidi, improves drawtext filter [no] --enable-libgmeenable Game Music Emu via libgme [no] --enable-libgsmenable GSM de/encoding via libgsm [no] --enable-libiec61883enable iec61883 via libiec61883 [no] --enable-libilbcenable iLBC de/encoding via libilbc [no] --enable-libkvazaarenable HEVC encoding via libkvazaar [no] --enable-libmodplugenable ModPlug via libmodplug [no] --enable-libmp3lameenable MP3 encoding via libmp3lame [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-libopencvenable video filtering via libopencv [no] --enable-libopenh264enable H.264 encoding via OpenH264 [no] --enable-libopenjpegenable JPEG 2000 de/encoding via OpenJPEG [no] --enable-libopenmptenable decoding tracked files via libopenmpt [no] --enable-libopusenable Opus de/encoding via libopus [no] --enable-libpulseenable Pulseaudio input via libpulse [no] --enable-librsvgenable SVG rasterization via librsvg [no] --enable-librubberbandenable rubberband needed for rubberband filter [no] --enable-librtmpenable RTMP[E] support via librtmp [no] --enable-libshineenable fixed-point MP3 encoding via libshine [no] --enable-libsmbclientenable Samba protocol via libsmbclient [no] --enable-libsnappyenable Snappy compression, needed for hap encoding [no] --enable-libsoxrenable Include libsoxr resampling [no] --enable-libspeexenable Speex de/encoding via libspeex [no] --enable-libsshenable SFTP protocol via libssh [no] --enable-libtesseractenable Tesseract, needed for ocr filter [no] --enable-libtheoraenable Theora encoding via libtheora [no] --enable-libtwolameenable MP2 encoding via libtwolame [no] --enable-libv4l2enable libv4l2/v4l-utils [no] --enable-libvidstabenable video stabilization using vid.stab [no] --enable-libvmafenable vmaf filter via libvmaf [no] --enable-libvo-amrwbencenable AMR-WB encoding via libvo-amrwbenc [no] --enable-libvorbisenable Vorbis en/decoding via libvorbis, native implementation exists [no] --enable-libvpxenable VP8 and VP9 de/encoding via libvpx [no] --enable-libwavpackenable wavpack encoding via libwavpack [no] --enable-libwebpenable WebP encoding via libwebp [no] --enable-libx264enable H.264 encoding via x264 [no] --enable-libx265enable HEVC encoding via x265 [no] --enable-libxavsenable AVS encoding via xavs [no] --enable-libxcbenable X11 grabbing using XCB [autodetect] --enable-libxcb-shmenable X11 grabbing shm communication [autodetect] --enable-libxcb-xfixesenable X11 grabbing mouse rendering [autodetect] --enable-libxcb-shapeenable X11 grabbing shape rendering [autodetect] --enable-libxvidenable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] --enable-libxml2enable XML parsing using the C library libxml2 [no] --enable-libzimgenable z.lib, needed for zscale filter [no] --enable-libzmqenable message passing via libzmq [no] --enable-libzvbienable teletext support via libzvbi [no] --disable-lzmadisable lzma [autodetect] --enable-decklinkenable Blackmagic DeckLink I/O support [no] --enable-libndi_newtekenable Newteck NDI I/O support [no] --enable-mediacodecenable Android MediaCodec support [no] --enable-libmysofaenable libmysofa, needed for sofalizer filter [no] --enable-openalenable OpenAL 1.1 capture support [no] --enable-openclenable OpenCL code --enable-openglenable OpenGL rendering [no] --enable-opensslenable openssl, needed for https support if gnutls is not used [no] --disable-sndiodisable sndio support [autodetect] --disable-schanneldisable SChannel SSP, needed for TLS support on Windows if openssl and gnutls are not used [autodetect] --disable-sdl2disable sdl2 [autodetect] --disable-securetransport disable Secure Transport, needed for TLS support on OSX if openssl and gnutls are not used [autodetect] --disable-xlibdisable xlib [autodetect] --disable-zlibdisable zlib [autodetect] The following libraries provide various hardware acceleration features: --disable-audiotoolboxdisable Apple AudioToolbox code [autodetect] --disable-cudadisable dynamically linked Nvidia CUDA code [autodetect] --enable-cuda-sdkenable CUDA features that require the CUDA SDK [no] --disable-cuviddisable Nvidia CUVID support [autodetect] --disable-d3d11vadisable Microsoft Direct3D 11 video acceleration code [autodetect] --disable-dxva2disable Microsoft DirectX 9 video acceleration code [autodetect] --enable-libdrmenable DRM code (Linux) [no] --enable-libmfxenable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no] --enable-libnppenable Nvidia Performance Primitives-based code [no] --enable-mmalenable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no] --disable-nvencdisable Nvidia video encoding code [autodetect] --enable-omxenable OpenMAX IL code [no] --enable-omx-rpienable OpenMAX IL code for Raspberry Pi [no] --enable-rkmppenable Rockchip Media Process Platform code [no] --disable-vaapidisable Video Acceleration API (mainly Unix/Intel) code [autodetect] --disable-vdadisable Apple Video Decode Acceleration code [autodetect] --disable-vdpaudisable Nvidia Video Decode and Presentation API for Unix code [autodetect] --disable-videotoolboxdisable VideoToolbox code [autodetect] Toolchain options: --arch=ARCHselect architecture [] --cpu=CPUselect the minimum required CPU (affects instruction selection, may crash on older CPUs) --cross-prefix=PREFIXuse PREFIX for compilation tools [] --progs-suffix=SUFFIXprogram name suffix [] --enable-cross-compileassume a cross-compiler is used --sysroot=PATHroot of cross-build tree --sysinclude=PATHlocation of cross-build system headers --target-os=OScompiler targets OS [] --target-exec=CMDcommand to run executables on target --target-path=DIRpath to view of build directory on target --target-samples=DIRpath to samples directory on target --tempprefix=PATHforce fixed dir/prefix instead of mktemp for checks --toolchain=NAMEset tool defaults according to NAME --nm=NMuse nm tool NM [nm -g] --ar=ARuse archive tool AR [ar] --as=ASuse assembler AS [] --ln_s=LN_Suse symbolic link tool LN_S [ln -s -f] --strip=STRIPuse strip tool STRIP [strip] --windres=WINDRESuse windows resource compiler WINDRES [windres] --x86asmexe=EXEuse nasm-compatible assembler EXE [nasm] --cc=CCuse C compiler CC [gcc] --cxx=CXXuse C compiler CXX [g++] --objcc=OCCuse ObjC compiler OCC [gcc] --dep-cc=DEPCCuse dependency generator DEPCC [gcc] --nvcc=NVCCuse Nvidia CUDA compiler NVCC [nvcc] --ld=LDuse linker LD [] --pkg-config=PKGCONFIGuse pkg-config tool PKGCONFIG [pkg-config] --pkg-config-flags=FLAGS pass additional flags to pkgconf [] --ranlib=RANLIBuse ranlib RANLIB [ranlib] --doxygen=DOXYGENuse DOXYGEN to generate API doc [doxygen] --host-cc=HOSTCCuse host C compiler HOSTCC --host-cflags=HCFLAGSuse HCFLAGS when compiling for host --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host --host-ld=HOSTLDuse host linker HOSTLD --host-ldflags=HLDFLAGSuse HLDFLAGS when linking for host --host-libs=HLIBSuse libs HLIBS when linking for host --host-os=OScompiler host OS [] --extra-cflags=ECFLAGSadd ECFLAGS to CFLAGS [] --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [] --extra-objcflags=FLAGSadd FLAGS to OBJCFLAGS [] --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [] --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [] --extra-ldlibflags=ELDFLAGS add ELDFLAGS to LDLIBFLAGS [] --extra-libs=ELIBSadd ELIBS [] --extra-version=STRINGversion string suffix [] --optflags=OPTFLAGSoverride optimization-related compiler flags --nvccflags=NVCCFLAGSoverride nvcc flags [-gencode arch=compute_30,code=sm_30 -O2] --build-suffix=SUFFIXlibrary name suffix [] --enable-picbuild position-independent code --enable-thumbcompile for Thumb instruction set --enable-ltouse link-time optimization --env="ENV=override"override the environment variables Advanced options (experts only): --malloc-prefix=PREFIXprefix malloc and related names with PREFIX --custom-allocator=NAMEuse a supported custom allocator --disable-symverdisable 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) --sws-max-filter-size=Nthe max filter size swscale uses [256] Optimization options (experts only): --disable-asmdisable all assembly optimizations --disable-altivecdisable AltiVec optimizations --disable-vsxdisable VSX optimizations --disable-power8disable POWER8 optimizations --disable-amd3dnowdisable 3DNow! optimizations --disable-amd3dnowextdisable 3DNow! extended optimizations --disable-mmxdisable MMX optimizations --disable-mmxextdisable MMXEXT optimizations --disable-ssedisable SSE optimizations --disable-sse2disable SSE2 optimizations --disable-sse3disable SSE3 optimizations --disable-ssse3disable SSSE3 optimizations --disable-sse4disable SSE4 optimizations --disable-sse42disable SSE4.2 optimizations --disable-avxdisable AVX optimizations --disable-xopdisable XOP optimizations --disable-fma3disable FMA3 optimizations --disable-fma4disable FMA4 optimizations --disable-avx2disable AVX2 optimizations --disable-aesnidisable AESNI optimizations --disable-armv5tedisable armv5te optimizations --disable-armv6disable armv6 optimizations --disable-armv6t2disable armv6t2 optimizations --disable-vfpdisable VFP optimizations --disable-neondisable NEON optimizations --disable-inline-asmdisable use of inline assembly --disable-x86asmdisable use of standalone x86 assembly --disable-mipsdspdisable MIPS DSP ASE R1 optimizations --disable-mipsdspr2disable MIPS DSP ASE R2 optimizations --disable-msadisable MSA optimizations --disable-mipsfpudisable floating point MIPS optimizations --disable-mmidisable Loongson SIMD optimizations --disable-fast-unaligned consider unaligned accesses slow Developer options (useful when working on FFmpeg itself): --disable-debugdisable debugging symbols --enable-debug=LEVELset the debug level [] --disable-optimizationsdisable compiler optimizations --enable-extra-warningsenable more compiler warnings --disable-strippingdisable stripping of executables and shared libraries --assert-level=level0(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=VALGRINDrun "make fate" tests through valgrind to detect memory leaks and errors, using the specified valgrind binary. Cannot be combined with --target-exec --enable-ftrapvTrap arithmetic overflows --samples=PATHlocation 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-randomrandomly enable/disable components --disable-random --enable-random=LISTrandomly enable/disable specific components or --disable-random=LISTcomponent 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=VALUEseed value for --enable/disable-random --disable-valgrind-backtrace do not print a backtrace under Valgrind (only applies to --disable-optimizations builds) --enable-osfuzzEnable building fuzzer tool --libfuzzer=PATHpath to libfuzzer --ignore-tests=TESTScomma-separated list (without "fate-" prefix in the name) of tests whose result is ignored --enable-linux-perfenable Linux Performance Monitor API