How to compile FFmpeg on CentOS


Step 1:

yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel
[root@tutorialspots ~]# yum install autoconf automake bzip2 cmake freetype-devel gcc
gcc-c++ git libtool make mercurial pkgconfig zlib-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.lga7.us.voxel.net
 * epel: fr.mirror.babylon.network
 * extras: mirror.trouble-free.net
 * ius: ius.mirror.constant.com
 * updates: www.gtlib.gatech.edu
Package 1:make-3.82-23.el7.x86_64 already installed and latest version
Package 1:pkgconfig-0.27.1-4.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.69-11.el7 will be installed
--> Processing Dependency: m4 >= 1.4.14 for package: autoconf-2.69-11.el7.noarch
--> Processing Dependency: perl(Data::Dumper) for package: autoconf-2.69-11.el7.
noarch
---> Package automake.noarch 0:1.13.4-3.el7 will be installed
--> Processing Dependency: perl(Thread::Queue) for package: automake-1.13.4-3.el
7.noarch
--> Processing Dependency: perl(TAP::Parser) for package: automake-1.13.4-3.el7.
noarch
---> Package bzip2.x86_64 0:1.0.6-13.el7 will be installed
---> Package cmake.x86_64 0:2.8.12.2-2.el7 will be installed
--> Processing Dependency: libarchive.so.13()(64bit) for package: cmake-2.8.12.2
-2.el7.x86_64
---> Package freetype-devel.x86_64 0:2.4.11-15.el7 will be installed
---> Package gcc.x86_64 0:4.8.5-16.el7_4.1 will be installed
--> Processing Dependency: libgomp = 4.8.5-16.el7_4.1 for package: gcc-4.8.5-16.
el7_4.1.x86_64
--> Processing Dependency: cpp = 4.8.5-16.el7_4.1 for package: gcc-4.8.5-16.el7_
4.1.x86_64
--> Processing Dependency: libgcc >= 4.8.5-16.el7_4.1 for package: gcc-4.8.5-16.
el7_4.1.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-16.el
7_4.1.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-16.el7_4
.1.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-16.el7_4.
1.x86_64
---> Package gcc-c++.x86_64 0:4.8.5-16.el7_4.1 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.5-16.el7_4.1 for package: gcc-c
++-4.8.5-16.el7_4.1.x86_64
--> Processing Dependency: libstdc++ = 4.8.5-16.el7_4.1 for package: gcc-c++-4.8
.5-16.el7_4.1.x86_64
---> Package git.x86_64 0:1.8.3.1-12.el7_4 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-12.el7_4 for package: git-1.8.3.1-
12.el7_4.x86_64
--> Processing Dependency: rsync for package: git-1.8.3.1-12.el7_4.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-12.el7_4
.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-12.el7_4.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-12.el7_4.x86_64
--> Processing Dependency: libgnome-keyring.so.0()(64bit) for package: git-1.8.3
.1-12.el7_4.x86_64
---> Package libtool.x86_64 0:2.4.2-22.el7_3 will be installed
---> Package mercurial.x86_64 0:2.6.2-8.el7_4 will be installed
---> Package zlib-devel.x86_64 0:1.2.7-17.el7 will be installed
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-16.el7_4.1 will be installed
---> Package glibc-devel.x86_64 0:2.17-196.el7_4.2 will be installed
--> Processing Dependency: glibc-headers = 2.17-196.el7_4.2 for package: glibc-d
evel-2.17-196.el7_4.2.x86_64
--> Processing Dependency: glibc = 2.17-196.el7_4.2 for package: glibc-devel-2.1
7-196.el7_4.2.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-196.el7_4
.2.x86_64
---> Package libarchive.x86_64 0:3.1.2-10.el7_2 will be installed
---> Package libgcc.x86_64 0:4.8.5-16.el7 will be updated
---> Package libgcc.x86_64 0:4.8.5-16.el7_4.1 will be an update
---> Package libgnome-keyring.x86_64 0:3.12.0-1.el7 will be installed
---> Package libgomp.x86_64 0:4.8.5-16.el7 will be updated
---> Package libgomp.x86_64 0:4.8.5-16.el7_4.1 will be an update
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package libstdc++.x86_64 0:4.8.5-16.el7 will be updated
---> Package libstdc++.x86_64 0:4.8.5-16.el7_4.1 will be an update
---> Package libstdc++-devel.x86_64 0:4.8.5-16.el7_4.1 will be installed
---> Package m4.x86_64 0:1.4.16-10.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-12.el7_4 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
---> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed
---> Package perl-Thread-Queue.noarch 0:3.02-2.el7 will be installed
---> Package rsync31u.x86_64 0:3.1.3-1.ius.centos7 will be installed
--> Running transaction check
---> Package glibc.x86_64 0:2.17-196.el7 will be updated
--> Processing Dependency: glibc = 2.17-196.el7 for package: glibc-common-2.17-1
96.el7.x86_64
---> Package glibc.x86_64 0:2.17-196.el7_4.2 will be an update
---> Package glibc-headers.x86_64 0:2.17-196.el7_4.2 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.
17-196.el7_4.2.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-196.el
7_4.2.x86_64
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-196.el7 will be updated
---> Package glibc-common.x86_64 0:2.17-196.el7_4.2 will be an update
---> Package kernel-headers.x86_64 0:3.10.0-693.17.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                Arch        Version                  Repository    Size
================================================================================
Installing:
 autoconf               noarch      2.69-11.el7              base         701 k
 automake               noarch      1.13.4-3.el7             base         679 k
 bzip2                  x86_64      1.0.6-13.el7             base          52 k
 cmake                  x86_64      2.8.12.2-2.el7           base         7.1 M
 freetype-devel         x86_64      2.4.11-15.el7            base         356 k
 gcc                    x86_64      4.8.5-16.el7_4.1         updates       16 M
 gcc-c++                x86_64      4.8.5-16.el7_4.1         updates      7.2 M
 git                    x86_64      1.8.3.1-12.el7_4         updates      4.4 M
 libtool                x86_64      2.4.2-22.el7_3           base         588 k
 mercurial              x86_64      2.6.2-8.el7_4            updates      2.6 M
 zlib-devel             x86_64      1.2.7-17.el7             base          50 k
Installing for dependencies:
 cpp                    x86_64      4.8.5-16.el7_4.1         updates      5.9 M
 glibc-devel            x86_64      2.17-196.el7_4.2         updates      1.1 M
 glibc-headers          x86_64      2.17-196.el7_4.2         updates      676 k
 kernel-headers         x86_64      3.10.0-693.17.1.el7      updates      6.0 M
 libarchive             x86_64      3.1.2-10.el7_2           base         318 k
 libgnome-keyring       x86_64      3.12.0-1.el7             base         109 k
 libmpc                 x86_64      1.0.1-3.el7              base          51 k
 libstdc++-devel        x86_64      4.8.5-16.el7_4.1         updates      1.5 M
 m4                     x86_64      1.4.16-10.el7            base         256 k
 mpfr                   x86_64      3.1.1-4.el7              base         203 k
 perl-Data-Dumper       x86_64      2.145-3.el7              base          47 k
 perl-Error             noarch      1:0.17020-2.el7          base          32 k
 perl-Git               noarch      1.8.3.1-12.el7_4         updates       53 k
 perl-TermReadKey       x86_64      2.30-20.el7              base          31 k
 perl-Test-Harness      noarch      3.28-3.el7               base         302 k
 perl-Thread-Queue      noarch      3.02-2.el7               base          17 k
 rsync31u               x86_64      3.1.3-1.ius.centos7      ius          389 k
Updating for dependencies:
 glibc                  x86_64      2.17-196.el7_4.2         updates      3.6 M
 glibc-common           x86_64      2.17-196.el7_4.2         updates       11 M
 libgcc                 x86_64      4.8.5-16.el7_4.1         updates       98 k
 libgomp                x86_64      4.8.5-16.el7_4.1         updates      154 k
 libstdc++              x86_64      4.8.5-16.el7_4.1         updates      301 k

Transaction Summary
================================================================================
Install  11 Packages (+17 Dependent packages)
Upgrade              (  5 Dependent packages)

Total download size: 72 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/33): autoconf-2.69-11.el7.noarch.rpm                    | 701 kB   00:00
(2/33): bzip2-1.0.6-13.el7.x86_64.rpm                      |  52 kB   00:00
(3/33): freetype-devel-2.4.11-15.el7.x86_64.rpm            | 356 kB   00:00
(4/33): automake-1.13.4-3.el7.noarch.rpm                   | 679 kB   00:00
(5/33): cpp-4.8.5-16.el7_4.1.x86_64.rpm                    | 5.9 MB   00:00
(6/33): gcc-c++-4.8.5-16.el7_4.1.x86_64.rpm                | 7.2 MB   00:00
(7/33): cmake-2.8.12.2-2.el7.x86_64.rpm                    | 7.1 MB   00:00
(8/33): glibc-2.17-196.el7_4.2.x86_64.rpm                  | 3.6 MB   00:00
(9/33): glibc-headers-2.17-196.el7_4.2.x86_64.rpm          | 676 kB   00:00
(10/33): git-1.8.3.1-12.el7_4.x86_64.rpm                   | 4.4 MB   00:00
(11/33): glibc-devel-2.17-196.el7_4.2.x86_64.rpm           | 1.1 MB   00:00
(12/33): libgcc-4.8.5-16.el7_4.1.x86_64.rpm                |  98 kB   00:00
(13/33): libarchive-3.1.2-10.el7_2.x86_64.rpm              | 318 kB   00:00
(14/33): libgomp-4.8.5-16.el7_4.1.x86_64.rpm               | 154 kB   00:00
(15/33): glibc-common-2.17-196.el7_4.2.x86_64.rpm          |  11 MB   00:00
(16/33): libmpc-1.0.1-3.el7.x86_64.rpm                     |  51 kB   00:00
(17/33): gcc-4.8.5-16.el7_4.1.x86_64.rpm                   |  16 MB   00:01
(18/33): libgnome-keyring-3.12.0-1.el7.x86_64.rpm          | 109 kB   00:00
(19/33): kernel-headers-3.10.0-693.17.1.el7.x86_64.rpm     | 6.0 MB   00:00
(20/33): libstdc++-4.8.5-16.el7_4.1.x86_64.rpm             | 301 kB   00:00
(21/33): libstdc++-devel-4.8.5-16.el7_4.1.x86_64.rpm       | 1.5 MB   00:00
(22/33): libtool-2.4.2-22.el7_3.x86_64.rpm                 | 588 kB   00:00
(23/33): m4-1.4.16-10.el7.x86_64.rpm                       | 256 kB   00:00
(24/33): mpfr-3.1.1-4.el7.x86_64.rpm                       | 203 kB   00:00
(25/33): perl-Data-Dumper-2.145-3.el7.x86_64.rpm           |  47 kB   00:00
(26/33): perl-Git-1.8.3.1-12.el7_4.noarch.rpm              |  53 kB   00:00
(27/33): mercurial-2.6.2-8.el7_4.x86_64.rpm                | 2.6 MB   00:00
(28/33): perl-Error-0.17020-2.el7.noarch.rpm               |  32 kB   00:00
(29/33): perl-TermReadKey-2.30-20.el7.x86_64.rpm           |  31 kB   00:00
(30/33): perl-Thread-Queue-3.02-2.el7.noarch.rpm           |  17 kB   00:00
(31/33): zlib-devel-1.2.7-17.el7.x86_64.rpm                |  50 kB   00:00
(32/33): perl-Test-Harness-3.28-3.el7.noarch.rpm           | 302 kB   00:00
warning: /var/cache/yum/x86_64/7/ius/packages/rsync31u-3.1.3-1.ius.centos7.x86_6
4.rpm: Header V4 DSA/SHA1 Signature, key ID 9cd4953f: NOKEY
Public key for rsync31u-3.1.3-1.ius.centos7.x86_64.rpm is not installed
(33/33): rsync31u-3.1.3-1.ius.centos7.x86_64.rpm           | 389 kB   00:00
--------------------------------------------------------------------------------
Total                                               30 MB/s |  72 MB  00:02
Retrieving key from file:///etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY
Importing GPG key 0x9CD4953F:
 Userid     : "IUS Community Project <coredev@iuscommunity.org>"
 Fingerprint: 8b84 6e3a b3fe 6462 74e8 670f da22 1cdf 9cd4 953f
 Package    : ius-release-1.0-15.ius.centos7.noarch (installed)
 From       : /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : libgcc-4.8.5-16.el7_4.1.x86_64                              1/38
  Updating   : glibc-common-2.17-196.el7_4.2.x86_64                        2/38
  Updating   : glibc-2.17-196.el7_4.2.x86_64                               3/38
  Installing : mpfr-3.1.1-4.el7.x86_64                                     4/38
  Installing : libmpc-1.0.1-3.el7.x86_64                                   5/38
  Updating   : libstdc++-4.8.5-16.el7_4.1.x86_64                           6/38
  Installing : 1:perl-Error-0.17020-2.el7.noarch                           7/38
  Installing : libstdc++-devel-4.8.5-16.el7_4.1.x86_64                     8/38
  Installing : cpp-4.8.5-16.el7_4.1.x86_64                                 9/38
  Installing : libgnome-keyring-3.12.0-1.el7.x86_64                       10/38
  Installing : perl-TermReadKey-2.30-20.el7.x86_64                        11/38
  Installing : m4-1.4.16-10.el7.x86_64                                    12/38
  Updating   : libgomp-4.8.5-16.el7_4.1.x86_64                            13/38
  Installing : perl-Data-Dumper-2.145-3.el7.x86_64                        14/38
  Installing : autoconf-2.69-11.el7.noarch                                15/38
  Installing : rsync31u-3.1.3-1.ius.centos7.x86_64                        16/38
  Installing : perl-Git-1.8.3.1-12.el7_4.noarch                           17/38
  Installing : git-1.8.3.1-12.el7_4.x86_64                                18/38
  Installing : libarchive-3.1.2-10.el7_2.x86_64                           19/38
  Installing : kernel-headers-3.10.0-693.17.1.el7.x86_64                  20/38
  Installing : glibc-headers-2.17-196.el7_4.2.x86_64                      21/38
  Installing : glibc-devel-2.17-196.el7_4.2.x86_64                        22/38
  Installing : gcc-4.8.5-16.el7_4.1.x86_64                                23/38
  Installing : perl-Thread-Queue-3.02-2.el7.noarch                        24/38
  Installing : perl-Test-Harness-3.28-3.el7.noarch                        25/38
  Installing : automake-1.13.4-3.el7.noarch                               26/38
  Installing : zlib-devel-1.2.7-17.el7.x86_64                             27/38
  Installing : freetype-devel-2.4.11-15.el7.x86_64                        28/38
  Installing : libtool-2.4.2-22.el7_3.x86_64                              29/38
  Installing : gcc-c++-4.8.5-16.el7_4.1.x86_64                            30/38
  Installing : cmake-2.8.12.2-2.el7.x86_64                                31/38
  Installing : mercurial-2.6.2-8.el7_4.x86_64                             32/38
  Installing : bzip2-1.0.6-13.el7.x86_64                                  33/38
  Cleanup    : libstdc++-4.8.5-16.el7.x86_64                              34/38
  Cleanup    : libgomp-4.8.5-16.el7.x86_64                                35/38
  Cleanup    : glibc-common-2.17-196.el7.x86_64                           36/38
  Cleanup    : glibc-2.17-196.el7.x86_64                                  37/38
  Cleanup    : libgcc-4.8.5-16.el7.x86_64                                 38/38
  Verifying  : zlib-devel-1.2.7-17.el7.x86_64                              1/38
  Verifying  : libgnome-keyring-3.12.0-1.el7.x86_64                        2/38
  Verifying  : perl-TermReadKey-2.30-20.el7.x86_64                         3/38
  Verifying  : mercurial-2.6.2-8.el7_4.x86_64                              4/38
  Verifying  : mpfr-3.1.1-4.el7.x86_64                                     5/38
  Verifying  : automake-1.13.4-3.el7.noarch                                6/38
  Verifying  : git-1.8.3.1-12.el7_4.x86_64                                 7/38
  Verifying  : m4-1.4.16-10.el7.x86_64                                     8/38
  Verifying  : glibc-devel-2.17-196.el7_4.2.x86_64                         9/38
  Verifying  : bzip2-1.0.6-13.el7.x86_64                                  10/38
  Verifying  : perl-Test-Harness-3.28-3.el7.noarch                        11/38
  Verifying  : perl-Thread-Queue-3.02-2.el7.noarch                        12/38
  Verifying  : libgomp-4.8.5-16.el7_4.1.x86_64                            13/38
  Verifying  : libgcc-4.8.5-16.el7_4.1.x86_64                             14/38
  Verifying  : kernel-headers-3.10.0-693.17.1.el7.x86_64                  15/38
  Verifying  : libstdc++-devel-4.8.5-16.el7_4.1.x86_64                    16/38
  Verifying  : glibc-headers-2.17-196.el7_4.2.x86_64                      17/38
  Verifying  : libtool-2.4.2-22.el7_3.x86_64                              18/38
  Verifying  : glibc-2.17-196.el7_4.2.x86_64                              19/38
  Verifying  : cpp-4.8.5-16.el7_4.1.x86_64                                20/38
  Verifying  : perl-Git-1.8.3.1-12.el7_4.noarch                           21/38
  Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                        22/38
  Verifying  : 1:perl-Error-0.17020-2.el7.noarch                          23/38
  Verifying  : rsync31u-3.1.3-1.ius.centos7.x86_64                        24/38
  Verifying  : gcc-c++-4.8.5-16.el7_4.1.x86_64                            25/38
  Verifying  : libmpc-1.0.1-3.el7.x86_64                                  26/38
  Verifying  : freetype-devel-2.4.11-15.el7.x86_64                        27/38
  Verifying  : autoconf-2.69-11.el7.noarch                                28/38
  Verifying  : libstdc++-4.8.5-16.el7_4.1.x86_64                          29/38
  Verifying  : libarchive-3.1.2-10.el7_2.x86_64                           30/38
  Verifying  : cmake-2.8.12.2-2.el7.x86_64                                31/38
  Verifying  : gcc-4.8.5-16.el7_4.1.x86_64                                32/38
  Verifying  : glibc-common-2.17-196.el7_4.2.x86_64                       33/38
  Verifying  : libstdc++-4.8.5-16.el7.x86_64                              34/38
  Verifying  : libgomp-4.8.5-16.el7.x86_64                                35/38
  Verifying  : libgcc-4.8.5-16.el7.x86_64                                 36/38
  Verifying  : glibc-common-2.17-196.el7.x86_64                           37/38
  Verifying  : glibc-2.17-196.el7.x86_64                                  38/38

Installed:
  autoconf.noarch 0:2.69-11.el7             automake.noarch 0:1.13.4-3.el7
  bzip2.x86_64 0:1.0.6-13.el7               cmake.x86_64 0:2.8.12.2-2.el7
  freetype-devel.x86_64 0:2.4.11-15.el7     gcc.x86_64 0:4.8.5-16.el7_4.1
  gcc-c++.x86_64 0:4.8.5-16.el7_4.1         git.x86_64 0:1.8.3.1-12.el7_4
  libtool.x86_64 0:2.4.2-22.el7_3           mercurial.x86_64 0:2.6.2-8.el7_4
  zlib-devel.x86_64 0:1.2.7-17.el7

Dependency Installed:
  cpp.x86_64 0:4.8.5-16.el7_4.1
  glibc-devel.x86_64 0:2.17-196.el7_4.2
  glibc-headers.x86_64 0:2.17-196.el7_4.2
  kernel-headers.x86_64 0:3.10.0-693.17.1.el7
  libarchive.x86_64 0:3.1.2-10.el7_2
  libgnome-keyring.x86_64 0:3.12.0-1.el7
  libmpc.x86_64 0:1.0.1-3.el7
  libstdc++-devel.x86_64 0:4.8.5-16.el7_4.1
  m4.x86_64 0:1.4.16-10.el7
  mpfr.x86_64 0:3.1.1-4.el7
  perl-Data-Dumper.x86_64 0:2.145-3.el7
  perl-Error.noarch 1:0.17020-2.el7
  perl-Git.noarch 0:1.8.3.1-12.el7_4
  perl-TermReadKey.x86_64 0:2.30-20.el7
  perl-Test-Harness.noarch 0:3.28-3.el7
  perl-Thread-Queue.noarch 0:3.02-2.el7
  rsync31u.x86_64 0:3.1.3-1.ius.centos7

Dependency Updated:
  glibc.x86_64 0:2.17-196.el7_4.2       glibc-common.x86_64 0:2.17-196.el7_4.2
  libgcc.x86_64 0:4.8.5-16.el7_4.1      libgomp.x86_64 0:4.8.5-16.el7_4.1
  libstdc++.x86_64 0:4.8.5-16.el7_4.1

Complete!

Step 2:

mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources

Step 3:

yum install yasm
[root@tutorialspots ffmpeg_sources]# yum install yasm
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.lga7.us.voxel.net
 * epel: mirrors.coreix.net
 * extras: mirror.trouble-free.net
 * ius: ius.mirror.constant.com
 * updates: mirrors.maine.edu
Resolving Dependencies
--> Running transaction check
---> Package yasm.x86_64 0:1.2.0-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch             Version                   Repository      Size
================================================================================
Installing:
 nasm           x86_64           2.10.07-7.el7             base           402 k
 yasm           x86_64           1.2.0-4.el7               epel           398 k

Transaction Summary
================================================================================
Install  2 Packages

Total download size: 801 k
Installed size: 3.3 M
Is this ok [y/d/N]: y
Downloading packages:
(1/1): yasm-1.2.0-4.el7.x86_64.rpm                         | 398 kB   00:00
--------------------------------------------------------------------------------
Total                                              1.0 MB/s | 398 kB  00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : yasm-1.2.0-4.el7.x86_64                                      1/1
  Verifying  : yasm-1.2.0-4.el7.x86_64                                      1/1

Installed:
  yasm.x86_64 0:1.2.0-4.el7

Complete!

Step 4: install libx264

git clone --depth 1 http://git.videolan.org/git/x264
cd x264
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
make
make install
cd ..

Result:

[root@tutorialspots x264]# make install
install -d /root/bin
install x264 /root/bin
install -d /root/ffmpeg_build/include
install -d /root/ffmpeg_build/lib
install -d /root/ffmpeg_build/lib/pkgconfig
install -m 644 ./x264.h /root/ffmpeg_build/include
install -m 644 x264_config.h /root/ffmpeg_build/include
install -m 644 x264.pc /root/ffmpeg_build/lib/pkgconfig
install -m 644 libx264.a /root/ffmpeg_build/lib
gcc-ranlib /root/ffmpeg_build/lib/libx264.a

If you see error:

Found no assembler
Minimum version is nasm-2.13

Run

yum remove nasm && hash -r

You must install nasm from source:

cd ~/ffmpeg_sources
curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2
tar xjvf nasm-2.13.02.tar.bz2
cd nasm-2.13.02
./autogen.sh
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install
cd ..

If you see error: “AVComponentDescriptor” has no member named “depth”
Fix: http://tutorialspots.com/how-to-fix-error-while-compiling-libx264-avcomponentdescriptor-has-no-member-named-depth-4187.html

Step 5: install libx265

hg clone https://bitbucket.org/multicoreware/x265
cd ~/ffmpeg_sources/x265/build/linux
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make
make install

Update: 02/24/2024 deadlink https://bitbucket.org/multicoreware/x265 , we change to https://github.com/videolan/x265, change first command to: git clone https://github.com/videolan/x265

Result:

[root@tutorialspots ffmpeg_sources]# hg clone https://bitbucket.org/multicoreware/x26
5
destination directory: x265
requesting all changes
adding changesets
adding manifests
adding file changes
added 11993 changesets with 28384 changes to 780 files
updating to branch default
294 files updated, 0 files merged, 0 files removed, 0 files unresolved
[root@tutorialspots ffmpeg_sources]# cd ~/ffmpeg_sources/x265/build/linux
[root@nguyen-1 linux]# cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/f
fmpeg_build" -DENABLE_SHARED:bool=off ../../source
-- cmake version 2.8.12.2
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detected x86_64 target processor
-- Could NOT find NUMA (missing:  NUMA_ROOT_DIR NUMA_INCLUDE_DIR NUMA_LIBRARY)
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Performing Test CC_HAS_NO_STRICT_OVERFLOW
-- Performing Test CC_HAS_NO_STRICT_OVERFLOW - Success
-- Performing Test CC_HAS_NO_NARROWING
-- Performing Test CC_HAS_NO_NARROWING - Success
-- Performing Test CC_HAS_NO_ARRAY_BOUNDS
-- Performing Test CC_HAS_NO_ARRAY_BOUNDS - Success
-- Performing Test CC_HAS_FAST_MATH
-- Performing Test CC_HAS_FAST_MATH - Success
-- Performing Test CC_HAS_STACK_REALIGN
-- Performing Test CC_HAS_STACK_REALIGN - Success
-- Performing Test CC_HAS_FNO_EXCEPTIONS_FLAG
-- Performing Test CC_HAS_FNO_EXCEPTIONS_FLAG - Success
-- Found nasm: /root/bin/nasm (found version "2.13.02")
-- Found Nasm 2.13.02 to build assembly primitives
-- hg found at /usr/bin/hg
-- x265 version 2.6+49-7219376de42a
-- The ASM_NASM compiler identification is unknown
-- Found assembler: /root/bin/nasm
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for include file getopt.h
-- Looking for include file getopt.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /root/ffmpeg_sources/x265/build/linux
[root@tutorialspots linux]# make
Scanning dependencies of target encoder
[  1%] Building CXX object encoder/CMakeFiles/encoder.dir/analysis.cpp.o
[  2%] Building CXX object encoder/CMakeFiles/encoder.dir/search.cpp.o
[  3%] Building CXX object encoder/CMakeFiles/encoder.dir/bitcost.cpp.o
[  5%] Building CXX object encoder/CMakeFiles/encoder.dir/motion.cpp.o
[  6%] Building CXX object encoder/CMakeFiles/encoder.dir/slicetype.cpp.o
[  7%] Building CXX object encoder/CMakeFiles/encoder.dir/frameencoder.cpp.o
[  8%] Building CXX object encoder/CMakeFiles/encoder.dir/framefilter.cpp.o
[ 10%] Building CXX object encoder/CMakeFiles/encoder.dir/level.cpp.o
[ 11%] Building CXX object encoder/CMakeFiles/encoder.dir/nal.cpp.o
[ 12%] Building CXX object encoder/CMakeFiles/encoder.dir/sei.cpp.o
[ 13%] Building CXX object encoder/CMakeFiles/encoder.dir/sao.cpp.o
[ 15%] Building CXX object encoder/CMakeFiles/encoder.dir/entropy.cpp.o
[ 16%] Building CXX object encoder/CMakeFiles/encoder.dir/dpb.cpp.o
[ 17%] Building CXX object encoder/CMakeFiles/encoder.dir/ratecontrol.cpp.o
[ 18%] Building CXX object encoder/CMakeFiles/encoder.dir/reference.cpp.o
[ 20%] Building CXX object encoder/CMakeFiles/encoder.dir/encoder.cpp.o
[ 21%] Building CXX object encoder/CMakeFiles/encoder.dir/api.cpp.o
[ 22%] Building CXX object encoder/CMakeFiles/encoder.dir/weightPrediction.cpp.o
[ 22%] Built target encoder
Scanning dependencies of target common
[ 23%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/pixel-a.asm.o
[ 25%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/const-a.asm.o
[ 26%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/cpu-a.asm.o
[ 27%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/ssd-a.asm.o
[ 28%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/mc-a.asm.o
[ 30%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/mc-a2.asm.o
[ 31%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/pixel-util8.asm
.o
[ 32%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/blockcopy8.asm.
o
[ 33%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/pixeladd8.asm.o
[ 35%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/dct8.asm.o
[ 36%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/seaintegral.asm
.o
[ 37%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/sad-a.asm.o
[ 38%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/intrapred8.asm.
o
[ 40%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/intrapred8_alla
ngs.asm.o
[ 41%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/v4-ipfilter8.as
m.o
[ 42%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/h-ipfilter8.asm
.o
[ 43%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/ipfilter8.asm.o
[ 45%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/loopfilter.asm.
o
[ 46%] Building CXX object common/CMakeFiles/common.dir/x86/asm-primitives.cpp.o
[ 47%] Building CXX object common/CMakeFiles/common.dir/vec/vec-primitives.cpp.o
[ 48%] Building CXX object common/CMakeFiles/common.dir/vec/dct-sse3.cpp.o
[ 50%] Building CXX object common/CMakeFiles/common.dir/vec/dct-ssse3.cpp.o
[ 51%] Building CXX object common/CMakeFiles/common.dir/vec/dct-sse41.cpp.o
[ 52%] Building CXX object common/CMakeFiles/common.dir/primitives.cpp.o
[ 53%] Building CXX object common/CMakeFiles/common.dir/pixel.cpp.o
[ 55%] Building CXX object common/CMakeFiles/common.dir/dct.cpp.o
[ 56%] Building CXX object common/CMakeFiles/common.dir/lowpassdct.cpp.o
[ 57%] Building CXX object common/CMakeFiles/common.dir/ipfilter.cpp.o
[ 58%] Building CXX object common/CMakeFiles/common.dir/intrapred.cpp.o
[ 60%] Building CXX object common/CMakeFiles/common.dir/loopfilter.cpp.o
[ 61%] Building CXX object common/CMakeFiles/common.dir/constants.cpp.o
[ 62%] Building CXX object common/CMakeFiles/common.dir/cpu.cpp.o
[ 63%] Building CXX object common/CMakeFiles/common.dir/version.cpp.o
[ 65%] Building CXX object common/CMakeFiles/common.dir/threading.cpp.o
[ 66%] Building CXX object common/CMakeFiles/common.dir/threadpool.cpp.o
[ 67%] Building CXX object common/CMakeFiles/common.dir/wavefront.cpp.o
[ 68%] Building CXX object common/CMakeFiles/common.dir/md5.cpp.o
[ 70%] Building CXX object common/CMakeFiles/common.dir/bitstream.cpp.o
[ 71%] Building CXX object common/CMakeFiles/common.dir/yuv.cpp.o
[ 72%] Building CXX object common/CMakeFiles/common.dir/shortyuv.cpp.o
[ 73%] Building CXX object common/CMakeFiles/common.dir/picyuv.cpp.o
[ 75%] Building CXX object common/CMakeFiles/common.dir/common.cpp.o
[ 76%] Building CXX object common/CMakeFiles/common.dir/param.cpp.o
[ 77%] Building CXX object common/CMakeFiles/common.dir/frame.cpp.o
[ 78%] Building CXX object common/CMakeFiles/common.dir/framedata.cpp.o
[ 80%] Building CXX object common/CMakeFiles/common.dir/cudata.cpp.o
[ 81%] Building CXX object common/CMakeFiles/common.dir/slice.cpp.o
[ 82%] Building CXX object common/CMakeFiles/common.dir/lowres.cpp.o
[ 83%] Building CXX object common/CMakeFiles/common.dir/piclist.cpp.o
[ 85%] Building CXX object common/CMakeFiles/common.dir/predict.cpp.o
[ 86%] Building CXX object common/CMakeFiles/common.dir/scalinglist.cpp.o
[ 87%] Building CXX object common/CMakeFiles/common.dir/quant.cpp.o
[ 88%] Building CXX object common/CMakeFiles/common.dir/deblock.cpp.o
[ 88%] Built target common
Scanning dependencies of target x265-static
Linking CXX static library libx265.a
[ 88%] Built target x265-static
Scanning dependencies of target cli
[ 90%] Building CXX object CMakeFiles/cli.dir/input/input.cpp.o
[ 91%] Building CXX object CMakeFiles/cli.dir/input/yuv.cpp.o
[ 92%] Building CXX object CMakeFiles/cli.dir/input/y4m.cpp.o
[ 93%] Building CXX object CMakeFiles/cli.dir/output/output.cpp.o
[ 95%] Building CXX object CMakeFiles/cli.dir/output/reconplay.cpp.o
[ 96%] Building CXX object CMakeFiles/cli.dir/output/yuv.cpp.o
[ 97%] Building CXX object CMakeFiles/cli.dir/output/y4m.cpp.o
[ 98%] Building CXX object CMakeFiles/cli.dir/output/raw.cpp.o
[100%] Building CXX object CMakeFiles/cli.dir/x265.cpp.o
Linking CXX executable x265
[100%] Built target cli
[root@tutorialspots linux]# make install
[ 22%] Built target encoder
[ 88%] Built target common
[ 88%] Built target x265-static
[100%] Built target cli
Install the project...
-- Install configuration: "Release"
-- Installing: /root/ffmpeg_build/lib/libx265.a
-- Installing: /root/ffmpeg_build/include/x265.h
-- Installing: /root/ffmpeg_build/include/x265_config.h
-- Installing: /root/ffmpeg_build/lib/pkgconfig/x265.pc
-- Installing: /root/ffmpeg_build/bin/x265

Step 6: install libfdk_aac

cd ~/ffmpeg_sources
git clone --depth 1 https://github.com/mstorsjo/fdk-aac
cd fdk-aac
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install

Result:

[root@tutorialspots linux]# cd ~/ffmpeg_sources
[root@tutorialspots ffmpeg_sources]# git clone --depth 1 https://github.com/mstorsjo/
fdk-aac
Cloning into 'fdk-aac'...
remote: Counting objects: 370, done.
remote: Compressing objects: 100% (285/285), done.
remote: Total 370 (delta 182), reused 114 (delta 75), pack-reused 0
Receiving objects: 100% (370/370), 1.86 MiB | 0 bytes/s, done.
Resolving deltas: 100% (182/182), done.
[root@tutorialspots ffmpeg_sources]# cd fdk-aac
[root@tutorialspots fdk-aac]# autoreconf -fiv
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:22: installing './config.guess'
configure.ac:22: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
...
[root@tutorialspots fdk-aac]# make install
make[1]: Entering directory `/root/ffmpeg_sources/fdk-aac'
 /usr/bin/mkdir -p '/root/ffmpeg_build/lib'
 /bin/sh ./libtool   --mode=install /usr/bin/install -c   libfdk-aac.la '/root/f
fmpeg_build/lib'
libtool: install: /usr/bin/install -c .libs/libfdk-aac.lai /root/ffmpeg_build/li
b/libfdk-aac.la
libtool: install: /usr/bin/install -c .libs/libfdk-aac.a /root/ffmpeg_build/lib/
libfdk-aac.a
libtool: install: chmod 644 /root/ffmpeg_build/lib/libfdk-aac.a
libtool: install: ranlib /root/ffmpeg_build/lib/libfdk-aac.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/b
in:/sbin" ldconfig -n /root/ffmpeg_build/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /root/ffmpeg_build/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /usr/bin/mkdir -p '/root/ffmpeg_build/include/fdk-aac'
 /usr/bin/install -c -m 644 ./libSYS/include/machine_type.h ./libSYS/include/gen
ericStds.h ./libSYS/include/FDK_audio.h ./libAACenc/include/aacenc_lib.h ./libAA
Cdec/include/aacdecoder_lib.h '/root/ffmpeg_build/include/fdk-aac'
 /usr/bin/mkdir -p '/root/ffmpeg_build/lib/pkgconfig'
 /usr/bin/install -c -m 644 fdk-aac.pc '/root/ffmpeg_build/lib/pkgconfig'
make[1]: Leaving directory `/root/ffmpeg_sources/fdk-aac'

If you get error:

[root@tutorialspots ffmpeg_sources]# git clone --depth 1 https://github.com/mstorsjo/fdk-aac
Initialized empty Git repository in /root/ffmpeg_sources/fdk-aac/.git/
error:  while accessing https://github.com/mstorsjo/fdk-aac/info/refs

fatal: HTTP request failed

Fix:
Git error: fatal: HTTP request failed

Step 7: install libmp3lame

cd ~/ffmpeg_sources
curl -O -L http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
tar xzvf lame-3.100.tar.gz
cd lame-3.100
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm
make
make install

Result:

...
[root@tutorialspots ffmpeg_sources]# cd lame-3.100
[root@tutorialspots lame-3.100]# ./configure --prefix="$HOME/ffmpeg_build" --bindir="
$HOME/bin" --disable-shared --enable-nasm
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for library containing strerror... none required
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-li
nux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format.
.. func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libr
aries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking compiler... gcc
checking version of GCC... unknown compiler version pattern
checking dmalloc.h usability... no
checking dmalloc.h presence... no
checking for dmalloc.h... no
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking sys/soundcard.h usability... yes
checking sys/soundcard.h presence... yes
checking for sys/soundcard.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking linux/soundcard.h usability... yes
checking linux/soundcard.h presence... yes
checking for linux/soundcard.h... yes
checking working SSE intrinsics... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of short... 2
checking size of unsigned short... 2
checking size of int... 4
checking size of unsigned int... 4
checking size of long... 8
checking size of unsigned long... 8
checking size of long long... 8
checking size of unsigned long long... 8
checking size of float... 4
checking size of double... 8
checking for long double with more range or precision than double... yes
checking for uint8_t... yes
checking for int8_t... yes
checking for uint16_t... yes
checking for int16_t... yes
checking for uint32_t... yes
checking for int32_t... yes
checking for uint64_t... yes
checking for int64_t... yes
checking for IEEE854 compliant 80 bit floats... yes
checking for ieee854_float80_t... no
checking for ieee754_float64_t... no
checking for ieee754_float32_t... no
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for gettimeofday... yes
checking for strtol... yes
checking for socket... yes
checking termcap.h usability... no
checking termcap.h presence... no
checking for termcap.h... no
checking ncurses/termcap.h usability... no
checking ncurses/termcap.h presence... no
checking for ncurses/termcap.h... no
checking for initscr in -ltermcap... no
checking for initscr in -lcurses... no
checking for initscr in -lncurses... no
checking for ld used by gcc... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking for iconv... yes
checking for working iconv... yes
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, ch
ar * *outbuf, size_t *outbytesleft);
checking for cos in -lm... yes
checking for cos in -lffm... no
checking for cos in -lcpml... no
checking for gtk-config... no
checking for GTK - version >= 1.2.0... no
*** The gtk-config script installed by GTK could not be found
*** If GTK was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GTK_CONFIG environment variable to the
*** full path to gtk-config.
checking use of ElectricFence malloc debugging... no
checking use of file io... lame
checking use of analyzer hooks... yes
checking use of mpg123 decoder... yes (Layer 1, 2, 3)
checking if the lame frontend should be build... yes
checking if mp3x is requested... no
checking if mp3rtp is requested... no
checking if dynamic linking of the frontends is requested... no
checking for termcap... no
checking if I have to build the internal vector lib... yes
checking for nasm... /root/bin/nasm
checking for assembler routines for this processor type... no
checking for additional optimizations... no
checking for debug options... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libmp3lame/Makefile
config.status: creating libmp3lame/i386/Makefile
config.status: creating libmp3lame/vector/Makefile
config.status: creating frontend/Makefile
config.status: creating mpglib/Makefile
config.status: creating doc/Makefile
config.status: creating doc/html/Makefile
config.status: creating doc/man/Makefile
config.status: creating include/Makefile
config.status: creating Dll/Makefile
config.status: creating misc/Makefile
config.status: creating dshow/Makefile
config.status: creating ACM/Makefile
config.status: creating ACM/ADbg/Makefile
config.status: creating ACM/ddk/Makefile
config.status: creating ACM/tinyxml/Makefile
config.status: creating lame.spec
config.status: creating mac/Makefile
config.status: creating macosx/Makefile
config.status: creating macosx/English.lproj/Makefile
config.status: creating macosx/LAME.xcodeproj/Makefile
config.status: creating vc_solution/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
...
[root@tutorialspots lame-3.100]# make install
Making install in mpglib
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/mpglib'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/mpglib'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/mpglib'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/mpglib'
Making install in libmp3lame
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/libmp3lame'
Making install in i386
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/libmp3lame/i386'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/libmp3lame/i386'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/libmp3lame/i386'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/libmp3lame/i386'
Making install in vector
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/libmp3lame/vector'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/libmp3lame/vector'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/libmp3lame/vector'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/libmp3lame/vector'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/libmp3lame'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/libmp3lame'
 /usr/bin/mkdir -p '/root/ffmpeg_build/lib'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libmp3lame.la '/root/
ffmpeg_build/lib'
libtool: install: /usr/bin/install -c .libs/libmp3lame.lai /root/ffmpeg_build/li
b/libmp3lame.la
libtool: install: /usr/bin/install -c .libs/libmp3lame.a /root/ffmpeg_build/lib/
libmp3lame.a
libtool: install: chmod 644 /root/ffmpeg_build/lib/libmp3lame.a
libtool: install: ranlib /root/ffmpeg_build/lib/libmp3lame.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/b
in:/sbin" ldconfig -n /root/ffmpeg_build/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /root/ffmpeg_build/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/libmp3lame'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/libmp3lame'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/libmp3lame'
Making install in frontend
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/frontend'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/frontend'
 /usr/bin/mkdir -p '/root/bin'
  /bin/sh ../libtool   --mode=install /usr/bin/install -c lame '/root/bin'
libtool: install: /usr/bin/install -c lame /root/bin/lame
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/frontend'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/frontend'
Making install in Dll
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/Dll'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/Dll'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/Dll'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/Dll'
Making install in doc
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/doc'
Making install in html
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/doc/html'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/doc/html'
make[3]: Nothing to be done for `install-exec-am'.
 /usr/bin/mkdir -p '/root/ffmpeg_build/share/doc/lame/html'
 /usr/bin/install -c -m 644 about.html abr.html cbr.html contact.html contributo
rs.html detailed.html history.html index.html introduction.html links.html list.
html ms_stereo.html usage.html vbr.html '/root/ffmpeg_build/share/doc/lame/html'
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/doc/html'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/doc/html'
Making install in man
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/doc/man'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/doc/man'
make[3]: Nothing to be done for `install-exec-am'.
 /usr/bin/mkdir -p '/root/ffmpeg_build/share/man/man1'
 /usr/bin/install -c -m 644 lame.1 '/root/ffmpeg_build/share/man/man1'
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/doc/man'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/doc/man'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/doc'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/doc'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/doc'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/doc'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/doc'
Making install in include
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/include'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/include'
make[2]: Nothing to be done for `install-exec-am'.
 /usr/bin/mkdir -p '/root/ffmpeg_build/include/lame'
 /usr/bin/install -c -m 644 lame.h '/root/ffmpeg_build/include/lame'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/include'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/include'
Making install in misc
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/misc'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/misc'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/misc'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/misc'
Making install in dshow
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/dshow'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/dshow'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/dshow'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/dshow'
Making install in ACM
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/ACM'
Making install in ADbg
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/ACM/ADbg'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/ACM/ADbg'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/ACM/ADbg'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/ACM/ADbg'
Making install in ddk
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/ACM/ddk'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/ACM/ddk'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/ACM/ddk'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/ACM/ddk'
Making install in tinyxml
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/ACM/tinyxml'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/ACM/tinyxml'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/ACM/tinyxml'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/ACM/tinyxml'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/ACM'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/ACM'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/ACM'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/ACM'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/ACM'
Making install in mac
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/mac'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/mac'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/mac'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/mac'
Making install in macosx
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/macosx'
Making install in English.lproj
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/macosx/English.lpro
j'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/macosx/English.lpro
j'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/macosx/English.lproj
'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/macosx/English.lproj
'
Making install in LAME.xcodeproj
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/macosx/LAME.xcodepr
oj'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/macosx/LAME.xcodepr
oj'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/macosx/LAME.xcodepro
j'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/macosx/LAME.xcodepro
j'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/macosx'
make[3]: Entering directory `/root/ffmpeg_sources/lame-3.100/macosx'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/root/ffmpeg_sources/lame-3.100/macosx'
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/macosx'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/macosx'
Making install in vc_solution
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100/vc_solution'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100/vc_solution'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100/vc_solution'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100/vc_solution'
make[1]: Entering directory `/root/ffmpeg_sources/lame-3.100'
make[2]: Entering directory `/root/ffmpeg_sources/lame-3.100'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/ffmpeg_sources/lame-3.100'
make[1]: Leaving directory `/root/ffmpeg_sources/lame-3.100'

Step 8: install libopus

cd ~/ffmpeg_sources
curl -O -L https://archive.mozilla.org/pub/opus/opus-1.2.1.tar.gz
tar xzvf opus-1.2.1.tar.gz
cd opus-1.2.1
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install

Result:

...
configure:
------------------------------------------------------------------------
  opus 1.2.1:  Automatic configuration OK.

    Compiler support:

      C99 var arrays: ................ yes
      C99 lrintf: .................... yes
      Use alloca: .................... no (using var arrays)

    General configuration:

      Floating point support: ........ yes
      Fast float approximations: ..... no
      Fixed point debugging: ......... no
      Inline Assembly Optimizations: . No inline ASM for your platform, please s
end patches
      External Assembly Optimizations:
      Intrinsics Optimizations.......: x86 SSE SSE2 SSE4.1 AVX
      Run-time CPU detection: ........ x86 SSE4.1 AVX
      Custom modes: .................. no
      Assertion checking: ............ no
      Fuzzing: ....................... no
      Check ASM: ..................... no
      Ambisonics support: ............ no

      API documentation: ............. yes
      Extra programs: ................ yes
------------------------------------------------------------------------

 Type "make; make install" to compile and install
 Type "make check" to run the test suite
...
  CCLD     tests/test_opus_padding
make[3]: Entering directory `/root/ffmpeg_sources/opus-1.2.1/doc'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/root/ffmpeg_sources/opus-1.2.1/doc'
make[2]: Leaving directory `/root/ffmpeg_sources/opus-1.2.1'
make[1]: Leaving directory `/root/ffmpeg_sources/opus-1.2.1'
[root@nguyen-1 opus-1.2.1]# make install
make  install-recursive
make[1]: Entering directory `/root/ffmpeg_sources/opus-1.2.1'
make[2]: Entering directory `/root/ffmpeg_sources/opus-1.2.1'
make[3]: Entering directory `/root/ffmpeg_sources/opus-1.2.1/doc'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/root/ffmpeg_sources/opus-1.2.1/doc'
make[3]: Entering directory `/root/ffmpeg_sources/opus-1.2.1'
 /usr/bin/mkdir -p '/root/ffmpeg_build/lib'
 /bin/sh ./libtool   --mode=install /usr/bin/install -c   libopus.la '/root/ffmp
eg_build/lib'
libtool: install: /usr/bin/install -c .libs/libopus.lai /root/ffmpeg_build/lib/l
ibopus.la
libtool: install: /usr/bin/install -c .libs/libopus.a /root/ffmpeg_build/lib/lib
opus.a
libtool: install: chmod 644 /root/ffmpeg_build/lib/libopus.a
libtool: install: ranlib /root/ffmpeg_build/lib/libopus.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/b
in:/sbin" ldconfig -n /root/ffmpeg_build/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /root/ffmpeg_build/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[4]: Entering directory `/root/ffmpeg_sources/opus-1.2.1/doc'
make[5]: Entering directory `/root/ffmpeg_sources/opus-1.2.1/doc'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/root/ffmpeg_sources/opus-1.2.1/doc'
make[4]: Leaving directory `/root/ffmpeg_sources/opus-1.2.1/doc'
 /usr/bin/mkdir -p '/root/ffmpeg_build/share/aclocal'
 /usr/bin/install -c -m 644 opus.m4 '/root/ffmpeg_build/share/aclocal'
 /usr/bin/mkdir -p '/root/ffmpeg_build/lib/pkgconfig'
 /usr/bin/install -c -m 644 opus.pc '/root/ffmpeg_build/lib/pkgconfig'
 /usr/bin/mkdir -p '/root/ffmpeg_build/include/opus'
 /usr/bin/install -c -m 644 include/opus.h include/opus_multistream.h include/op
us_types.h include/opus_defines.h '/root/ffmpeg_build/include/opus'
make[3]: Leaving directory `/root/ffmpeg_sources/opus-1.2.1'
make[2]: Leaving directory `/root/ffmpeg_sources/opus-1.2.1'
make[1]: Leaving directory `/root/ffmpeg_sources/opus-1.2.1'

Step 9: install libogg

cd ~/ffmpeg_sources
curl -O -L http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.gz
tar xzvf libogg-1.3.3.tar.gz
cd libogg-1.3.3
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install

Step 10: install libvorbis

cd ~/ffmpeg_sources
curl -O -L http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz
tar xzvf libvorbis-1.3.5.tar.gz
cd libvorbis-1.3.5
./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
make
make install

Step 11 (optinal):
11.a: Install gnutls

yum install -y dash git autoconf libtool gettext-devel automake autogen patch
yum install -y nettle-devel p11-kit-devel autogen-libopts-devel libunistring-devel
yum install -y trousers-devel guile-devel libtasn1-devel libidn2-devel gawk gperf
yum install -y libtasn1-tools unbound-devel bison help2man gtk-doc texinfo texlive
cd ~/ffmpeg_sources
git clone https://gitlab.com/gnutls/gnutls.git
cd gnutls
./bootstrap
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install

If you get error:

  *** Libnettle 3.4.1 was not found.

You must build libnettle from source:

cd ~
wget https://ftp.gnu.org/gnu/nettle/nettle-3.4.1.tar.gz
tar -xvf nettle-3.4.1.tar.gz
cd nettle-3.4.1
./.bootstrap
./configure --disable-static --prefix="$HOME/ffmpeg_build" CFLAGS="-std=gnu99" --disable-openssl --enable-shared
make
make install

Then change

./configure --prefix="$HOME/ffmpeg_build" --disable-shared

To

PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib64/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --disable-shared

If you see error:

configure: error: Nettle lacks the required rsa_sec_decrypt function

You must use openssl instead of gnutls
11.b: Install openssl

cd ~/ffmpeg_sources
wget https://www.openssl.org/source/old/1.0.1/openssl-1.0.1j.tar.gz
tar -xvf openssl-1.0.1j.tar.gz
cd openssl-1.0.1j
./config --prefix="$HOME/ffmpeg_build" 
make
make install

Step 12: install libvpx

cd ~/ffmpeg_sources
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm
make
make install

If you get eror like

    [CC] vp9/encoder/x86/temporal_filter_sse4.c.o
vp9/encoder/x86/temporal_filter_sse4.c: In function ‘vp9_apply_temporal_filter_luma_16’:
vp9/encoder/x86/temporal_filter_sse4.c:618:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (unsigned int h = 1; h < block_height - 1; ++h) {

You change

./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm

To

CC=c99 ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm

Step 13: install FFmpeg

cd ~/ffmpeg_sources
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --extra-libs=-lpthread \
  --extra-libs=-lm \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-libfdk_aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree \
  --enable-muxer=segment \
  --enable-muxer=stream_segment
make
make install
hash -r

If you want to use gnutls, use this command instead:

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --extra-libs=-lpthread \
  --extra-libs=-lm \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-libfdk_aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree \
  --enable-gnutls \
  --enable-muxer=segment \
  --enable-muxer=stream_segment
make
make install
hash -r

OpenSSL

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --extra-libs=-lpthread \
  --extra-libs=-lm \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-libfdk_aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree \
  --enable-openssl \
  --enable-muxer=segment \
  --enable-muxer=stream_segment
make
make install
hash -r

Compilation is now complete and ffmpeg (also ffprobe, ffserver, lame, and x264) should now be ready to use.

Check

[root@tutorialspots ffmpeg]# ffmpeg -version
ffmpeg version N-90155-g28924f4 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-16)
configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-c
flags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --ex
tra-libs=-lpthread --extra-libs=-lm --bindir=/root/bin --enable-gpl --enable-lib
fdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvo
rbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable
-muxer=segment --enable-muxer=stream_segment
libavutil      56.  7.101 / 56.  7.101
libavcodec     58. 12.102 / 58. 12.102
libavformat    58.  9.100 / 58.  9.100
libavdevice    58.  2.100 / 58.  2.100
libavfilter     7. 12.100 /  7. 12.100
libswscale      5.  0.101 /  5.  0.101
libswresample   3.  0.101 /  3.  0.101
libpostproc    55.  0.100 / 55.  0.100

If you get error:

ERROR: freetype2 not found using pkg-config

You do step 16 in this tutorial: How to compile FFmpeg on CentOS – part 2

2 Comments

Leave a Reply