I compiled ffmpeg libs on my 64-bit Ubuntu using the following script:
mkdir ~/ffmpeg_sources
# x264
cd ~/ffmpeg_sources wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 tar xjvf last_x264.tar.bz2 cd x264-snapshot* ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static --disable-asm make make install make distclean
#FFmpeg
cd ~/ffmpeg_sources wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 tar xjvf ffmpeg-snapshot.tar.bz2 cd ffmpeg PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" export PKG_CONFIG_PATH ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" \ --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs="-ldl" -- enable-gpl \ --enable-libx264 --enable-x11grab --disable-yasm make make install make distclean hash -r
But the latest libraries are really big (for example, libavcodec.a> 140 MB). Does anyone know why my libraries are so large?
EDIT
My solutions:
- add the --disable-debug option to. / configure. The size of my libavcodec dropped from 150Mb to 12Mb!
- Remove any unnecessary codecs: add the options -disable-encoders, --disable-decoders, and then add only the codecs you want using --enable-encoder = NAME and --enable-decoder = NAME. Print the list using. / configure --list-encoders --list-decoders. see .. / configure --help for more information. (My last libavcodec is 4Mo in size)
source share