Skip to content

Instantly share code, notes, and snippets.

@EitanGoldfrad
Forked from patmandenver/ffmpeg-install.sh
Last active October 3, 2018 10:49
Show Gist options
  • Save EitanGoldfrad/5e032e2db4f0d1c54fe5ac967f223a82 to your computer and use it in GitHub Desktop.
Save EitanGoldfrad/5e032e2db4f0d1c54fe5ac967f223a82 to your computer and use it in GitHub Desktop.
ffmpeg install script for Ubuntu 14.04
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run with admin privileges 'sudo'"
echo "exiting...."
exit 1
fi
echo "*********************************"
echo "*"
echo "* Installing ffmpeg on Ubuntu 14.04"
echo "*"
echo "*********************************"
echo "*********************************"
echo "*"
echo "* 1/13 Update apt-get"
echo "*"
echo "*********************************"
apt-get -y upgrade
apt-get -y update
echo "*********************************"
echo "*"
echo "* 2/13 install needed build tools"
echo "*"
echo "*********************************"
apt-get -y --force-yes install \
autoconf \
automake \
build-essential \
libass-dev \
libfreetype6-dev \
libsdl1.2-dev \
libtheora-dev \
libtool libva-dev \
libvdpau-dev \
libvorbis-dev \
libxcb1-dev \
gnutls-bin \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
pkg-config \
texi2html \
zlib1g-dev \
cmake \
mercurial
echo "*********************************"
echo "*"
echo "* 3/13 Set PATH/PKG_CONFIG_PATH"
echo "*"
echo "*********************************"
export PATH="$HOME/bin:$PATH"
export PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig"
echo "*********************************"
echo "*"
echo "* 4/13 Create location to do work in"
echo "*"
echo "*********************************"
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
echo "*********************************"
echo "*"
echo "* 5/13 Install yasm via apt-get"
echo "*"
echo "*********************************"
apt-get -y install yasm
echo "*********************************"
echo "*"
echo "* 6/13 Install libx264 via apt-get"
echo "*"
echo "*********************************"
apt-get -y install libx264-dev
echo "*********************************"
echo "*"
echo "* 7/13 Install libx265 via build tools"
echo "*"
echo "*********************************"
apt-get -y install libx265-dev x265
echo "*********************************"
echo "*"
echo "* 8/13 Install libgnutls-dev via build tools"
echo "*"
echo "*********************************"
apt-get -y install libgnutls-dev
echo "*********************************"
echo "*"
echo "* 8/13 Install libfdk-acc via build tools"
echo "*"
echo "*********************************"
apt-get -y install libfdk-aac-dev
echo "*********************************"
echo "*"
echo "* 9/13 Install libmp3lame via apt-get"
echo "*"
echo "*********************************"
apt-get -y install libmp3lame-dev
echo "*********************************"
echo "*"
echo "* 10/13 Install libopus via apt-get"
echo "*"
echo "*********************************"
apt-get -y install libopus-dev
echo "*********************************"
echo "*"
echo "* 11/13 Install libvpx build from source"
echo "*"
echo "*********************************"
apt-get -y install libvpx-dev
echo "*********************************"
echo "*"
echo "* 12/13 Install ffmpeg build from source"
echo "*"
echo "*********************************"
cd ~/ffmpeg_sources
wget \
http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
./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-gnutls \
--enable-nonfree
make
make install
make distclean
hash -r
echo "*********************************"
echo "*"
echo "* 13/13 Moving ffmpeg tool from ~/bin to /bin"
echo "*"
echo "*********************************"
mv ~/bin/ff* /bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment