Changes between Version 149 and Version 150 of CompilationGuide/Ubuntu
- Timestamp:
- May 8, 2018, 10:18:12 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CompilationGuide/Ubuntu
v149 v150 1 = Compile FFmpeg on Ubuntu, Debian, or Mint = 2 3 [[PageOutline(2, Contents)]] 1 {{{ 2 #!html 3 <h1 style="font-size: 22px;"> 4 Compile FFmpeg for Ubuntu, Debian, or Mint 5 </h1> 6 }}} 7 8 [[PageOutline(1, Contents)]] 4 9 5 10 This guide for supported releases of '''Ubuntu''', '''Debian''', and '''Linux Mint''' and will provide a local, non-system installation of FFmpeg with support for several common external encoding libraries. … … 25 30 ---- 26 31 27 == Get the Dependencies == 28 29 Get the dependencies. These are required for compiling, but you can remove them when you are done if you prefer: 30 {{{ 31 #!sh 32 apt-get update -qq && apt-get -y install \ 32 = Get the Dependencies = 33 34 These are packages required for compiling, but you can remove them when you are done if you prefer: 35 36 {{{ 37 #!sh 38 sudo apt-get update -qq && sudo apt-get -y install \ 33 39 autoconf \ 34 40 automake \ … … 39 45 libfreetype6-dev \ 40 46 libsdl2-dev \ 41 libtheora-dev \42 47 libtool \ 43 48 libva-dev \ … … 47 52 libxcb-shm0-dev \ 48 53 libxcb-xfixes0-dev \ 49 mercurial \50 54 pkg-config \ 51 55 texinfo \ … … 67 71 ---- 68 72 69 = = Compilation & Installation ==73 = Compilation & Installation = 70 74 71 75 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. … … 73 77 For each section, copy-paste the entire code-block into your shell. 74 78 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 libv orbis is not needed, skip that section and then remove `--enable-libvorbis` from the [#FFmpeg Install FFmpeg] section.79 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 libvpx is not needed, skip that section and then remove `--enable-libvpx` from the [#FFmpeg Install FFmpeg] section. 76 80 77 81 {{{ … … 80 84 }}} 81 85 82 == = NASM ===86 == NASM == 83 87 84 88 An assembler used by some libraries. … … 96 100 }}} 97 101 98 == = Yasm ===102 == Yasm == 99 103 100 104 An assembler used by some libraries. … … 120 124 }}} 121 125 122 == = libx264 ===126 == libx264 == 123 127 124 128 H.264 video encoder. See the [[Encode/H.264|H.264 Encoding Guide]] for more information and usage examples. … … 145 149 }}} 146 150 147 == = libx265 ===151 == libx265 == 148 152 149 153 H.265/HEVC video encoder. See the [[Encode/H.265|H.265 Encoding Guide]] for more information and usage examples. … … 160 164 {{{ 161 165 #!sh 166 sudo apt-get install mercurial && \ 162 167 cd ~/ffmpeg_sources && \ 163 168 if cd x265 2> /dev/null; then hg pull && hg update; else hg clone https://bitbucket.org/multicoreware/x265; fi && \ 164 169 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 anddecoder. See the [[Encode/VP9|VP9 Video Encoding Guide]] for more information and usage examples.170 PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED=off ../../source && \ 171 PATH="$HOME/bin:$PATH" make && \ 172 make install 173 }}} 174 175 == libvpx == 176 177 VP8/VP9 video encoder/decoder. See the [[Encode/VP9|VP9 Video Encoding Guide]] for more information and usage examples. 173 178 174 179 Requires `ffmpeg` to be configured with `--enable-libvpx`. … … 193 198 }}} 194 199 195 == = libfdk-aac ===200 == libfdk-aac == 196 201 197 202 AAC audio encoder. See the [[Encode/AAC|AAC Audio Encoding Guide]] for more information and usage examples. … … 219 224 }}} 220 225 221 == = libmp3lame ===226 == libmp3lame == 222 227 223 228 MP3 audio encoder. … … 245 250 }}} 246 251 247 == = libopus ===252 == libopus == 248 253 249 254 Opus audio decoder and encoder. … … 271 276 }}} 272 277 273 === FFmpeg === 278 == libaom == 279 280 AV1 video encoder/decoder: 281 282 {{{ 283 #!sh 284 cd ~/ffmpeg_sources && \ 285 git -C aom pull 2> /dev/null || git clone --depth 1 https://aomedia.googlesource.com/aom && \ 286 mkdir aom_build && \ 287 cd aom_build && \ 288 PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED=off -DENABLE_NASM=on ../aom && \ 289 PATH="$HOME/bin:$PATH" make && \ 290 make install 291 }}} 292 293 == FFmpeg == 274 294 275 295 {{{ … … 287 307 --bindir="$HOME/bin" \ 288 308 --enable-gpl \ 309 --enable-libaom \ 289 310 --enable-libass \ 290 311 --enable-libfdk-aac \ … … 292 313 --enable-libmp3lame \ 293 314 --enable-libopus \ 294 --enable-libtheora \295 315 --enable-libvorbis \ 296 316 --enable-libvpx \ … … 303 323 }}} 304 324 305 Compilation is now complete and `ffmpeg` (also `ffplay`, `ffprobe`, `lame`, `x264`, & `x265`) should now be ready to use. The rest of this guide shows how to update or remove FFmpeg. 306 307 === Usage === 308 309 There are several methods to use your new `ffmpeg`. 310 311 * Navigate to `~/bin` and execute the binary: `cd ~/bin && ./ffmpeg -i ~/input.mp4 ~/videos/output.mkv` (notice the `./`) 312 * Or use the full path to the binary: `~/bin/ffmpeg -i ../input.mp4 ../videos/output.mkv` 313 314 If you want the `ffmpeg` command to just work from anywhere: 315 316 * Log in and log out 317 * Or run `source ~/.profile` 318 319 {{{ 320 #!div style="border: 1px solid #e5e5c7; margin: 1em; background-color: #ffd;" 321 '''Note:''' `~/bin` is included in the vanilla Ubuntu `$PATH` by default (via the `~/.profile` file), ''but only when the `~/bin` directory actually exists''. This is why you must log out then log in or run `source ~/.profile` if you just created `~/bin`. See [https://help.ubuntu.com/community/EnvironmentVariables#Persistent_environment_variables Ubuntu Wiki: Persistent Environment Variables] for more info. 322 }}} 323 324 === Documentation === 325 Now re-login or run the following command for your current shell session to recognize the new `ffmpeg` location: 326 327 {{{ 328 source ~/.profile 329 }}} 330 331 '''Compilation and installation are now complete''' and `ffmpeg` (also `ffplay`, `ffprobe`, `lame`, `x264`, & `x265`) should now be ready to use. The rest of this guide shows how to update or remove FFmpeg. 332 333 334 == Usage == 335 336 You can now open a terminal, enter the `ffmpeg` command, and it should execute your new `ffmpeg`. 337 338 If you need multiple users on the same system to have access to your new `ffmpeg`, and not just the user that compiled it, then move or copy the `ffmpeg` binary from `~/bin` to `/usr/local/bin`. 339 340 == Documentation == 325 341 326 342 If you want to run `man ffmpeg` to have local access to the documentation: … … 331 347 }}} 332 348 333 You may thenhave to log out and then log in for `man ffmpeg` to work.349 You may have to log out and then log in for `man ffmpeg` to work. 334 350 335 351 HTML formatted documentation is available in `~/ffmpeg_build/share/doc/ffmpeg`. … … 339 355 ---- 340 356 341 = = Updating FFmpeg ==#update357 = Updating FFmpeg =#update 342 358 343 359 Development of FFmpeg is active and an occasional update can give you new features and bug fixes. First you need to delete (or move) the old files: … … 352 368 ---- 353 369 354 = = Reverting Changes made by this Guide ==370 = Reverting Changes made by this Guide = 355 371 356 372 Remove the build and source files as well as the binaries: … … 367 383 {{{ 368 384 #!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 370 }}} 371 372 ---- 373 374 == If You Need Help == 385 sudo apt-get autoremove autoconf automake build-essential cmake git libass-dev libfreetype6-dev libmp3lame-dev libopus-dev libsdl2-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 386 }}} 387 388 ---- 389 390 = FAQ = 391 392 == Why install to `~/bin`? == 393 394 * Avoids installing files into any system directories. 395 * Avoids interfering with the package management system. 396 * Avoids conflicts with the '''ffmpeg''' package from the repository. 397 * Super simple to [#RevertingChangesmadebythisGuide uninstall]. 398 * Does not necessarily require sudo or root: useful for shared server users as long as they have the required dependencies available. 399 * `~/bin` is already in the vanilla Ubuntu `PATH` (see `~/.profile`). 400 * User is free to move `ffmpeg` to any other desired location (such as `/usr/local/bin`). 401 402 == Why are the commands in this guide so complicated? == 403 404 It is to make compiling easy and convenient for the user. This guide: 405 406 * Confines everything to the user's home directory (see the previous FAQ question above). 407 * Is intended to be usable on all currently supported versions of Debian and Ubuntu. 408 * Allows the user to choose if they want to compile certain libraries (latest and greatest) or to simply install the version from their repository (fast and easy but older). 409 410 This results in some various additional commands and configurations instead of the typical and simple `./configure`, `make`, `make install`. 411 412 == make[1]: Nothing to be done for 'all'/'install' == 413 414 This is message from libvpx that occasionally makes users think something went wrong. You can ignore this message. It just means `make` is finished doing its work. 415 416 ---- 417 418 = If You Need Help = 375 419 376 420 Feel free to ask your questions at the #ffmpeg IRC channel or the [https://ffmpeg.org/contact.html ffmpeg-user] mailing list. … … 378 422 ---- 379 423 380 = = Also See ==424 = Also See = 381 425 * [[CompilationGuide/Generic|Generic FFmpeg Compilation Guide]] 382 426 * [[Encode/H.264|H.264 Video Encoding Guide]]
