FFmpeg編譯記錄

2021-06-18 10:34:43 字數 3748 閱讀 3938

參照官方wiki編譯,鏈結為:

一、copy and paste the whole code box for each step.

sudo apt-get update

sudo apt-get -y install autoconf automake build-essential git libass-dev libgpac-dev \

libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libx11-dev \

libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev

mkdir ~/ffmpeg_sources

二、compilation&installation

2.1yasm

yasm is an assembler used by x264 and ffmpeg.

cd ~/ffmpeg_sources

wget

tar xzvf yasm-1.2.0.tar.gz

cd yasm-1.2.0

./configure --prefix="$home/ffmpeg_build" --bindir="$home/bin"

make

make install

make distclean

. ~/.profile

2.2 x264

h.264 video encoder. see the x264 encoding guide for more information and examples.

cd ~/ffmpeg_sources

git clone --depth 1 git:

cd x264

./configure --prefix="$home/ffmpeg_build" --bindir="$home/bin" --enable-static

make

make install

make distclean

ps:make時遇到錯誤

if you really want to compile without asm, configure with --disable-asm.

解決方法

回到yasm-1.2.0目錄下

./configure --prefix=/usr --enable-shared 

重新編譯

2.3 fdk-aac

aac audio encoder. see the aac encoding guide for more information and examples.

cd ~/ffmpeg_sources

git clone --depth 1 git:

cd fdk-aac

autoreconf -fiv

./configure --prefix="$home/ffmpeg_build" --disable-shared

make

make install

make distclean

2.4 lib***lame

*** audio encoder.

sudo apt-get install lib***lame-dev
sudo apt-get install nasm

cd ~/ffmpeg_sources

wget

tar xzvf lame-3.99.5.tar.gz

cd lame-3.99.5

./configure --prefix="$home/ffmpeg_build" --enable-nasm --disable-shared

make

make install

make distclean

2.5 libopus

opus audio decoder and encoder.

cd ~/ffmpeg_sources

wget

tar xzvf opus-1.0.3.tar.gz

cd opus-1.0.3

./configure --prefix="$home/ffmpeg_build" --disable-shared

make

make install

make distclean

2.6 libvpx

vp8/vp9 video encoder and decoder. see the vpx (webm) encoding guide for more information and examples.

cd ~/ffmpeg_sources

git clone --depth 1

cd libvpx

./configure --prefix="$home/ffmpeg_build" --disable-examples

make

make install

make clean

2.7 ffmpeg

cd ~/ffmpeg_sources

git clone --depth 1 git:

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-libass --enable-libfdk-aac \

--enable-lib***lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx \

--enable-libx264 --enable-nonfree --enable-x11grab

make

make install

make distclean

hash -r

完成後可執行檔案位於~/bin目錄下

官方wiki建議使用gcc4.2 ,已嘗試使用gcc-4.2.3在編譯libvpx時出錯,故放棄

現已測試編譯環境為:

ubuntu11.04 bit64 、gcc4.5.2

ubuntu12.04 bit32、gcc-4.6

ubuntu12.04 bit64、gcc-4.6(待測試)

FFMPEG交叉編譯記錄

記錄一下自己踩過的坑,linux小白 1 ndk版本17之後使用clang編譯器,不使用gcc 2 初裝linux可能未安裝clang編譯器,需要先檢查下 終端輸入clang,若提示 not input file 則已安裝 sudo yum install epel release sudo yum...

ffmpeg 編譯問題記錄

解壓.configure enable nonfree enable shared disable static enable gpl enable libx264 enable ffmpeg disable asm disable optimizations disable stripping p...

ffmpeg編譯流程

ffmpeg 庫編譯過程 1.從官網獲取ffmpeg ffmpeg website 3.在ffmpeg目錄中進行編譯 mkdir libffmpeg dir configure prefix libffmpeg dir enable shared disable static enable gpl ...