源码裁剪参考:

ffmpeg源码裁剪移植到arm-linux

ffmpeg可以通过配置不同的编译选项来裁剪ffmpeg本身的大小,下面我基于2.1.3版本来说明。

至于支持哪些编译选项,可输入 ./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 filtersStandard 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]Licensing options:--enable-gpl             allow use of GPL code, the resulting libsand binaries will be under GPL [no]--enable-version3        upgrade (L)GPL to version 3 [no]--enable-nonfree         allow use of nonfree code, the resulting libsand 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-incompatible-fork-abi  enable incompatible Libav fork ABI (deprecated) [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 buildDocumentation 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 pagesComponent 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 codeHardware accelerators:--disable-dxva2          disable DXVA2 code [autodetect]--disable-vaapi          disable VAAPI code [autodetect]--enable-vda             enable VDA code--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 filtersExternal 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-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 libdc1394and 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-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 decoding 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-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-libx264         enable H.264 encoding via x264 [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-openal          enable OpenAL 1.1 capture support [no]--enable-opencl          enable OpenCL code--enable-openssl         enable openssl [no]--enable-x11grab         enable X11 grabbing [no]--disable-zlib           disable zlib [autodetect]Advanced options (experts only):--cross-prefix=PREFIX    use PREFIX for compilation tools []--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 []--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 []--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-libs=ELIBS       add ELIBS []--extra-version=STRING   version string suffix []--optflags=OPTFLAGS      override optimization-related compiler flags--build-suffix=SUFFIX    library name suffix []--malloc-prefix=PREFIX   prefix malloc and related names with PREFIX--progs-suffix=SUFFIX    program name suffix []--arch=ARCH              select architecture []--cpu=CPU                select the minimum required CPU (affectsinstruction selection, may crash on older CPUs)--enable-pic             build position-independent code--enable-sram            allow use of on-chip SRAM--enable-thumb           compile for Thumb instruction set--disable-symver         disable symbol versioning--enable-hardcoded-tables use hardcoded tables instead of runtime generation--disable-safe-bitstream-readerdisable buffer boundary checking in bitreaders(faster, but may crash)--enable-memalign-hack   emulate memalign, interferes with memory debuggers--enable-lto             use link-time optimizationOptimization options (experts only):--disable-asm            disable all assembler 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-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-vis            disable VIS optimizations--disable-inline-asm     disable use of inline assembler--disable-yasm           disable use of yasm assembler--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 slowDeveloper 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 memoryleaks 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-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 listof NAME[:PROB] entries where NAME is a component(group) and PROB the probability associated withNAME (default 0.5).--random-seed=VALUE      seed value for --enable/disable-randomNOTE: Object files are built at the place where configure is launched.

帮助介绍得很详细,我就不一一叙述了,主要提一下注意的点:

所有的enable/disable选项都有默认值, 列出来的选项内容如果是

--enable-xxx :说明默认是禁止的

--disable-xxx:说明默认是使能的

(PS: 当然有些选项说明后面也提示了 [NO] 来说明默认禁止)

--disable-all: disable building components, libraries and programs(加了这个选项后,所有库,执行文件都不会生成)

--disable-everything:disable all components listed below(加了这个选项,encoder,decoder,muxer,demuxer,protocol等等都不会编入库中)

基于上述两个选项,我们可以这么做:

首先--disable-all 禁止所有东西,然后加 --enable-avformat --enable-avcodec --enable-avutil 使能我们要的三个模块。

接着--disable-everything禁止组件中个所有子模块,然后--enable-muxer=mp4 --enable-muxer=avi --enable-protocol=file --enable-encoder=mpeg4,因为我们只需要往MP4或AVI文件写H264流

下面是我最终的编译选项:

./configure --prefix=./install --enable-cross-compile --target-os=linux --cpu=cortex-a7 --arch=arm --cross-prefix=arm-hisiv300-linux- --enable-small --disable-runtime-cpudetect  --disable-all --enable-avformat --enable-avcodec --enable-avutil --disable-everything --enable-muxer=mp4 --enable-muxer=avi --enable-protocol=file --enable-encoder=mpeg4 --disable-doc  --disable-debug --disable-iconv --disable-armv5te --disable-armv6 --disable-armv6t2

敲入上面编译选项,可得下面汇总情况:

install prefix            ./install
source path               .
C compiler                arm-hisiv300-linux-gcc
ARCH                      arm (cortex-a7)
big-endian                no
runtime cpu detection     no
ARMv5TE enabled           no
ARMv6 enabled             no
ARMv6T2 enabled           no
VFP enabled               yes
NEON enabled              yes
THUMB enabled             no
debug symbols             no
strip symbols             yes
optimize for size         yes
optimizations             yes
static                    yes
shared                    no
postprocessing support    no
new filter support        no
network support           no
threading support         pthreads
safe bitstream reader     yes
SDL support               no
opencl enabled            no
libzvbi enabled           no
texi2html enabled         no
perl enabled              yes
pod2man enabled           yes
makeinfo enabled          noExternal libraries:Enabled decoders:Enabled encoders:
h263                    mpeg4Enabled hwaccels:Enabled parsers:Enabled demuxers:Enabled muxers:
avi                     mov                     mp4Enabled protocols:
fileEnabled filters:Enabled bsfs:Enabled indevs:Enabled outdevs:License: LGPL version 2.1 or later
Creating config.mak, config.h, and doc/config.texi...

可以看到,基本所有东西都是关的,就encoders只支持h263,mpeg4, muxers只支持mp4,avi,mov, protocol只支持file

最终库的大小总共在1M左右,libavcodec.a(618KB), libavformat.a(245KB),libavutil.a(233KB)

ffmpeg编译裁剪移植到arm-linux相关推荐

  1. FFMPEG编译裁剪移植

    FFMPEG 编译裁剪移植 author:lyn date:2022.09.26 version: ffmpeg4.1.3 1.ffmpeg文件结构说明 2.ffmpeg交叉编译 3.ffmpeg移植 ...

  2. linux 混音处理 arm,alsa移植到arm linux嵌入式系统中

    1  alsa-lib的移植 1.1  软件包下载 alsa-lib库:进入网站http://www.alsa-project.org/选择下载,在这里下载的是alsa-lib-1.0.22.tar. ...

  3. 【openwrt】如何编译和运行一个arm linux 内核

    如何编译和运行一个arm linux 内核 1. 准备工具 linux4.0 内核 busybox工具包 2. busybox手工编译一个最小的文件系统 cd busybox export ARCH= ...

  4. openssl-1.0.0b - libssl 移植到ARM Linux

    开发环境: ubuntu 10.04 arm-linux-gcc version 4.4.1 目标环境 友善之臂mini6410 linux-2.6.36 移植步骤 1.至官网下载最新的openssl ...

  5. Linux下ffmpeg开源库移植到ARM开发板。

    Linux下移植ffmpeg开源库. Make install 成功后,用户安装目录下出现bin,include,lib,share目录. 进入bin目录执行file ffmpeg 查看编译出的执行程 ...

  6. mini2440 linux内核编译与移植 课程设计,linux内核移植步骤-mini2440

    建立使用 Fedora 9,版本太高,由于链接库的区别可能造成不可预料的错误.或者说配置相对复杂多了.本教程仅提供给刚接触内核的朋友,大牛们当路过就是,有发现什么错误还望指教. ① 修改顶层的Make ...

  7. sqlite3移植到arm linux

    1,环境: 软件:linux:2.6.38 硬件:6410 交叉编译工具:arm-linux-gcc 也适用于其他linux平台. 2,步骤: 1>下载sqlite3源码包: http://ww ...

  8. 【Android FFMPEG 开发】音视频基础 和 FFMPEG 编译 ( 音视频基础 | MPEG-4 标准 | Android 开发环境 | FFMPEG 交叉编译 | 安卓项目导入配置 )

    本篇博客代码及资源下载 : https://download.csdn.net/download/han1202012/10382762 文章目录 一. 音视频基础 1. 音频基础 (1) 声音要素 ...

  9. ffmpeg arm linux编译,arm linux 移植 ffmpeg 库 + x264 + x265

    背景 Ffmpeg 中带有h264的解码,没有编码,需要添加x264.libx264是一个自由的H.264编码库,是x264项目的一部分,使用广泛,ffmpeg的H.264实现就是用的libx264. ...

最新文章

  1. table布局注意点
  2. 将query存进数组 php,thinkphp下通过QueryList获取网站指定数据并封装成数组,存入数据库...
  3. 在doc中生成柱状图_Python从CSV文件导入数据和生成简单图表
  4. pythoncharm快捷键_Pycharm最常用的快捷键及使用技巧
  5. WSDM 2021 | 基于双向推理的多跳知识库问答技术
  6. boost::contract模块实现customer and manager的测试程序
  7. AutoMapper 使用实践
  8. spring事务的传播属性
  9. Android 应用开发(31)---界面原型设计
  10. 今日恐慌与贪婪指数为70 贪婪程度有所缓解
  11. 关于引用lightbox源码
  12. Android对system_server中binder的ioctl调用拦截
  13. ArcGIS学习总结(四)——缓冲区分析应用
  14. MAC上安装JDK后的所在目录
  15. numpy常用矩阵运算
  16. 增值税发票综合服务平台常见问题解决方法(珍藏版)
  17. Node.js连接数据库
  18. 袋鼠云数据中台专栏2.0 | 数据中台之数据源
  19. 蓝牙mesh- Features和设备类型
  20. TaintDroid剖析之DVM变量级污点跟踪(下篇)

热门文章

  1. oracle客户端没有tnsnames,安装好Oracle Client以后没有tnsnames.ora文件
  2. 那些中国互联网界的“千年老二”们
  3. 商品售后服务体系认证和管理体系对比
  4. wegame启动cf蓝屏_CF闪退跟蓝屏的部分原因解疑
  5. Flash全屏播放外部多个Flv视频并且按键进行切换+全屏播放外部Flv视频+指定元件播放外部Flv视频(非全屏)(可以作为遮罩来播放)
  6. Python中Tkinter知识点总结
  7. flinto导出html,Sketch绝佳搭配!30秒制作交互原型的次时代神器Flinto
  8. QCY T8无线蓝牙耳机连接电脑时无限断连解决办法
  9. python数据分析告诉你ofo多久退押金
  10. npoi word生成HTML,使用NPOI按照word模板文件生成新的word文件