Last active
January 9, 2017 22:45
-
-
Save rasa/47eee2e32e3446b13a7e22e6e4538800 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
set -v | |
apt-get update | |
apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev | |
test -d $HOME/bin || mkdir -p $HOME/bin | |
test -d $HOME/ffmpeg_build || mkdir -p $HOME/ffmpeg_build | |
test -d ~/src/ffmpeg || mkdir -p ~/src/ffmpeg | |
pushd ~/src/ffmpeg | |
rm *.fail || true | |
apt-get -y install yasm || touch yasm.fail && true | |
if [[ -f yasm.fail ]]; then | |
git clone https://github.com/yasm/yasm.git | |
pushd yasm | |
git checkout v1.3.0 | |
# wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz | |
# tar xzvf yasm-1.3.0.tar.gz | |
# cd yasm-1.3.0 | |
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" | |
make | |
make install | |
make distclean | |
popd | |
fi | |
apt-get -y install libx264-dev || touch libx264-dev.fail && true | |
if [[ -f libx264-dev.fail ]]; then | |
git clone http://git.videolan.org/git/x264.git | |
pushd x264 | |
git checkout stable | |
#wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 | |
#tar xjvf last_x264.tar.bz2 | |
# pushd x264-snapshot* | |
PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static --disable-opencl | |
PATH="$HOME/bin:$PATH" make | |
make install | |
make distclean | |
popd | |
fi | |
apt-get -y install cmake mercurial | |
hg clone https://bitbucket.org/multicoreware/x265 | |
pushd x265/build/linux | |
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source | |
make | |
make install | |
make clean | |
make clean-generated | |
# fails: | |
#make distclean || true | |
popd | |
apt-get -y install libfdk-aac-dev || touch libfdk-aac-dev.fail && true | |
if [[ -f libfdk-aac-dev.fail ]]; then | |
git clone https://github.com/mstorsjo/fdk-aac.git | |
pushd fdk-aac | |
git checkout v0.1.4 | |
#wget -O fdk-aac.tar.gz https://github.com/mstorsjo/fdk-aac/tarball/master | |
#tar xzvf fdk-aac.tar.gz | |
#cd mstorsjo-fdk-aac* | |
autoreconf -fiv | |
./configure --prefix="$HOME/ffmpeg_build" --disable-shared | |
make | |
make install | |
make distclean | |
popd | |
fi | |
apt-get -y install libmp3lame-dev || touch libmp3lame-dev.fail && true | |
if [[ -f libmp3lame-dev.fail ]]; then | |
apt-get install nasm | |
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz | |
tar xzvf lame-3.99.5.tar.gz | |
pushd lame-3.99.5 | |
./configure --prefix="$HOME/ffmpeg_build" --enable-nasm --disable-shared | |
make | |
make install | |
make distclean | |
popd | |
fi | |
apt-get -y install libopus-dev || touch libopus-dev.fail && true | |
if [[ -f libopus-dev.fail ]]; then | |
git clone https://github.com/xiph/opus.git | |
pushd opus | |
git checkout v1.1.3 | |
#wget http://downloads.xiph.org/releases/opus/opus-1.1.3.tar.gz | |
#tar xzvf opus-1.1.3.tar.gz | |
#cd opus-1.1.3 | |
./configure --prefix="$HOME/ffmpeg_build" --disable-shared | |
make | |
make install | |
make clean | |
popd | |
fi | |
git clone https://github.com/webmproject/libvpx.git | |
pushd libvpx | |
git checkout v1.6.0 | |
#wget http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.6.0.tar.bz2 | |
#tar xjvf libvpx-1.6.0.tar.bz2 | |
#cd libvpx-1.6.0 | |
PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests | |
PATH="$HOME/bin:$PATH" make | |
make install | |
make clean | |
popd | |
git clone https://git.ffmpeg.org/ffmpeg.git | |
pushd ffmpeg | |
#wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 | |
#tar xjvf ffmpeg-snapshot.tar.bz2 | |
#cd ffmpeg | |
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \ | |
--prefix="$HOME/ffmpeg_build" \ | |
--pkg-config-flags="--static" \ | |
--extra-cflags="-I$HOME/ffmpeg_build/include" \ | |
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \ | |
--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-libx265 \ | |
--enable-nonfree | |
PATH="$HOME/bin:$PATH" make | |
make install | |
make distclean | |
popd | |
ls -l *.fail || true | |
hash -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment