天天看點

LINUX FFMPEG編譯詳細過程記錄(最全)

  • 前言

 凡是用到視訊音頻的地方,都用到ffmpeg。根據用到的CODEC不同,編譯有很大差異。吾有兩個初等、中午編譯的博文,這個是全編譯博文。

 全編譯有什麼好處?把庫打包之後,可以直接在别的機器上使用。

 備份建議:編譯後把整個編譯目錄打包備份;使用虛拟機編譯,然後備份。

  • 準備工作
apt update
apt install gcc make cmake
apt install autoconf subversion git wget g++ pkg-config 
# libtool libtool libogg-devel nasm
apt install autopoint      
  • 下載下傳編譯libtool
https://blog.csdn.net/quantum7/article/details/104086313
  • 下載下傳編譯OpenAL
https://blog.csdn.net/quantum7/article/details/104136755
  • 下載下傳編譯openh264
https://blog.csdn.net/quantum7/article/details/104087760
  • 下載下傳編譯x264
https://blog.csdn.net/quantum7/article/details/104087603
  • 下載下傳編譯x265
https://blog.csdn.net/quantum7/article/details/104040399
  • 下載下傳編譯iLBC
https://blog.csdn.net/quantum7/article/details/104087424
  • 下載下傳編譯g729
https://blog.csdn.net/quantum7/article/details/104087356
  • 下載下傳編譯libgsm
https://blog.csdn.net/quantum7/article/details/104087285
  • 下載下傳編譯opencore-amr
https://blog.csdn.net/quantum7/article/details/104087232
  • 下載下傳編譯vo-amrwbenc
https://blog.csdn.net/quantum7/article/details/104087266
  • 下載下傳編譯libopus
https://blog.csdn.net/quantum7/article/details/104087104
  • 下載下傳編譯libyuv
https://blog.csdn.net/quantum7/article/details/104086985
  • 下載下傳編譯libvpx
https://blog.csdn.net/quantum7/article/details/104086885
  • 載編譯Which
https://blog.csdn.net/quantum7/article/details/104086868
  • 下載下傳編譯YASM
https://blog.csdn.net/quantum7/article/details/104086713
  • (字型相關)下載下傳編譯libfreetype
https://blog.csdn.net/quantum7/article/details/102716352
  • (字型相關)下載下傳編譯FriBidi
https://blog.csdn.net/quantum7/article/details/104136580
  • (字型相關)下載下傳編譯libxml2
https://blog.csdn.net/quantum7/article/details/104484634
  • (字型相關)下載下傳編譯gperf
https://blog.csdn.net/quantum7/article/details/104485237
  • (字型相關)下載下傳編譯fontconfig
https://blog.csdn.net/quantum7/article/details/104484257
  • (字型相關)下載下傳libass
https://blog.csdn.net/quantum7/article/details/104136630
  • 下載下傳編譯faac
https://blog.csdn.net/quantum7/article/details/104136411
  • 下載下傳編譯zlib
https://blog.csdn.net/quantum7/article/details/104486417
  • 下載下傳編譯libpng
https://blog.csdn.net/quantum7/article/details/104173294
  • 下載下傳編譯jpeglib
https://blog.csdn.net/quantum7/article/details/82459960
  • 下載下傳編譯SDL2
https://blog.csdn.net/quantum7/article/details/104173159
  • 下載下傳編譯vorbis
https://blog.csdn.net/quantum7/article/details/104135601
  • 下載下傳編譯libogg
https://blog.csdn.net/quantum7/article/details/104086366
  • 下載下傳編譯theora
https://blog.csdn.net/quantum7/article/details/104135650
  • 下載下傳編譯libspeex/libspeexdsp
https://blog.csdn.net/quantum7/article/details/104086849
  • 下載下傳編譯nasm
https://blog.csdn.net/quantum7/article/details/104086464
  • 下載下傳編譯lame
https://blog.csdn.net/quantum7/article/details/104178587
  • 下載下傳編譯ffmpeg
http://ffmpeg.org/download.html
BUILD_LIBS=${HOME}/build_libs
./configure \
    --prefix=${BUILD_LIBS}  \
    --extra-cflags="-fPIC" \
    --extra-cflags="-I${BUILD_LIBS}/include" \
    --extra-ldflags="-L${BUILD_LIBS}/lib" \
    --bindir="${BUILD_LIBS}/bin" \
    --enable-pic --enable-pthreads \
    --enable-shared --disable-static \
    --disable-network --enable-pthreads \
    --disable-ffmpeg --disable-ffplay --disable-ffprobe \
    --enable-gpl --enable-nonfree \
    --enable-libx264 --enable-encoder=libx264 --enable-decoder=h264 \
    --disable-debug
 
# ./configure --pkg-config-flags="--static" --bindir="$HOME/bin" --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
 
# --enable-memalign-hack
# --disable-ffserver
 
make
 
make install
 
 
cp libavfilter/motion_estimation.h ${BUILD_LIBS}/include/libavfilter      

繼續閱讀