[FFmpeg-user] Compiling ffmpeg, Optimize for size

Stefano Sabatini stefasab at gmail.com
Thu Jun 18 10:46:12 CEST 2015


On date Wednesday 2015-06-17 17:10:56 +0100, Conor Mac Aoidh wrote:
> Hi All,
> 
> I've built ffmpeg for ARM but I would like to also optimize the
> binary for size ('-Os' flag).
> 
> When I add this flag to my configure script:
> /
> //--extra-cflags="-Os -Wno-deprecated-declarations -I../x264
> -mfloat-abi=softfp -mfpu=neon -fPIE -DANDROID -pie"/
> 
> The configure works, but spits out this segment, telling me that
> optimize for size is disabled:
> 
> /ARCH                      arm (cortex-a8)//
> //big-endian                no//
> //runtime cpu detection     yes//
> //ARMv5TE enabled           yes//
> //ARMv6 enabled             yes//
> //ARMv6T2 enabled           yes//
> //ARM VFP enabled           yes//
> //NEON enabled              yes//
> //debug symbols             yes//
> //strip symbols             yes//
> //optimize for size         no//
> /
> I'm not sure whether this is referring to the same optimize for size
> feature as the compiler flag. Either way, how can I enable this?

Use configure --enable-small, and remove all the components
(libraries, muxers, codecs, protocols, filters, etc) which you don't
need. Read the output of configure --help and check for the various
--disable-* options.

For example, to disable all the codecs but one, you do:
configure --disable-encoders --enable-encoder=NAME

Hope that helps.


More information about the ffmpeg-user mailing list