Changes between Version 149 and Version 150 of CompilationGuide/Ubuntu


Ignore:
Timestamp:
May 9, 2018, 1:18:12 AM (2 weeks ago)
Author:
llogan
Comment:

added libaom. added FAQ. re-organized. dump obsolete theora.

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;"> 
     4Compile FFmpeg for Ubuntu, Debian, or Mint 
     5</h1> 
     6}}} 
     7 
     8[[PageOutline(1, Contents)]] 
    49 
    510This 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. 
     
    2530---- 
    2631 
    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 
     34These are packages required for compiling, but you can remove them when you are done if you prefer: 
     35 
     36{{{ 
     37#!sh 
     38sudo apt-get update -qq && sudo apt-get -y install \ 
    3339  autoconf \ 
    3440  automake \ 
     
    3945  libfreetype6-dev \ 
    4046  libsdl2-dev \ 
    41   libtheora-dev \ 
    4247  libtool \ 
    4348  libva-dev \ 
     
    4752  libxcb-shm0-dev \ 
    4853  libxcb-xfixes0-dev \ 
    49   mercurial \ 
    5054  pkg-config \ 
    5155  texinfo \ 
     
    6771---- 
    6872 
    69 == Compilation & Installation == 
     73= Compilation & Installation = 
    7074 
    7175This 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. 
     
    7377For each section, copy-paste the entire code-block into your shell. 
    7478 
    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. 
     79If 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. 
    7680 
    7781{{{ 
     
    8084}}} 
    8185 
    82 === NASM === 
     86== NASM == 
    8387 
    8488An assembler used by some libraries. 
     
    96100}}} 
    97101 
    98 === Yasm === 
     102== Yasm == 
    99103 
    100104An assembler used by some libraries. 
     
    120124}}} 
    121125 
    122 === libx264 === 
     126== libx264 == 
    123127 
    124128H.264 video encoder. See the [[Encode/H.264|H.264 Encoding Guide]] for more information and usage examples. 
     
    145149}}} 
    146150 
    147 === libx265 === 
     151== libx265 == 
    148152 
    149153H.265/HEVC video encoder. See the [[Encode/H.265|H.265 Encoding Guide]] for more information and usage examples. 
     
    160164{{{ 
    161165#!sh 
     166sudo apt-get install mercurial && \ 
    162167cd ~/ffmpeg_sources && \ 
    163168if cd x265 2> /dev/null; then hg pull && hg update; else hg clone https://bitbucket.org/multicoreware/x265; fi && \ 
    164169cd 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. 
     170PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED=off ../../source && \ 
     171PATH="$HOME/bin:$PATH" make && \ 
     172make install 
     173}}} 
     174 
     175== libvpx == 
     176 
     177VP8/VP9 video encoder/decoder. See the [[Encode/VP9|VP9 Video Encoding Guide]] for more information and usage examples. 
    173178 
    174179Requires `ffmpeg` to be configured with `--enable-libvpx`. 
     
    193198}}} 
    194199 
    195 === libfdk-aac === 
     200== libfdk-aac == 
    196201 
    197202AAC audio encoder. See the [[Encode/AAC|AAC Audio Encoding Guide]] for more information and usage examples. 
     
    219224}}} 
    220225 
    221 === libmp3lame === 
     226== libmp3lame == 
    222227 
    223228MP3 audio encoder. 
     
    245250}}} 
    246251 
    247 === libopus === 
     252== libopus == 
    248253 
    249254Opus audio decoder and encoder. 
     
    271276}}} 
    272277 
    273 === FFmpeg === 
     278== libaom == 
     279 
     280AV1 video encoder/decoder: 
     281 
     282{{{ 
     283#!sh 
     284cd ~/ffmpeg_sources && \ 
     285git -C aom pull 2> /dev/null || git clone --depth 1 https://aomedia.googlesource.com/aom && \ 
     286mkdir aom_build && \ 
     287cd aom_build && \ 
     288PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED=off -DENABLE_NASM=on ../aom && \ 
     289PATH="$HOME/bin:$PATH" make && \ 
     290make install 
     291}}} 
     292 
     293== FFmpeg == 
    274294 
    275295{{{ 
     
    287307  --bindir="$HOME/bin" \ 
    288308  --enable-gpl \ 
     309  --enable-libaom \ 
    289310  --enable-libass \ 
    290311  --enable-libfdk-aac \ 
     
    292313  --enable-libmp3lame \ 
    293314  --enable-libopus \ 
    294   --enable-libtheora \ 
    295315  --enable-libvorbis \ 
    296316  --enable-libvpx \ 
     
    303323}}} 
    304324 
    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 === 
     325Now re-login or run the following command for your current shell session to recognize the new `ffmpeg` location: 
     326 
     327{{{ 
     328source ~/.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 
     336You can now open a terminal, enter the `ffmpeg` command, and it should execute your new `ffmpeg`. 
     337 
     338If 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 == 
    325341 
    326342If you want to run `man ffmpeg` to have local access to the documentation: 
     
    331347}}} 
    332348 
    333 You may then have to log out and then log in for `man ffmpeg` to work. 
     349You may have to log out and then log in for `man ffmpeg` to work. 
    334350 
    335351HTML formatted documentation is available in `~/ffmpeg_build/share/doc/ffmpeg`. 
     
    339355---- 
    340356 
    341 == Updating FFmpeg ==#update 
     357= Updating FFmpeg =#update 
    342358 
    343359Development 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: 
     
    352368---- 
    353369 
    354 == Reverting Changes made by this Guide == 
     370= Reverting Changes made by this Guide = 
    355371 
    356372Remove the build and source files as well as the binaries: 
     
    367383{{{ 
    368384#!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 == 
     385sudo 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 
     404It 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 
     410This 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 
     414This 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 = 
    375419 
    376420Feel free to ask your questions at the #ffmpeg IRC channel or the [https://ffmpeg.org/contact.html ffmpeg-user] mailing list. 
     
    378422---- 
    379423 
    380 == Also See == 
     424= Also See = 
    381425* [[CompilationGuide/Generic|Generic FFmpeg Compilation Guide]] 
    382426* [[Encode/H.264|H.264 Video Encoding Guide]]