-
- 帮助选项Help options
- 标准选项Standard options
- 许可证选项Licensing options
- 配置选项Configuration options
- 程序选项Program options
- 文档选项Documentation options
- 组件选项Component options
- 个别组件选项Individual component options
- 扩展库支持External library support
- 工具链选项Toolchain options
- 高级选项Advanced options
- 优化选项Optimization options
- 开发者选项Developer options
用于查看ffmpeg的能力
选项 | 说明 |
---|---|
print this message | |
显示所有可用的解码器(h264/mjpeg等) | |
显示所有可用的编码器(h264/mjpeg等) | |
显示所有支持的硬编解码器(h264_videotoolbox/h264_mediacodec等) | |
显示所有支持解复用的容器(mp4/h264等) | |
显示所有支持复用的容器(mp4/h264等) | |
show all available parsers | |
显示所有支持的传输协议(rtmp/rtp等) | |
显示所有可用的格式转换(h264_mp4toannexb/aac_adtstoasc等) | |
显示所有支持的输入设备(alsa/v4l2等) | |
显示所有支持的输出设备(alsa/opengl等) | |
显示支持的所有过滤器(scale/volume/fps/allyuv等) |
编译配置
选项 | 说明 |
---|---|
配置过程中的log输出文件,默认输出到当前位置的ffbuild/config.log文件 | |
配置过程中不输出日志 | |
把配置过程中的任何警告当做致命的错误处理 | |
设定安装的跟目录,如果不指定默认是/usr | |
设置可执行程序的安装位置,默认是[PREFIX/bin] | |
设置测试程序以及数据的安装位置,默认是[PREFIX/share/ffmpeg] | |
设置文档的安装目录,默认是[PREFIX/share/doc/ffmpeg] | |
设置静态库的安装位置,默认是[PREFIX/lib] | |
设置动态库的安装位置,默认是[LIBDIR] | |
设置头文件的安装位置,默认是[PREFIX/include];一般来说用于依赖此头文件来开发就够了 | |
设置man文件的安装目录,默认是[PREFIX/share/man] | |
设置pkgconfig的安装目录,默认是[LIBDIR/pkgconfig],只有--enable-shared 使能的时候这个选项才有效 | |
use rpath to allow installing libraries in paths not part of the dynamic linker search path use rpath when linking programs [USE WITH CARE] | |
Darwin directory name for installed targets |
选择许可证,FFMPEG默认许可证LGPL 2.1,如果需要加gpl的库需要使用gpl的许可证,例如libx264就是gpl的,如果需要加入libx264则需要--enable-gpl
。
选项 | 说明 |
---|---|
allow use of GPL code, the resulting libs and binaries will be under GPL [no] | |
upgrade (L)GPL to version 3 [no] | |
allow use of nonfree code, the resulting libs and binaries will be unredistributable [no] |
编译选项的配置
选项 | 说明 |
---|---|
不生产静态库,默认生成静态库 | |
生成动态库,默认不生成动态库 | |
optimize for size instead of speed,默认开启 | |
disable detecting cpu capabilities at runtime (smaller binary),默认开启 | |
enable full grayscale support (slower color) | |
disable alpha channel support in swscale | |
禁止编译所有库和可执行程序 | |
增加主版本号 |
可执行程序开启选项,默认编译ffmpeg中的所有可执行程序,包括ffmpeg、ffplay、ffprobe、ffserver,不过Mac平台默认情况下不生成ffplay,目前暂未知道啥原因。
选项 | 说明 |
---|---|
do not build command line programs | |
disable ffmpeg build | |
disable ffplay build | |
disable ffprobe build | |
disable ffserver build |
离线文档选择
选项 | 说明 |
---|---|
do not build documentation | |
do not build HTML documentation pages | |
do not build man documentation pages | |
do not build POD documentation pages | |
do not build text documentation pages |
除了avresample模块,默认编译所有模块。一般来说用于轻量化ffmpeg库的大小,可以仅仅开启指定某些组件的某些功能。
选项 | 说明 |
---|---|
disable libavdevice build | |
disable libavcodec build | |
disable libavformat build | |
disable libswresample build | |
disable libswscale build | |
disable libpostproc build | |
disable libavfilter build | |
enable libavresample build [no] | |
disable pthreads [autodetect] | |
disable Win32 threads [autodetect] | |
disable OS/2 threads [autodetect] | |
disable network support [no] | |
disable DCT code | |
disable DWT code | |
disable error resilience code | |
disable LSP code | |
disable LZO decoder code | |
disable MDCT code | |
disable RDFT code | |
disable FFT code | |
disable floating point AAN (I)DCT code | |
disable pixel utils in libavutil |
可以用于设定开启指定功能,例如禁止所有encoders,在这里可以开启特定的encoders(x264、aac等)
选项 | 说明 |
---|---|
disable all components listed below | |
disable encoder NAME | |
enable encoder NAME | |
disable all encoders | |
disable decoder NAME | |
enable decoder NAME | |
disable all decoders | |
disable hwaccel NAME | |
enable hwaccel NAME | |
disable all hwaccels | |
disable muxer NAME | |
enable muxer NAME | |
disable all muxers | |
disable demuxer NAME | |
enable demuxer NAME | |
disable all demuxers | |
enable parser NAME | |
disable parser NAME | |
disable all parsers | |
enable bitstream filter NAME | |
disable bitstream filter NAME | |
disable all bitstream filters | |
enable protocol NAME | |
disable protocol NAME | |
disable all protocols | |
enable input device NAME | |
disable input device NAME | |
disable input devices | |
enable output device NAME | |
disable output device NAME | |
disable output devices | |
disable all devices | |
enable filter NAME | |
disable filter NAME | |
disable all filters |
ffmpeg提供的一些功能是由其他扩展库支持的,如果需要使用需要明确声明,确定编译的第三方库的目标架构--arch
相同就好了,在编译ffmpeg的时候需加入第三方库的头文和库搜索路径(通过extra-cflags
和extra-ldflags
指定即可),剩下的事ffmpeg都给你做好了。
$ git clone http://source.ffmpeg.org/git/ffmpeg.git $ cd x264 $ ./configure --prefix=$FFMPEG_PREFIX --enable-static --enable-shared $ make -j8 && make install
- 1
- 2
- 3
- 4
选项 | 说明 |
---|---|
enable reading of AviSynth script files [no] | |
disable bzlib [autodetect] | |
enable audio fingerprinting with chromaprint [no] | |
enable frei0r video filtering [no] | |
enable gcrypt, needed for rtmp(t)e support if openssl, librtmp or gmp is not used [no] | |
enable gmp, needed for rtmp(t)e support if openssl or librtmp is not used [no] | |
enable gnutls, needed for https support if openssl is not used [no] | |
disable iconv [autodetect] | |
enable JNI support [no] | |
enable LADSPA audio filtering [no] | |
enable libass subtitles rendering, needed for subtitles and ass filter [no] | |
enable BluRay reading using libbluray [no] | |
enable bs2b DSP library [no] | |
enable textual display using libcaca [no] | |
enable CELT decoding via libcelt [no] | |
enable audio CD grabbing with libcdio [no] | |
enable IIDC-1394 grabbing using libdc1394 and libraw1394 [no] | |
enable libebur128 for EBU R128 measurement, needed for loudnorm filter [no] | |
enable AAC de/encoding via libfdk-aac [no] | |
enable flite (voice synthesis) support via libflite [no] | |
enable libfontconfig, useful for drawtext filter [no] | |
enable libfreetype, needed for drawtext filter [no] | |
enable libfribidi, improves drawtext filter [no] | |
enable Game Music Emu via libgme [no] | |
enable GSM de/encoding via libgsm [no] | |
enable iec61883 via libiec61883 [no] | |
enable iLBC de/encoding via libilbc [no] | |
enable HEVC encoding via libkvazaar [no] | |
enable ModPlug via libmodplug [no] | |
enable MP3 encoding via libmp3lame [no] | |
enable NUT (de)muxing via libnut, native (de)muxer exists [no] | |
enable AMR-NB de/encoding via libopencore-amrnb [no] | |
enable AMR-WB decoding via libopencore-amrwb [no] | |
enable video filtering via libopencv [no] | |
enable H.264 encoding via OpenH264 [no] | |
enable JPEG 2000 de/encoding via OpenJPEG [no] | |
enable decoding tracked files via libopenmpt [no] | |
enable Opus de/encoding via libopus [no] | |
enable Pulseaudio input via libpulse [no] | |
enable rubberband needed for rubberband filter [no] | |
enable RTMP[E] support via librtmp [no] | |
enable Dirac de/encoding via libschroedinger [no] | |
enable fixed-point MP3 encoding via libshine [no] | |
enable Samba protocol via libsmbclient [no] | |
enable Snappy compression, needed for hap encoding [no] | |
enable Include libsoxr resampling [no] | |
enable Speex de/encoding via libspeex [no] | |
enable SFTP protocol via libssh [no] | |
enable Tesseract, needed for ocr filter [no] | |
enable Theora encoding via libtheora [no] | |
enable MP2 encoding via libtwolame [no] | |
enable libv4l2/v4l-utils [no] | |
enable video stabilization using vid.stab [no] | |
enable AMR-WB encoding via libvo-amrwbenc [no] | |
enable Vorbis en/decoding via libvorbis, native implementation exists [no] | |
enable VP8 and VP9 de/encoding via libvpx [no] | |
enable wavpack encoding via libwavpack [no] | |
enable WebP encoding via libwebp [no] | |
enable H.264 encoding via x264 [no] | |
enable HEVC encoding via x265 [no] | |
enable AVS encoding via xavs [no] | |
enable X11 grabbing using XCB [autodetect] | |
enable X11 grabbing shm communication [autodetect] | |
enable X11 grabbing mouse rendering [autodetect] | |
enable X11 grabbing shape rendering [autodetect] | |
enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] | |
enable z.lib, needed for zscale filter [no] | |
enable message passing via libzmq [no] | |
enable teletext support via libzvbi [no] | |
disable lzma [autodetect] | |
enable Blackmagic DeckLink I/O support [no] | |
enable Android MediaCodec support [no] | |
enable NetCDF, needed for sofalizer filter [no] | |
enable OpenAL 1.1 capture support [no] | |
enable OpenCL code | |
enable OpenGL rendering [no] | |
enable openssl, needed for https support if gnutls is not used [no] | |
disable SChannel SSP, needed for TLS support on Windows if openssl and gnutls are not used [autodetect] | |
disable sdl2 [autodetect] | |
disable Secure Transport, needed for TLS support on OSX if openssl and gnutls are not used [autodetect] | |
enable X11 grabbing (legacy) [no] | |
disable xlib [autodetect] | |
disable zlib [autodetect] |
ffmpeg默认实现了移动端(Android和IOS)的硬编解码,可以选择disable的都是默认开启的,可以关闭,可以选择enable的都是需要自己解决依赖的。
选项 | 说明 |
---|---|
disable Apple AudioToolbox code [autodetect] | |
enable dynamically linked Nvidia CUDA code [no] | |
enable Nvidia CUVID support [autodetect] | |
disable Microsoft Direct3D 11 video acceleration code [autodetect] | |
disable Microsoft DirectX 9 video acceleration code [autodetect] | |
enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no] | |
enable Nvidia Performance Primitives-based code [no] | |
enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no] | |
disable Nvidia video encoding code [autodetect] | |
enable OpenMAX IL code [no] | |
enable OpenMAX IL code for Raspberry Pi [no] | |
disable Video Acceleration API (mainly Unix/Intel) code [autodetect] | |
disable Apple Video Decode Acceleration code [autodetect] | |
disable Nvidia Video Decode and Presentation API for Unix code [autodetect] | |
disable VideoToolbox code [autodetect] |
ffmpeg代码本身是支持跨平台的,要编译不同的平台需要配置不同平台的交叉编译工具链。ffmpeg都是c代码,所以不需要配置c++的sysroot。常用的就几个arch
,cpu
,cross-prefix
,enable-cross-compile
,sysroot
,target-os
,extra-cflags
,extra-ldflags
,enable-pic
。现在Android和IOS几乎没有armv5的设备了,所以如果编译这两个平台配置armv7和armv8就好了。
选项 | 说明 |
---|---|
选择目标架构[armv7a/aarch64/x86/x86_64等] | |
选择目标cpu[armv7-a/armv8-a/x86/x86_64] | |
设定交叉编译工具链的前缀,不算gcc/nm/as命令,例如android 32位的交叉编译链$ndk_dir/toolchains/arm-linux-androideabi-$toolchain_version/prebuilt/linux-$host_arch/bin/arm-linux-androideabi- | |
program name suffix [] | |
如果目标平台和编译平台不同则需要使能它 | |
交叉工具链的头文件和库位,例如Android 32位位置$ndk_dir/platforms/android-14/arch-arm | |
location of cross-build system headers | |
设置目标系统 | |
command to run executables on target | |
path to view of build directory on target | |
path to samples directory on target | |
force fixed dir/prefix instead of mktemp for checks | |
set tool defaults according to NAME | |
use nm tool NM [nm -g] | |
use archive tool AR [ar] | |
use assembler AS [] | |
use symbolic link tool LN_S [ln -s -f] | |
use strip tool STRIP [strip] | |
use windows resource compiler WINDRES [windres] | |
use yasm-compatible assembler EXE [yasm] | |
use C compiler CC [gcc] | |
use C compiler CXX [g++] | |
use ObjC compiler OCC [gcc] | |
use dependency generator DEPCC [gcc] | |
use linker LD [] | |
use pkg-config tool PKGCONFIG [pkg-config] | |
pass additional flags to pkgconf [] | |
use ranlib RANLIB [ranlib] | |
use DOXYGEN to generate API doc [doxygen] | |
use host C compiler HOSTCC | |
use HCFLAGS when compiling for host | |
use HCPPFLAGS when compiling for host | |
use host linker HOSTLD | |
use HLDFLAGS when linking for host | |
use libs HLIBS when linking for host | |
compiler host OS [] | |
设置cflags,如果是Android平台可以根据ndk内的设定,arm-linux-androideabi-4.6/setup.mk,建议参考你当前的setup来配置 | |
add ECFLAGS to CXXFLAGS [] | |
add FLAGS to OBJCFLAGS [] | |
参考cflags | |
add ELDFLAGS to LDEXEFLAGS [] | |
add ELDFLAGS to LDLIBFLAGS [] | |
add ELIBS [] | |
version string suffix [] | |
override optimization-related compiler flags | |
library name suffix [] | |
build position-independent code | |
compile for Thumb instruction set | |
use link-time optimization | |
override the environment variables |
选项 | 说明 |
---|---|
prefix malloc and related names with PREFIX | |
use a supported custom allocator | |
disable symbol versioning | |
use hardcoded tables instead of runtime generation | |
disable buffer boundary checking in bitreaders (faster, but may crash) | |
emulate memalign, interferes with memory debuggers | |
the max filter size swscale uses [256] |
默认开启各个平台的汇编优化,有些嵌入式平台可能并不能完整的支持架构的所有汇编指令,所以需要关闭。(自己理解的,没有实战)
选项 | 说明 |
---|---|
disable all assembly optimizations | |
disable AltiVec optimizations | |
disable VSX optimizations | |
disable POWER8 optimizations | |
disable 3DNow! optimizations | |
disable 3DNow! extended optimizations | |
disable MMX optimizations | |
disable MMXEXT optimizations | |
disable SSE optimizations | |
disable SSE2 optimizations | |
disable SSE3 optimizations | |
disable SSSE3 optimizations | |
disable SSE4 optimizations | |
disable SSE4.2 optimizations | |
disable AVX optimizations | |
disable XOP optimizations | |
disable FMA3 optimizations | |
disable FMA4 optimizations | |
disable AVX2 optimizations | |
disable AESNI optimizations | |
disable armv5te optimizations | |
disable armv6 optimizations | |
disable armv6t2 optimizations | |
disable VFP optimizations | |
disable NEON optimizations | |
disable use of inline assembly | |
disable use of nasm/yasm assembly | |
disable MIPS DSP ASE R1 optimizations | |
disable MIPS DSP ASE R2 optimizations | |
disable MSA optimizations | |
disable floating point MIPS optimizations | |
disable Loongson SIMD optimizations | |
consider unaligned accesses slow |
调试用的一些开关
选项 | 说明 |
---|---|
disable debugging symbols | |
set the debug level [] | |
disable compiler optimizations | |
enable more compiler warnings | |
disable stripping of executables and shared libraries | |
0(default), 1 or 2, amount of assertion testing, 2 causes a slowdown at runtime. | |
fill heap uninitialized allocated space with arbitrary data | |
Trap arithmetic overflows | |
location of test samples for FATE, if not set use $FATE_SAMPLES at make invocation time. | |
check NEON registers for clobbering (should be used only for debugging purposes) | |
check XMM registers for clobbering (Win64-only; should be used only for debugging purposes) | |
randomly enable/disable components | |
randomly enable/disable specific components or | |
component groups. LIST is a comma-separated list of NAME[:PROB] entries where NAME is a component (group) and PROB the probability associated with | |