Changes between Version 88 and Version 89 of CompilationGuide/Ubuntu
- Timestamp:
- Feb 13, 2014, 2:59:49 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CompilationGuide/Ubuntu
v88 v89 3 3 [[PageOutline(2, Contents)]] 4 4 5 This guide for supported releases of '''Ubuntu''', '''Debian''', and '''Linux Mint''' will provide a local install of the latest FFmpeg tools and libraries including several external encoding and decoding libraries (codecs). This will not provide a "local installation" instead of a system installation and therefore will notinterfere with repository packages.5 This guide for supported releases of '''Ubuntu''', '''Debian''', and '''Linux Mint''' will provide a local install of the latest FFmpeg tools and libraries including several external encoding and decoding libraries (codecs). This will not interfere with repository packages. 6 6 7 7 You may also refer to the [[GenericCompilationGuide|Generic FFmpeg Compilation Guide]] for additional information. … … 17 17 {{{ 18 18 sudo apt-get update 19 sudo apt-get -y install autoconf automake build-essential gitlibass-dev libgpac-dev \19 sudo apt-get -y install autoconf automake build-essential libass-dev libgpac-dev \ 20 20 libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libx11-dev \ 21 21 libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev … … 24 24 25 25 {{{ 26 #!div style="border: 1pt dotted; margin: 1em" 27 * Server users can omit the ffplay and x11 dependencies: `libsdl1.2-dev libva-dev libvdpau-dev libx11-dev libxext-dev libxfixes-dev`. 28 * Ubuntu 10.04 Lucid users will need to install the `git-core` package instead of the `git` package. Lucid lacks the package `libva-dev`. This can be ignored. 29 }}} 30 31 26 #!div style="border: 1pt dotted; margin: 1em; background-color: #fffff9;" 27 * Server users can omit the `ffplay` and x11 dependencies: `libsdl1.2-dev libva-dev libvdpau-dev libx11-dev libxext-dev libxfixes-dev`. 28 * Lucid lacks the package `libva-dev`. This can be ignored. 29 }}} 32 30 33 31 ---- … … 35 33 == Compilation & Installation == 36 34 37 One advantage to compiling is that you can build ffmpeg to your liking. 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 libopus is not needed, then skip that section and then remove `--enable-libopus` from the [#ffmpeg Install FFmpeg] section. 35 You can compile `ffmpeg` to your liking. 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 libopus is not needed, then skip that section and then remove `--enable-libopus` from the [#ffmpeg Install FFmpeg] section. 36 37 This guide will create several directories in your home directory: 38 39 * `ffmpeg_sources` – Where the source files will be downloaded. 40 * `ffmpeg_build` – Where the files will be built and libraries installed. 41 * `bin` – Where the resulting binaries (`ffmpeg`, `ffplay`, `ffserver`, `x264`, and `yasm`) will be installed. 42 43 You can easily undo any of this as shown in [#RevertingChangesMadebyThisGuide Reverting Changes Made by This Guide]. 38 44 39 45 === Yasm === 40 46 41 Yasm is an assembler used by x264 and FFmpeg. 42 43 Ubuntu 13.10, Ubuntu 13.04, and Mint 15 users can alternatively install the `yasm` package from the repository instead of compiling. 47 The first step is to compile Yasm which is an assembler used by x264 and FFmpeg. Ubuntu 13.10, Ubuntu 13.04, and Mint 15 users can alternatively install the `yasm` package from the repository instead of compiling. 44 48 45 49 {{{ … … 52 56 make install 53 57 make distclean 54 . ~/.profile 58 export "PATH=$PATH:$HOME/bin" 55 59 }}} 56 60 57 61 === x264 === 58 62 59 H.264 video encoder. See the [[x264EncodingGuide|x264 Encoding Guide]] for more information and examples. 60 61 {{{ 62 cd ~/ffmpeg_sources 63 git clone --depth 1 git://git.videolan.org/x264.git 64 cd x264 63 H.264 video encoder. See the [[x264EncodingGuide|x264 Encoding Guide]] for more information and usage examples. 64 65 {{{ 66 cd ~/ffmpeg_sources 67 wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 68 tar xjvf last_x264.tar.bz2 69 cd x264-snapshot* 65 70 ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static 66 71 make … … 69 74 }}} 70 75 71 {{{72 #!div style="border: 1pt dotted; margin: 1em"73 '''Note:''' You can download the nightly [ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 x264 source snapshot] as an alternative to using `git`.74 }}}75 76 76 === fdk-aac === 77 77 78 AAC audio encoder. See the [[AACEncodingGuide|AAC Encoding Guide]] for more information and examples. 79 80 {{{ 81 cd ~/ffmpeg_sources 82 git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac 83 cd fdk-aac 78 AAC audio encoder. See the [[AACEncodingGuide|AAC Encoding Guide]] for more information and usage examples. 79 80 {{{ 81 cd ~/ffmpeg_sources 82 wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master 83 unzip fdk-aac.zip 84 cd mstorsjo-fdk-aac* 84 85 autoreconf -fiv 85 86 ./configure --prefix="$HOME/ffmpeg_build" --disable-shared … … 87 88 make install 88 89 make distclean 89 }}}90 91 {{{92 #!div style="border: 1pt dotted; margin: 1em"93 '''Note:''' You can download a [https://github.com/mstorsjo/fdk-aac/zipball/master fdk-aac source snapshot] as an alternative to using `git`.94 90 }}} 95 91 … … 122 118 Opus audio decoder and encoder. 123 119 124 Ubuntu 13.10, Ubuntu 13.04, and Mint 15 users can alternatively install the `libopus-dev` package from the repository instead of compiling.125 126 120 {{{ 127 121 cd ~/ffmpeg_sources … … 137 131 === libvpx === 138 132 139 VP8/VP9 video encoder and decoder. See the [[vpxEncodingGuide|vpx (WebM) Encoding Guide]] for more information and examples. 140 141 Ubuntu 13.10, Ubuntu 13.04, and Mint 15 users can alternatively install the `libvpx-dev` package from the repository instead of compiling. 142 143 {{{ 144 cd ~/ffmpeg_sources 145 git clone --depth 1 http://git.chromium.org/webm/libvpx.git 146 cd libvpx 133 VP8/VP9 video encoder and decoder. See the [[vpxEncodingGuide|vpx (WebM) Encoding Guide]] for more information and usage examples. 134 135 {{{ 136 cd ~/ffmpeg_sources 137 wget http://webm.googlecode.com/files/libvpx-v1.3.0.tar.bz2 138 tar xjvf libvpx-v1.3.0.tar.bz2 139 cd libvpx-v1.3.0 147 140 ./configure --prefix="$HOME/ffmpeg_build" --disable-examples 148 141 make … … 151 144 }}} 152 145 153 {{{154 #!div style="border: 1pt dotted; margin: 1em"155 '''Note:''' You can download a [http://code.google.com/p/webm/downloads/list libvpx source snapshot] as an alternative to using `git`.156 }}}157 158 146 === ffmpeg === 159 147 160 148 {{{ 161 #!div style="border: 1pt dotted; margin: 1em" 162 '''Note:''' Server users should remove `--enable-x11grab` from the following command: 163 }}} 164 165 {{{ 166 cd ~/ffmpeg_sources 167 git clone --depth 1 git://source.ffmpeg.org/ffmpeg 149 #!div style="border: 1pt dotted; margin: 1em; background-color: #fffff9;" 150 '''Note:''' Server users should remove `--enable-x11grab`. 151 }}} 152 153 {{{ 154 cd ~/ffmpeg_sources 155 wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 156 tar xjvf ffmpeg-snapshot.tar.bz2 168 157 cd ffmpeg 169 158 PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" 170 159 export PKG_CONFIG_PATH 171 ./configure --prefix="$HOME/ffmpeg_build" \160 ./configure --prefix="$HOME/ffmpeg_build" --mandir="$HOME/bin" \ 172 161 --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" \ 173 --bindir="$HOME/bin" --extra-libs= "-ldl"--enable-gpl --enable-libass --enable-libfdk-aac \162 --bindir="$HOME/bin" --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac \ 174 163 --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx \ 175 164 --enable-libx264 --enable-nonfree --enable-x11grab … … 178 167 make distclean 179 168 hash -r 169 }}} 170 171 ---- 172 173 == Conclusion == 174 175 Installation is now complete and `ffmpeg` is now ready for use. Your newly compiled FFmpeg programs are in `~/bin`. To use it: 176 177 * Navigate to `~/bin` and execute the binary: `cd ~/bin && ./ffmpeg -i ~/input.mp4 ~/videos/output.mkv` (notice the `./`) 178 * Or you can use the full path to the binary: `/home/yourusername/bin/ffmpeg -i ../input.mp4 ../videos/output.mkv` 179 * Or if you simply want to just issue the `ffmpeg` command and have your shell use your compiled binary see the Persistent Environment Variables section below. 180 181 === Persistent Environment Variables === 182 183 You can tell your shell (assuming you're using Bash) to persistantly use your new `ffmpeg` in `~/bin`. The first command will allow you to simply run `man ffmpeg` to get the FFmpeg man pages. The second command will source `~/.profile` which will add `~/bin` to your `$PATH`. In short, the following commands will allow you to simply type `ffmpeg` and `man ffmpeg` in your terminal and they will "just work": 184 185 {{{ 186 echo "MANPATH_MAP $HOME/bin $HOME/ffmpeg_build/share/man" >> ~/.manpath 180 187 . ~/.profile 181 188 }}} 182 189 183 190 {{{ 184 #!div style="border: 1pt dotted; margin: 1em" 185 '''Note:''' You can download the nightly [http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 FFmpeg source snapshot] as an alternative to using `git`. 186 }}} 187 188 ---- 189 190 == Finish == 191 192 * Installation is now complete and ffmpeg is now ready for use. See the [[x264EncodingGuide|x264 Encoding Guide]] for examples. 191 #!div style="border: 1pt dotted; margin: 1em; background-color: #fffff9;" 192 '''Note:''' 193 * This may reset custom variables in the current shell session. 194 * This assumes you are using the default `~/.profile` (and therefore `~/.bashrc`). 195 * This assumes you are using Bash shell. 196 * Sourcing the default `~/.profile` will also source `~/.bashrc`. 197 * You may have to log out and then log in for `man ffmpeg` to work. 198 * Don't worry: you can undo any of this as shown in [#RevertingChangesMadebyThisGuide Reverting Changes Made by This Guide]. 199 }}} 200 201 See [https://help.ubuntu.com/community/EnvironmentVariables#Persistent_environment_variables Ubuntu Wiki: Persistent Environment Variables] for more info. 202 203 === Additional Notes === 204 205 * See the [[x264EncodingGuide|x264 Encoding Guide]] for some encoding examples. 193 206 * If you do not see `FFmpeg developers` in your ffmpeg console output then something went wrong and you're probably using the [http://stackoverflow.com/a/9477756/1109017 fake "ffmpeg"] from the repository. 194 207 * HTML formatted documentation is available in `~/ffmpeg_build/share/doc/ffmpeg`. … … 199 212 == Updating FFmpeg ==#update 200 213 201 Development of FFmpeg is active and an occasional update can give you new features and bug fixes. First, remove (or move) the old files and then update the dependencies: 202 203 {{{ 204 rm -rf ~/ffmpeg_build ~/bin/{ffmpeg,ffprobe,ffserver,vsyasm,x264,yasm,ytasm} 205 sudo apt-get update 206 sudo apt-get -y install autoconf automake build-essential git libass-dev libgpac-dev \ 207 libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libx11-dev \ 208 libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev 209 }}} 210 211 {{{ 212 #!div style="border: 1pt dotted; margin: 1em" 213 '''Note:''' Server users can omit: `libsdl1.2-dev libva-dev libvdpau-dev libx11-dev libxext-dev libxfixes-dev`. 214 }}} 215 216 === x264 === 217 218 {{{ 219 cd ~/ffmpeg_sources/x264 220 make distclean 221 git pull 222 }}} 223 224 Now run `./configure`, `make`, and `make install` as shown in the [#x264 Install x264] section. 225 226 === fdk-aac === 227 228 {{{ 229 cd ~/ffmpeg_sources/fdk-aac 230 make distclean 231 git pull 232 }}} 233 234 Now run `./configure`, `make`, and `make install` as shown in the [#fdk-aac Install fdk-aac] section. 235 236 === libvpx === 237 238 {{{ 239 cd ~/ffmpeg_sources/libvpx 240 make clean 241 git pull 242 }}} 243 244 Now run `./configure`, `make`, and `make install` as shown in the [#libvpx Install libvpx] section. 245 246 === ffmpeg === 247 248 {{{ 249 cd ~/ffmpeg_sources/ffmpeg 250 make distclean 251 git pull 252 }}} 253 254 Now run `./configure`, `make`, and `make install` as shown in the [#ffmpeg Install FFmpeg] section. 214 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: 215 216 {{{ 217 rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffserver,vsyasm,x264,yasm,ytasm} 218 }}} 219 220 Now just follow the guide from the beginning. 255 221 256 222 ---- … … 258 224 == Reverting Changes Made by This Guide == 259 225 260 To remove ffmpeg, x264, and dependencies installed for this guide:261 226 {{{ 262 227 rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffserver,vsyasm,x264,yasm,ytasm} 263 sudo apt-get autoremove autoconf automake build-essential gitlibass-dev libgpac-dev \228 sudo apt-get autoremove autoconf automake build-essential libass-dev libgpac-dev \ 264 229 libmp3lame-dev libopus-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev \ 265 230 libvorbis-dev libvpx-dev libx11-dev libxext-dev libxfixes-dev texi2html zlib1g-dev 231 sed -i '/ffmpeg_build/c\' ~/.manpath 266 232 hash -r 267 233 }}} … … 279 245 * [[x264EncodingGuide|x264 Encoding Guide]] 280 246 * [[AACEncodingGuide|AAC Encoding Guide]] 281 282 {{{#!comment283 * Make man pages actually work284 * Make datadir location (the presets, etc) less useless285 }}}
