1.preparation install dependencies 1 yum install -y gcc g++ cmake gcc-c++
2.install and compile x264 if you haven’t installed the bzip2, you can run the code “sudo yum install bzip2 “ to install it before decompression.
1 2 3 4 5 6 7 8 9 10 11 wget https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2 tar -jxvf x264-master.tar.bz2 cd ./x264-mastermake clean && make uninstall PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure --enable-shared make -j4 && make install
3.install and compile x265 1 2 3 4 5 6 7 8 9 wget https://anduin.linuxfromscratch.org/BLFS/x265/x265_3.4.tar.gz tar -zxvf x265_3.4.tar.gz cd x265_3.4/sourcecmake -DCMAKE_INSTALL_PREFIX=/usr/local/x265 make install
4.download source code of ffmpeg, and install it 1 2 3 4 5 6 7 8 9 wget https://ffmpeg.org/releases/ffmpeg-4.2.3.tar.bz2 tar -jxvf ffmpeg-4.2.3.tar.bz2 cd ffmpeg-4.2.3./configure --prefix=/usr/local/ffmpeg --enable-shared --disable-w32threads --enable-pthreads --enable-gpl --enable-libx264 --enable-libx265 --enable-nonfree make && make install
1 2 3 4 5 6 export PKG_CONFIG_PATH=/usr/local/x265/lib/pkgconfigor add it in /etc/profile: export PKG_CONFIG_PATH=/usr/local/x264/lib/pkgconfig/export PKG_CONFIG_PATH=/usr/local/x265/lib/pkgconfig:$PKG_CONFIG_PATH
6.edit /etc/ld.so.config 1 2 3 4 5 6 include ld.so.conf.d/*.conf #add the following content /usr/local/ffmpeg/lib/ #ffmpeg installation path /usr/local/lib #other installation path,if you didn't select path, when installing x264. this is default path. /usr/local/x265/lib/ #Installation path for x265