UP | HOME
Sachin Patil

Sachin

Free Software developer & Emacser

ffmpeg with libmp3lame & H.264 encoder support

Published on Apr 02, 2017 by Sachin.

How to manually install ffmpeg with libmp3lame & H.264 encoder support.

Clone ffmpeg

git clone https://git.ffmpeg.org/ffmpeg.git

Note: You need to install nasm to compile lame & libx264. On Fedora install using

dnf install nasm -y

Lame encoder

1: BUILD_DIR="$HOME/ffmpeg/ffmpeg_build"
2: cd ffmpeg/
3: curl -O -L https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
4: tar xzvf lame-3.100.tar.gz
5: cd lame-3.100
6: ./configure --prefix="$BUILD_DIR" --bindir="$HOME/bin" --disable-shared --enable-nasm
7: make
8: make install
9: cd ..

H.264 Encoder

1: git clone --depth 1 http://git.videolan.org/git/x264
2: cd x264
3: PKG_CONFIG_PATH="$BUILD_DIR/lib/pkgconfig" ./configure --prefix="$BUILD_DIR" --bindir="$HOME/bin" --enable-static
4: make
5: make install
6: cd ..

Compile and Install ffmpeg

 1: PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$BUILD_DIR/lib/pkgconfig" ./configure \
 2:     --prefix="$BUILD_DIR" \
 3:     --pkg-config-flags="--static" \
 4:     --extra-cflags="-I$BUILD_DIR/include" \
 5:     --extra-ldflags="-L$BUILD_DIR/lib" \
 6:     --extra-libs=-lpthread \
 7:     --extra-libs=-lm \
 8:     --bindir="$HOME/bin" \
 9:     --enable-gpl \
10:     --enable-libmp3lame \
11:     --enable-libx264 \
12:     --enable-nonfree
13: 
14: make
15: make install