1. Uninstall x264, libx264-dev, and ffmpeg if they are already installed. Open a terminal and run the following
$ sudo apt-get remove ffmpeg x264 libx264-dev
2. Get all of the packages you will need to install FFmpeg and x264
$ sudo apt-get update
$ sudo apt-get install build-essential git-core checkinstall yasm texi2html \
libfaac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev \
libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libva-dev libvdpau-dev \
libvorbis-dev libvpx-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
Install x264
3. Get the current source files, compile, and install x264.
cd
git clone git://git.videolan.org/x264
cd x264
./configure
make
[optional]
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
--fstrans=no --default
make install [To install]
Install FFmpeg4. Get the most current source files, compile, and install FFmpeg.
cd
git clone git://git.videolan.org/ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
--enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
--enable-libopencore-amrwb --enable-libtheora --enable-libvorbis \
--enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
make
make install
sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(./version.sh)" --backup=no \
--deldoc=yes --fstrans=no --default
hash x264 ffmpeg ffplay ffprobe
5. To check ffmpeg
$ ffmpeg and press enter