Changes between Version 23 and Version 24 of CompilationGuide/Centos


Ignore:
Timestamp:
May 30, 2013, 8:18:23 AM (6 years ago)
Author:
llogan
Comment:

change guide to make local type install

Legend:

Unmodified
Added
Removed
Modified
  • CompilationGuide/Centos

    v23 v24  
    11= Compile FFmpeg on CentOS 6.x =
    22
    3 This guide is based on a minimal CentOS installation and will install FFmpeg with several external encoding libraries. This guide is kept relatively up to date with FFmpeg development and library sources (see the page [wiki:CentosCompilationGuide?action=history history] for changelog), and should also work for recent Red Hat Enterprise Linux (RHEL) and Fedora.
     3[[PageOutline(2, Contents)]]
     4
     5This guide is based on minimal CentOS and will provide a local, non-system installation of FFmpeg with several external encoding libraries. These instructions should also work for recent Red Hat Enterprise Linux (RHEL) and Fedora. This is a non-invasive guide and undoing all steps is simple and is shown at the end of this page.
     6
     7----
     8
     9== Get the Dependencies ==
    410
    511  '''Note:''' The # indicates that the command should be executed as superuser or root.
    612
    7 == Preparation ==
    8 Remove any existing packages:
    9 {{{
    10 # yum erase ffmpeg x264 x264-devel
    11 }}}
    12 
    1313Get the dependencies:
    1414{{{
    15 # yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig wget zlib-devel
    16 }}}
    17 
    18 Make a source directory:
    19 {{{
    20 mkdir ~/ffmpeg-source
    21 }}}
    22 
    23 == Installation ==
     15# yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
     16}}}
     17
     18Make a directory to put all of the source code into:
     19{{{
     20mkdir ~/ffmpeg_sources
     21}}}
     22
     23----
     24
     25== Compilation & Installation ==
     26
     27  '''Note:''' If you do not require certain encoders you may skip the relevant section and then remove the appropriate `./configure` option in FFmpeg. For example, if libvorbis is not needed, then skip that section and then remove `--enable-libvorbis` from the [#FFmpeg Install FFmpeg] section.
     28
    2429=== Yasm ===
    2530Yasm is an assembler used by x264 and FFmpeg.
    2631{{{
    27 cd ~/ffmpeg-source
    28 wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
     32cd ~/ffmpeg_sources
     33curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
    2934tar xzvf yasm-1.2.0.tar.gz
    3035cd yasm-1.2.0
    31 ./configure
    32 make
    33 # make install
    34 }}}
    35 
    36   '''Note:''' If you do not require certain encoders you may skip the relevant section and then remove the appropriate ./configure option in FFmpeg. For example, if libvorbis is not needed, then skip that section and then remove ''--enable-libvorbis'' from the [#ffmpeg Install FFmpeg] section.
    37 
    38 === x264 ===#x264
     36./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
     37make
     38make install
     39make distclean
     40. ~/.bash_profile
     41}}}
     42
     43=== x264 ===
    3944H.264 video encoder.
    4045{{{
    41 cd ~/ffmpeg-source
    42 git clone git://git.videolan.org/x264
     46cd ~/ffmpeg_sources
     47git clone --depth 1 git://git.videolan.org/x264
    4348cd x264
    44 ./configure --enable-static
    45 make
    46 # make install
     49./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
     50make
     51make install
     52make distclean
    4753}}}
    4854
     
    5056AAC audio encoder.
    5157{{{
    52 cd ~/ffmpeg-source
     58cd ~/ffmpeg_sources
    5359git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
    5460cd fdk-aac
    5561autoreconf -fiv
    56 ./configure --disable-shared
    57 make
    58 # make install
     62./configure --prefix="$HOME/ffmpeg_build" --disable-shared
     63make
     64make install
     65make distclean
    5966}}}
    6067
     
    6269MP3 audio encoder.
    6370{{{
    64 cd ~/ffmpeg-source
    65 wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
     71cd ~/ffmpeg_sources
     72curl -L -O http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
    6673tar xzvf lame-3.99.5.tar.gz
    6774cd lame-3.99.5
    68 ./configure --disable-shared --enable-nasm
    69 make
    70 # make install
     75./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm
     76make
     77make install
     78make distclean
    7179}}}
    7280
    7381=== libogg ===
    74 Required for libtheora and libvorbis.
    75 {{{
    76 cd ~/ffmpeg-source
    77 wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
     82Ogg bitstream library. Required for libtheora and libvorbis.
     83{{{
     84cd ~/ffmpeg_sources
     85curl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
    7886tar xzvf libogg-1.3.0.tar.gz
    7987cd libogg-1.3.0
    80 ./configure --disable-shared
    81 make
    82 # make install
     88./configure --prefix="$HOME/ffmpeg_build" --disable-shared
     89make
     90make install
     91make distclean
    8392}}}
    8493
     
    8695Theora video encoder.
    8796{{{
    88 cd ~/ffmpeg-source
    89 wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
     97cd ~/ffmpeg_sources
     98curl -O http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
    9099tar xzvf libtheora-1.1.1.tar.gz
    91100cd libtheora-1.1.1
    92 ./configure --disable-shared
    93 make
    94 # make install
     101./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-examples --disable-shared --disable-sdltest --disable-vorbistest
     102make
     103make install
     104make distclean
    95105}}}
    96106
     
    98108Vorbis audio encoder.
    99109{{{
    100 cd ~/ffmpeg-source
    101 wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
     110cd ~/ffmpeg_sources
     111curl -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
    102112tar xzvf libvorbis-1.3.3.tar.gz
    103113cd libvorbis-1.3.3
    104 ./configure --disable-shared
    105 make
    106 # make install
    107 }}}
    108 
    109 === libvpx ===#libvpx
    110 VP8 video encoder.
    111 {{{
    112 cd ~/ffmpeg-source
    113 git clone http://git.chromium.org/webm/libvpx.git
     114./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
     115make
     116make install
     117make distclean
     118}}}
     119
     120=== libvpx ===
     121VP8/VP9 video encoder.
     122{{{
     123cd ~/ffmpeg_sources
     124git clone --depth 1 http://git.chromium.org/webm/libvpx.git
    114125cd libvpx
    115 ./configure
    116 make
    117 # make install
    118 }}}
    119 
    120 === FFmpeg ===#ffmpeg
    121 {{{
    122 cd ~/ffmpeg-source
    123 git clone git://source.ffmpeg.org/ffmpeg
     126./configure --prefix="$HOME/ffmpeg_build" --disable-examples
     127make
     128make install
     129make clean
     130}}}
     131
     132=== FFmpeg ===
     133{{{
     134cd ~/ffmpeg_sources
     135git clone --depth 1 git://source.ffmpeg.org/ffmpeg
    124136cd ffmpeg
    125 ./configure --enable-gpl --enable-libfdk_aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264
    126 make
    127 # make install
    128 }}}
    129 Compilation is now complete and ffmpeg should now be ready to use. The rest of this guide shows how to update or remove FFmpeg.
    130 
    131   '''Note:''' Keep the ffmpeg-source directory and all contents if you intend to update or uninstall as shown below.
    132 
    133 == Updating x264, libvpx, and FFmpeg ==
    134 First uninstall x264, libvpx, and FFmpeg:
    135 {{{
    136 cd ~/ffmpeg-source/x264
    137 # make uninstall
    138 cd ~/ffmpeg-source/ffmpeg
    139 # make uninstall
    140 cd ~/ffmpeg-source/libvpx
    141 # make uninstall
     137./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl --enable-libfdk_aac --enable-libmp3lame --enable-libvpx --enable-libx264 --enable-nonfree
     138make
     139make install
     140make distclean
     141hash -r
     142. ~/.bash_profile
     143}}}
     144
     145Compilation is now complete and `ffmpeg` (also `ffprobe`, `ffserver`, `lame`, and `x264`) should now be ready to use. The rest of this guide shows how to update or remove FFmpeg.
     146
     147  '''Note:''' Keep the `ffmpeg_sources` directory and all contents if you intend to update or uninstall as shown below.
     148
     149----
     150
     151== Updating ==
     152
     153Development of FFmpeg is active and an occasional update can give you new features and bug fixes. First, remove the old files and then update the dependencies:
     154{{{
     155rm -rf ~/ffmpeg_build ~/bin/{ffmpeg,ffprobe,ffserver,lame,vsyasm,x264,yasm,ytasm}
     156# yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
    142157}}}
    143158
    144159=== Update x264 ===
    145160{{{
    146 cd ~/ffmpeg-source/x264
     161cd ~/ffmpeg_sources/x264
    147162make distclean
    148163git pull
     
    150165Then run `./configure`, `make`, and `make install` as shown in the [#x264 Install x264] section.
    151166
     167=== Update libfdk_aac ===
     168{{{
     169cd ~/ffmpeg_sources/libfdk_aac
     170make distclean
     171git pull
     172}}}
     173Then run `./configure`, `make`, and `make install` as shown in the [#libfdk_aac Install libfdk_aac] section.
     174
    152175=== Update libvpx ===
    153176{{{
    154 cd ~/ffmpeg-source/libvpx
     177cd ~/ffmpeg_sources/libvpx
    155178make clean
    156179git pull
     
    160183=== Update FFmpeg ===
    161184{{{
    162 cd ~/ffmpeg-source/ffmpeg
    163 make distclean
    164 git pull
    165 }}}
    166 Then run `./configure`, `make`, and `make install` as shown in the [#ffmpeg Install FFmpeg] section.
     185cd ~/ffmpeg_sources/ffmpeg
     186make distclean
     187git pull
     188}}}
     189Then run `./configure`, `make`, and `make install` as shown in the [#FFmpeg Install FFmpeg] section.
     190
     191----
    167192
    168193== Reverting changes made by this guide ==
    169194{{{
    170 cd ~/ffmpeg-source/yasm-1.2.0
    171 # make uninstall
    172 cd ../x264
    173 # make uninstall
    174 cd ../lame-3.99.5
    175 # make uninstall
    176 cd ../libogg-1.3.0
    177 # make uninstall
    178 cd ../libvorbis-1.3.3
    179 # make uninstall
    180 cd ../libvorbis-1.3.3
    181 # make uninstall
    182 cd ../libvpx
    183 # make uninstall
    184 cd ../ffmpeg
    185 # make uninstall
    186 rm -rf ~/ffmpeg-source
    187 # yum erase autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig wget zlib-devel
    188 }}}
    189 
    190 {{{
    191 #!comment
    192 Todo:
    193 Change guide to local "install" (no more system install)
    194 }}}
     195rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffserver,lame,vsyasm,x264,yasm,ytasm}
     196# yum erase autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
     197hash -r
     198}}}
     199
     200----
     201
     202== If You Need Help ==
     203Feel free to ask your questions at the #ffmpeg IRC channel or the [http://ffmpeg.org/contact.html ffmpeg-user] mailing list.
     204
     205----
     206
     207== Also See ==
     208* [[x264EncodingGuide|x264 Encoding Guide]]
     209* [[AACEncodingGuide|AAC Encoding Guide]]