Changes between Version 23 and Version 24 of CompilationGuide/Centos
- Timestamp:
- May 30, 2013, 5:18:23 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CompilationGuide/Centos
v23 v24 1 1 = Compile FFmpeg on CentOS 6.x = 2 2 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 5 This 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 == 4 10 5 11 '''Note:''' The # indicates that the command should be executed as superuser or root. 6 12 7 == Preparation ==8 Remove any existing packages:9 {{{10 # yum erase ffmpeg x264 x264-devel11 }}}12 13 13 Get the dependencies: 14 14 {{{ 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 18 Make a directory to put all of the source code into: 19 {{{ 20 mkdir ~/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 24 29 === Yasm === 25 30 Yasm is an assembler used by x264 and FFmpeg. 26 31 {{{ 27 cd ~/ffmpeg -source28 wgethttp://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz32 cd ~/ffmpeg_sources 33 curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz 29 34 tar xzvf yasm-1.2.0.tar.gz 30 35 cd yasm-1.2.0 31 ./configure 32 make 33 #make install34 }}} 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 === #x26436 ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" 37 make 38 make install 39 make distclean 40 . ~/.bash_profile 41 }}} 42 43 === x264 === 39 44 H.264 video encoder. 40 45 {{{ 41 cd ~/ffmpeg -source42 git clone git://git.videolan.org/x26446 cd ~/ffmpeg_sources 47 git clone --depth 1 git://git.videolan.org/x264 43 48 cd x264 44 ./configure --enable-static 45 make 46 # make install 49 ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static 50 make 51 make install 52 make distclean 47 53 }}} 48 54 … … 50 56 AAC audio encoder. 51 57 {{{ 52 cd ~/ffmpeg -source58 cd ~/ffmpeg_sources 53 59 git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git 54 60 cd fdk-aac 55 61 autoreconf -fiv 56 ./configure --disable-shared 57 make 58 # make install 62 ./configure --prefix="$HOME/ffmpeg_build" --disable-shared 63 make 64 make install 65 make distclean 59 66 }}} 60 67 … … 62 69 MP3 audio encoder. 63 70 {{{ 64 cd ~/ffmpeg -source65 wgethttp://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz71 cd ~/ffmpeg_sources 72 curl -L -O http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz 66 73 tar xzvf lame-3.99.5.tar.gz 67 74 cd 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 76 make 77 make install 78 make distclean 71 79 }}} 72 80 73 81 === libogg === 74 Required for libtheora and libvorbis.75 {{{ 76 cd ~/ffmpeg -source77 wgethttp://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz82 Ogg bitstream library. Required for libtheora and libvorbis. 83 {{{ 84 cd ~/ffmpeg_sources 85 curl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz 78 86 tar xzvf libogg-1.3.0.tar.gz 79 87 cd libogg-1.3.0 80 ./configure --disable-shared 81 make 82 # make install 88 ./configure --prefix="$HOME/ffmpeg_build" --disable-shared 89 make 90 make install 91 make distclean 83 92 }}} 84 93 … … 86 95 Theora video encoder. 87 96 {{{ 88 cd ~/ffmpeg -source89 wgethttp://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz97 cd ~/ffmpeg_sources 98 curl -O http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz 90 99 tar xzvf libtheora-1.1.1.tar.gz 91 100 cd 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 102 make 103 make install 104 make distclean 95 105 }}} 96 106 … … 98 108 Vorbis audio encoder. 99 109 {{{ 100 cd ~/ffmpeg -source101 wgethttp://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz110 cd ~/ffmpeg_sources 111 curl -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz 102 112 tar xzvf libvorbis-1.3.3.tar.gz 103 113 cd 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 115 make 116 make install 117 make distclean 118 }}} 119 120 === libvpx === 121 VP8/VP9 video encoder. 122 {{{ 123 cd ~/ffmpeg_sources 124 git clone --depth 1 http://git.chromium.org/webm/libvpx.git 114 125 cd 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 127 make 128 make install 129 make clean 130 }}} 131 132 === FFmpeg === 133 {{{ 134 cd ~/ffmpeg_sources 135 git clone --depth 1 git://source.ffmpeg.org/ffmpeg 124 136 cd 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 138 make 139 make install 140 make distclean 141 hash -r 142 . ~/.bash_profile 143 }}} 144 145 Compilation 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 153 Development 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 {{{ 155 rm -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 142 157 }}} 143 158 144 159 === Update x264 === 145 160 {{{ 146 cd ~/ffmpeg -source/x264161 cd ~/ffmpeg_sources/x264 147 162 make distclean 148 163 git pull … … 150 165 Then run `./configure`, `make`, and `make install` as shown in the [#x264 Install x264] section. 151 166 167 === Update libfdk_aac === 168 {{{ 169 cd ~/ffmpeg_sources/libfdk_aac 170 make distclean 171 git pull 172 }}} 173 Then run `./configure`, `make`, and `make install` as shown in the [#libfdk_aac Install libfdk_aac] section. 174 152 175 === Update libvpx === 153 176 {{{ 154 cd ~/ffmpeg -source/libvpx177 cd ~/ffmpeg_sources/libvpx 155 178 make clean 156 179 git pull … … 160 183 === Update FFmpeg === 161 184 {{{ 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. 185 cd ~/ffmpeg_sources/ffmpeg 186 make distclean 187 git pull 188 }}} 189 Then run `./configure`, `make`, and `make install` as shown in the [#FFmpeg Install FFmpeg] section. 190 191 ---- 167 192 168 193 == Reverting changes made by this guide == 169 194 {{{ 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 }}} 195 rm -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 197 hash -r 198 }}} 199 200 ---- 201 202 == If You Need Help == 203 Feel 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]]
