-
-
Save swordsreversed/e5b300f20603159e04560274167e7357 to your computer and use it in GitHub Desktop.
Simple Bash Script to Install FFMPEG + Required Libraries in Ubuntu 14.04
This file contains 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
#!/bin/bash | |
# Bash Script to Install FFMPEG in Ubuntu 14.04 | |
# Ref: http://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu | |
# Optional: install exiftool: apt-get install libimage-exiftool-perl | |
# | |
# Author: Edi Septriyanto http://masedi.net <hi@masedi.net> | |
# Edited by D.Black | |
######################################################################## | |
CURDIR=$(pwd) | |
echo "Install Pre-requisites libraries..." | |
sleep 3 | |
sudo apt-get update | |
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \ | |
libtool libva-dev openssl libssl-dev \ | |
libxext-dev libxfixes-dev libimage-exiftool-perl pkg-config texi2html zlib1g-dev git | |
mkdir $CURDIR/ffmpeg_sources | |
mkdir $CURDIR/ffmpeg_build | |
## Yasm | |
clear | |
echo "Install Yasm library..." | |
sleep 3 | |
cd $CURDIR/ffmpeg_sources | |
if [ ! -d yasm ]; then | |
#git clone https://github.com/yasm/yasm.git yasm | |
sudo apt-get install -y yasm | |
fi | |
#cd yasm | |
#autoreconf -fiv | |
#./configure --prefix="$CURDIR/ffmpeg_build" --bindir="/usr/local/bin" | |
#make | |
#make install | |
#ldconfig | |
#make distclean | |
export "PATH=$PATH:/usr/local/bin" | |
## libfdk-aac - AAC audio encoder | |
clear | |
echo "Install libfdk-aac - AAC audio encoder library..." | |
sleep 3 | |
cd $CURDIR/ffmpeg_sources | |
#wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master | |
if [ ! -d fdk-aac ]; then | |
git clone https://github.com/mstorsjo/fdk-aac.git fdk-aac | |
fi | |
cd fdk-aac | |
autoreconf -fiv | |
./configure --prefix="$CURDIR/ffmpeg_build" --disable-shared | |
make | |
sudo make install | |
sudo ldconfig | |
sudo make distclean | |
## libmp3lame - MP3 audio encoder | |
clear | |
echo "Install libmp3lame - MP3 audio encoder library..." | |
sleep 3 | |
sudo apt-get install -y libmp3lame-dev | |
#sudo apt-get install nasm | |
#cd $CURDIR/ffmpeg_sources | |
#if [ ! -d lame-3.995.5 ]; then | |
# wget http://sourceforge.net/projects/lame/files/latest/download -O libmp3lame.tar.gz | |
# tar zxf libmp3lame.tar.gz | |
#fi | |
#cd lame-3.995.5 | |
#./configure --prefix="$CURDIR/ffmpeg_build" --enable-nasm --disable-shared | |
#make | |
#make install | |
#make distclean | |
## ffmpeg | |
clear | |
echo "Install FFmpeg..." | |
sleep 3 | |
cd $CURDIR/ffmpeg_sources | |
if [ ! -d ffmpeg ]; then | |
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg | |
fi | |
cd ffmpeg | |
PKG_CONFIG_PATH="$CURDIR/ffmpeg_build/lib/pkgconfig" | |
export PKG_CONFIG_PATH | |
./configure --enable-gpl --enable-libmp3lame --enable-nonfree --enable-libfdk-aac --enable-openssl | |
make | |
sudo make install | |
sudo make distclean | |
sudo hash -r | |
## Updating ffmpeg | |
#rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffserver,vsyasm,x264,yasm,ytasm} | |
## Reverting Changes Made by This Guide | |
#rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffserver,vsyasm,x264,yasm,ytasm} | |
#sudo apt-get autoremove autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \ | |
# libmp3lame-dev libopus-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev \ | |
# libvorbis-dev libvpx-dev libx11-dev libxext-dev libxfixes-dev texi2html zlib1g-dev | |
#sed -i '/ffmpeg_build/c\' ~/.manpath | |
#hash -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment