Skip to content

Instantly share code, notes, and snippets.

@hyer
Last active October 9, 2021 17:26
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hyer/5a63543966dd2642989a to your computer and use it in GitHub Desktop.
Save hyer/5a63543966dd2642989a to your computer and use it in GitHub Desktop.
installing ffmpeg from source code.
# You should download the ffmpeg source code from the http://ffmpeg.org/
# libx264 need yasm, so we install yasm first
sudo apt-get install yasm
sudo apt-get install libx264-dev
# then, install the required packages
sudo apt-get install libfaac-dev
sudo apt-get install libmp3lame-dev
sudo apt-get install libtheora-dev
sudo apt-get install libvorbis-dev
sudo apt-get install libxvidcore-dev
sudo apt-get install libxext-dev
sudo apt-get install libxfixes-dev
# unzip the ffmpeg source code and install
tar -xjvf ffmpeg-2.8.2.tar.bz2
cd ffmpeg-2.8.2
./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvorbis
sudo make
sudo make install
# configure the PATH param
echo "# Add FFMpeg bin & library paths:" >> ~/.bashrc
echo "export PATH=/usr/local/ffmpeg/bin:$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/ffmpeg/lib:$LD_LIBRARY_PATH" >> ~/.bashrc
source ~/.bashrc
## You can also install from a PPA
# sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
# sudo apt-get update
# sudo apt-get install ffmpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment