编写shell脚本编译FFmpeg(一)

首先查看 FFmpeg 的编译选项
进入 FFmpeg框架包,并且带参数执行配置文件,查看帮助


图片.png

查看配置帮助

zjjf$ ./configure --help

然后出现一大堆可配置项

Usage: configure [options]
Options: [defaults in brackets after descriptions]

帮助选项

Help options:
  --help                   print this message
  --quiet                  Suppress showing informative output
  --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:
//打印 log 日志(配置日志文件输出路径)
  --logfile=FILE           log tests and output to FILE [ffbuild/config.log]
//不打印日志
  --disable-logging        do not log configure debug information
//如果生成警告
  --fatal-warnings         fail if any configure warning is generated
//输出打包出的.a静态库的路径
  --prefix=PREFIX          install in PREFIX [/usr/local]
  --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 [LIBDIR]
  --incdir=DIR             install includes in DIR [PREFIX/include]
  --mandir=DIR             install man page in DIR [PREFIX/share/man]
  --pkgconfigdir=DIR       install pkg-config files in DIR [LIBDIR/pkgconfig]
  --enable-rpath           use 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=DIR   Darwin directory name for installed targets

许可选项(涉及到开源框架的侵权许可)

Licensing options:
//允许使用GPL代码,由此生成二进制文件(库)
//GPL:开源、免费、公用的许可
  --enable-gpl             allow use of GPL code, the resulting libs
                           and binaries will be under GPL [no]
//GPL的版本
  --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]

高级选项

Advanced options (experts only):
  --malloc-prefix=PREFIX   prefix malloc and related names with PREFIX
  --custom-allocator=NAME  use a supported custom allocator

最优选项

Optimization options (experts only):
  --disable-asm            disable all assembly optimizations
  --disable-altivec        disable AltiVec optimizations

开发者选项

Developer options (useful when working on FFmpeg itself):
  --disable-debug          disable debugging symbols
  --enable-debug=LEVEL     set the debug lev

配置备选项

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
  --disable-autodetect     disable automatically detected external libraries [no]

组件选项(FFmpeg核心的八个库)

Component options:
  --disable-avdevice       disable libavdevice build
  --disable-avcodec        disable libavcodec build
  --disable-avformat       disable libavformat 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]

外部的库支持(重点)

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-alsa           disable ALSA support [autodetect]
  --disable-appkit         disable Apple AppKit framework [autodetect]
  --disable-avfoundation   disable Apple AVFoundation framework [autodetect]
//启用 aac 编码
  --enable-libfdk-aac      enable AAC de/encoding via libfdk-aac [no]

工具链选项(重点)-->指定编译平台的架构类型,如:arm64、x86...

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 []
//指定编译什么系统下的架构
 --target-os=OS           compiler targets OS []

后面还有一大堆......请自行实践查看

配置简介

//当前可用的解码器
  --list-decoders          show all available decoders

查看所有解码器

zjjf$ ./configure --list-decoders 
aac            atrac1             eatqi
aac_at             atrac3             eightbps
aac_fixed          atrac3al           eightsvx_exp
aac_latm           atrac3p            eightsvx_fib
aasc               atrac3pal              escape124
后面还有一大堆......请自行实践查看

查看所有编码器

  --list-encoders          show all available encoders
zjjf$ ./configure --list-decoders 
a64multi           libgsm             pcm_s32le
a64multi5          libgsm_ms              pcm_s32le_planar
aac            libilbc            pcm_s64be
aac_at             libkvazaar             pcm_s64le
ac3            libmp3lame             pcm_s8
后面还有一大堆......请自行实践查看

查看所有可用的硬件加速

  --list-hwaccels          show all available hardware accelerators
zjjf$ ./configure --list-hwaccels
h263_vaapi         mjpeg_cuvid            vc1_d3d11va
h263_videotoolbox      mpeg1_cuvid            vc1_d3d11va2
h264_cuvid         mpeg1_vdpau            vc1_dxva2
后面还有一大堆......请自行实践查看
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 157,012评论 4 359
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 66,589评论 1 290
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 106,819评论 0 237
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,652评论 0 202
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 51,954评论 3 285
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,381评论 1 210
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,687评论 2 310
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,404评论 0 194
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,082评论 1 238
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,355评论 2 241
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 31,880评论 1 255
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,249评论 2 250
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 32,864评论 3 232
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,007评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,760评论 0 192
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,394评论 2 269
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,281评论 2 259

推荐阅读更多精彩内容

  • 1、通过CocoaPods安装项目名称项目信息 AFNetworking网络请求组件 FMDB本地数据库组件 SD...
    X先生_未知数的X阅读 15,934评论 3 118
  • 我以拒绝长大的方式爱着父亲 参加会议,会上主持人通报相关单位暗访工作纪律情况,我科室人员位列其中,我有些愤怒,因为...
    漂亮的花阅读 471评论 1 2
  • 8/30笔墨里的时光第八天 前言:从今天开始,记录自己心灵成长故事,梳理过去,找到更好的自己! 不知从什么...
    真真1阅读 371评论 0 0
  • “猴”老师?? 小学六年里有个五六个数学老师,其中当然有比较喜欢和不怎么喜欢的,在上二年级的时候,数学老师姓侯。 ...
    沐阳燕阅读 563评论 0 2
  • 1. 你怎么界定“适合” “我似不似不适合这个工作啊?” 这几乎是所有职业迷茫者最爱问的问题。 作为朋友、咨询师、...
    治愈马阅读 818评论 0 5