Changes between Version 142 and Version 143 of CompilationGuide/Ubuntu
- Timestamp:
- Nov 8, 2017, 4:09:50 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CompilationGuide/Ubuntu
v142 v143 30 30 {{{ 31 31 #!sh 32 sudo apt-get update -qq && apt-get -y install autoconf automake build-essential git libass-dev libfreetype6-dev \ 33 libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \ 34 libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev 32 apt-get update -qq && apt-get -y install \ 33 autoconf \ 34 automake \ 35 build-essential \ 36 cmake \ 37 git \ 38 libass-dev \ 39 libfreetype6-dev \ 40 libsdl2-dev \ 41 libtheora-dev \ 42 libtool \ 43 libva-dev \ 44 libvdpau-dev \ 45 libvorbis-dev \ 46 libxcb1-dev \ 47 libxcb-shm0-dev \ 48 libxcb-xfixes0-dev \ 49 mercurial \ 50 pkg-config \ 51 texinfo \ 52 wget \ 53 zlib1g-dev 35 54 }}} 36 55 … … 43 62 {{{ 44 63 #!sh 45 mkdir ~/ffmpeg_sources ~/bin64 mkdir -p ~/ffmpeg_sources ~/bin 46 65 }}} 47 66 … … 50 69 == Compilation & Installation == 51 70 71 This guide assumes that you want to install some of the most common third-party libraries. Each section provides you with the commands needed to install that library. 72 73 For each section, copy-paste the entire code-block into your shell. 74 75 If you do not require certain features, you may skip the relevant section (if it is not required) and then remove the appropriate `./configure` option in FFmpeg. For example, if libvorbis is not needed, skip that section and then remove `--enable-libvorbis` from the [#FFmpeg Install FFmpeg] section. 76 52 77 {{{ 53 78 #!div style="border: 1px solid #c7e5c7; margin: 1em; background-color: #ddffdd;" 54 '''Tip:''' 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.79 '''Tip:''' To significantly speed up the compilation process on systems with multiple cores, you can type `MAKEFLAGS="-j4"` into your shell before executing the below commands. 55 80 }}} 56 81 … … 61 86 {{{ 62 87 #!sh 63 cd ~/ffmpeg_sources 64 wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.bz2 65 tar xjvf nasm-2.13.01.tar.bz2 66 cd nasm-2.13.01 67 ./autogen.sh 68 PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" 69 make 88 cd ~/ffmpeg_sources && \ 89 wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.bz2 && \ 90 tar xjvf nasm-2.13.01.tar.bz2 && \ 91 cd nasm-2.13.01 && \ 92 ./autogen.sh && \ 93 PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ 94 make && \ 70 95 make install 71 96 }}} … … 86 111 {{{ 87 112 #!sh 88 cd ~/ffmpeg_sources 89 wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz90 tar xzvf yasm-1.3.0.tar.gz 91 cd yasm-1.3.0 92 ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" 93 make 113 cd ~/ffmpeg_sources && \ 114 wget -O yasm-1.3.0.tar.gz http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ 115 tar xzvf yasm-1.3.0.tar.gz && \ 116 cd yasm-1.3.0 && \ 117 ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ 118 make && \ 94 119 make install 95 120 }}} … … 112 137 {{{ 113 138 #!sh 114 cd ~/ffmpeg_sources 115 git clone --depth 1 http://git.videolan.org/git/x264116 cd x264 117 PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static 118 PATH="$HOME/bin:$PATH" make 139 cd ~/ffmpeg_sources && \ 140 git -C x264 pull 2> /dev/null || git clone --depth 1 http://git.videolan.org/git/x264 && \ 141 cd x264 && \ 142 PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static && \ 143 PATH="$HOME/bin:$PATH" make && \ 119 144 make install 120 145 }}} … … 135 160 {{{ 136 161 #!sh 137 sudo apt-get install -y cmake mercurial 138 cd ~/ffmpeg_sources 139 hg clone https://bitbucket.org/multicoreware/x265 140 cd ~/ffmpeg_sources/x265/build/linux 141 PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source 142 PATH="$HOME/bin:$PATH" make 162 cd ~/ffmpeg_sources && \ 163 if cd x265 2> /dev/null; then hg pull && hg update; else hg clone https://bitbucket.org/multicoreware/x265; fi && \ 164 cd x265/build/linux && \ 165 PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source && \ 166 PATH="$HOME/bin:$PATH" make && \ 167 make install 168 }}} 169 170 === libvpx === 171 172 VP8/VP9 video encoder and decoder. See the [[Encode/VP9|VP9 Video Encoding Guide]] for more information and usage examples. 173 174 Requires `ffmpeg` to be configured with `--enable-libvpx`. 175 176 If your repository provides `libvpx-dev` version ≥ 0.9.7 then you can install that instead of compiling: 177 178 {{{ 179 #!sh 180 sudo apt-get install libvpx-dev 181 }}} 182 183 Otherwise you can compile: 184 185 {{{ 186 #!sh 187 cd ~/ffmpeg_sources && \ 188 git -C libvpx pull 2> /dev/null || git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ 189 cd libvpx && \ 190 PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm && \ 191 PATH="$HOME/bin:$PATH" make && \ 143 192 make install 144 193 }}} … … 161 210 {{{ 162 211 #!sh 163 cd ~/ffmpeg_sources 164 git clone --depth 1 https://github.com/mstorsjo/fdk-aac165 cd fdk-aac 166 autoreconf -fiv 167 ./configure --prefix="$HOME/ffmpeg_build" --disable-shared 168 make 212 cd ~/ffmpeg_sources && \ 213 git -C fdk-aac pull 2> /dev/null || git clone --depth 1 https://github.com/mstorsjo/fdk-aac && \ 214 cd fdk-aac && \ 215 autoreconf -fiv && \ 216 ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && \ 217 make && \ 169 218 make install 170 219 }}} … … 187 236 {{{ 188 237 #!sh 189 cd ~/ffmpeg_sources 190 wget http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz191 tar xzvf lame-3.100.tar.gz 192 cd lame-3.100 193 PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm 194 PATH="$HOME/bin:$PATH" make 238 cd ~/ffmpeg_sources && \ 239 wget -O lame-3.100.tar.gz http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz && \ 240 tar xzvf lame-3.100.tar.gz && \ 241 cd lame-3.100 && \ 242 PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm && \ 243 PATH="$HOME/bin:$PATH" make && \ 195 244 make install 196 245 }}} … … 213 262 {{{ 214 263 #!sh 215 cd ~/ffmpeg_sources 216 wget https://archive.mozilla.org/pub/opus/opus-1.2.tar.gz 217 tar xzvf opus-1.2.tar.gz 218 cd opus-1.2 219 ./configure --prefix="$HOME/ffmpeg_build" --disable-shared 220 make 221 make install 222 }}} 223 224 === libvpx === 225 226 VP8/VP9 video encoder and decoder. See the [[Encode/VP9|VP9 Video Encoding Guide]] for more information and usage examples. 227 228 Requires `ffmpeg` to be configured with `--enable-libvpx`. 229 230 If your repository provides `libvpx-dev` version ≥ 0.9.7 then you can install that instead of compiling: 231 232 {{{ 233 #!sh 234 sudo apt-get install libvpx-dev 235 }}} 236 237 Otherwise you can compile: 238 239 {{{ 240 #!sh 241 cd ~/ffmpeg_sources 242 git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git 243 cd libvpx 244 PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm 245 PATH="$HOME/bin:$PATH" make 264 cd ~/ffmpeg_sources && \ 265 git -C opus pull 2> /dev/null || git clone --depth 1 https://github.com/xiph/opus.git && \ 266 cd opus && \ 267 ./autogen.sh && \ 268 ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && \ 269 make && \ 246 270 make install 247 271 }}} … … 251 275 {{{ 252 276 #!sh 253 cd ~/ffmpeg_sources 254 wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2255 tar xjvf ffmpeg-snapshot.tar.bz2 256 cd ffmpeg 277 cd ~/ffmpeg_sources && \ 278 wget -O ffmpeg-snapshot.tar.bz2 http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ 279 tar xjvf ffmpeg-snapshot.tar.bz2 && \ 280 cd ffmpeg && \ 257 281 PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \ 258 282 --prefix="$HOME/ffmpeg_build" \ … … 273 297 --enable-libx264 \ 274 298 --enable-libx265 \ 275 --enable-nonfree 276 PATH="$HOME/bin:$PATH" make 299 --enable-nonfree && \ 300 PATH="$HOME/bin:$PATH" make && \ 277 301 make install 278 302 hash -r … … 321 345 {{{ 322 346 #!sh 323 rm -rf ~/ffmpeg_build ~/ ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffplay,ffserver,x264,x265}324 }}} 325 326 Now just follow the guide from the beginning.347 rm -rf ~/ffmpeg_build ~/bin/{ffmpeg,ffprobe,ffplay,ffserver,x264,x265} 348 }}} 349 350 Now can just follow the guide from the beginning. 327 351 328 352 ---- … … 330 354 == Reverting Changes made by this Guide == 331 355 356 Remove the build and source files as well as the binaries: 357 332 358 {{{ 333 359 #!sh 334 360 rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffplay,ffserver,x264,x265,nasm,vsyasm,yasm,ytasm} 335 sudo apt-get autoremove autoconf automake build-essential cmake git libass-dev libfreetype6-dev \336 libmp3lame-dev libopus-dev libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev \337 libvorbis-dev libvpx-dev libx264-dev libxcb1-dev libxcb-shm0-dev ibxcb-xfixes0-dev mercurial texinfo zlib1g-dev338 361 sed -i '/ffmpeg_build/d' ~/.manpath 339 362 hash -r 363 }}} 364 365 You may also remove packages that have been installed from this guide: 366 367 {{{ 368 #!sh 369 sudo apt-get autoremove autoconf automake build-essential cmake git libass-dev libfreetype6-dev libmp3lame-dev libopus-dev libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libvpx-dev libx264-dev libx265-dev libxcb1-dev libxcb-shm0-dev ibxcb-xfixes0-dev mercurial texinfo wget zlib1g-dev 340 370 }}} 341 371
