Skip to content

Instantly share code, notes, and snippets.

@vkhatri
Created April 6, 2015 09:16
Show Gist options
  • Save vkhatri/d6d7cd0176c5d83a6149 to your computer and use it in GitHub Desktop.
Save vkhatri/d6d7cd0176c5d83a6149 to your computer and use it in GitHub Desktop.
FFmpeg x264 multimedia toolkit setup
# Install Packages
yum install kernel-headers kernel-devel # reboot instance if possible
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel patch telnet mdadm nfs-utils openssl-devel git libxml2 libxml2-devel libxslt libxslt-devel wget libtool pkgconfig nasm
# Set ENV Variables
export PATH=$PATH:/usr/local/bin
export FMP=/usr/local
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
# Download Source
cd /usr/local
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xzf yasm-1.3.0.tar.gz
git clone --depth 1 git://git.videolan.org/x264.git
git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac
curl -L -O http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz
curl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz
tar xzf libogg-1.3.2.tar.gz
curl -O http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
tar xzf opus-1.1.tar.gz
#curl -O http://downloads.xiph.org/releases/opus/opus-tools-0.1.9.tar.gz
#tar xzvf opus-tools-0.1.9.tar.gz
curl -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz
tar xzvf libvorbis-1.3.5.tar.gz
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
# Compile
# YASM
cd /usr/local/yasm-1.3.0
./configure --prefix="$FMP" --bindir="$FMP/bin"
make
make install
ln -s /usr/local/bin/yasm /usr/bin/yasm
# x264
cd /usr/local/x264
./configure --prefix="/usr/local" --bindir="/usr/local/bin" --enable-static
make
make install
ln -s /usr/local/bin/x264 /usr/bin/x264
make distclean
# fdk-aac
cd /usr/local/fdk-aac
autoreconf -fiv
./configure --prefix="/usr/local" --bindir="/usr/local/bin" --disable-shared
make
make install
make distclean
# lame
cd /usr/local/lame-3.99.5
./configure --prefix="/usr/local" --bindir="/usr/local/bin" --disable-shared --enable-nasm
make
make install
make distclean
# ogg
cd /usr/local/libogg-1.3.2
./configure --prefix="/usr/local" --bindir="/usr/local/bin" --disable-shared
make
make install
make distclean
# opus
cd /usr/local/opus-1.1
./configure --prefix="/usr/local" --bindir="/usr/local/bin" --disable-shared
make
make install
make distclean
# libvorbis
cd /usr/local/libvorbis-1.3.5
./configure --prefix="/usr/local" --with-ogg="/usr/local" --disable-shared
make
make install
make distclean
# libvpx
cd /usr/local/libvpx
./configure --prefix="/usr/local" --disable-examples
make
make install
make clean
# ffmpeg
cd /usr/local/ffmpeg
./configure --prefix=/usr/local --bindir=/usr/local/bin --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
make
make install
make distclean
hash -r
ln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg
ln -s /usr/local/bin/ffprobe /usr/bin/ffprobe
ln -s /usr/local/bin/ffserver /usr/bin/ffserver
# Installation complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment