Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile FFMpeg without most codecs

Tags:

ffmpeg

audio

I'm looking to compile ffmpeg so that it supports only a handful of codecs. Specifically, only PCM codecs and MP3.

Any pointers on how to do that? Can it be done with compilation flags, or do I need to edit the code?

like image 631
Shahar Mosek Avatar asked Jul 20 '14 09:07

Shahar Mosek


1 Answers

You can use configure with --disable-everything and then enable only what you need, then build this configuration. More on this: Building FFmpeg. This way you don't need to touch source code (manual edits).

Specifically what is affected and other switches (excerpt from configure script):

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
like image 93
Roman R. Avatar answered Sep 18 '22 11:09

Roman R.