├── LICENSE ├── README.md └── build_static_ffmpeg_centos-debian.sh /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ffmpeg-libvpx-HDR-static 2 | A script to build a static binary of FFmpeg optimised for libvpx (HDR 10bit) encoding. 3 | 4 | As part of some work producing some developer documentation for the webm team at Google we came to the conclusion that getting a stable, known build of FFmpeg with libvpx in place was non-trivial. 5 | 6 | This script was developed on a GCP Centos7 n1-standard-4 Virtual Machine. It was then modified to support debian too, and run on a a GCP Debian n4-standard-4 VM. 7 | 8 | By default it grabs a recent, defined and stable release of FFmpeg and libvpx, and the latest releases of many of the other elements that are useful in decoding a source video. The script can be modified at the top to force it to compile the very latest (or any other specified) version of FFmpeg or libvpx. See the comments in the script for more information on this. 9 | 10 | It builds a standalone static version of ffmpeg optimised for your chipset and for 10-bit HDR encoding with libvpx. 11 | 12 | This ffmpeg can be distributed to other machines of similar architecture, and simply executed. 13 | 14 | It has been tested on Centos 7 and Ubuntu 16.04, and on Debian 9 Linux variants. Please let us know if you have success with it on other architectures. 15 | 16 | # Execution 17 | 18 | This has been tested on Centos7 and Debian GNU/Linux 9 (stretch) 19 | 20 | ```{r, engine='bash', count_lines} 21 | $ curl https://raw.githubusercontent.com/id3as/ffmpeg-libvpx-HDR-static/master/build_static_ffmpeg_centos-debian.sh > ffmpeg-build-script.sh 22 | $ chmod 766 ffmpeg-build-script.sh 23 | $ ./ffmpeg-build-script.sh 24 | ``` 25 | 26 | Takes about 25 mins to build on the tested machines. 27 | 28 | On many architectures you can replace the last line with this to make the build considerably faster: 29 | 30 | ```{r, engine='bash', count_lines} 31 | MAKEOPTS=-j4 ffmpeg-build-script.sh 32 | ``` 33 | But we don't consider that to be tested widely enough to clearly define which environments will universally support it. Might be worth a test on your own architecture. 34 | 35 | # About 36 | 37 | While the script should ‘just work’ and is offered ‘as-is’ and unsupported to the community the team at [www.id3as.co.uk](www.id3as.co.uk) will be monitoring GitHub and if we can help with any issues we will try to find some time to improve the script, so please do feed back on GitHub. 38 | 39 | [![image alt text](https://static.wixstatic.com/media/b1006e_f523c081c6f448dd91e45e46eea54a86~mv2.png?dn=Screen+Shot+2018-01-17+at+10.25.15.png)](http://id3as.co.uk/active) 40 | 41 | -------------------------------------------------------------------------------- /build_static_ffmpeg_centos-debian.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # component revisions to check out: 6 | vpx_rev="HEAD" 7 | x264_rev="HEAD" 8 | x265_rev="tip" 9 | fdk_aac_rev="HEAD" 10 | ffmpeg_rev="HEAD" 11 | # each will be set to the actual commit sha (git describe --abbrev) 12 | 13 | 14 | while (( $# > 0 )); do 15 | case $1 in 16 | --vpx-rev) 17 | vpx_rev=$2 18 | shift; shift;; 19 | --x264-rev) 20 | x264_rev=$2 21 | shift; shift;; 22 | --fdk_aac-rev) 23 | fdk_aac_rev=$2 24 | shift; shift;; 25 | --x265-rev) 26 | x265_rev=$2 27 | shift; shift;; 28 | --ffmpeg-rev) 29 | ffmpeg_rev=$2 30 | shift; shift;; 31 | --help) 32 | echo " 33 | Build a static executable of ffmpeg, pulling the latest (or specific) revisions of 34 | x264, x265, fdk_aac, vpx. Revisions (see revisions(7), hg()) can be specified with: 35 | 36 | --vpx-rev REV 37 | --x264-rev REV 38 | --x265-rev REV 39 | --fdk_aac-rev REV 40 | --ffmpeg-rev REV 41 | " 42 | exit 0 43 | ;; 44 | esac 45 | done 46 | 47 | echo " 48 | Building ffmpeg with components at revisions: 49 | 50 | libvpx: $vpx_rev 51 | x264: $x264_rev 52 | x265: $x265_rev 53 | fdk_aac: $fdk_aac_rev 54 | ffmpeg: $ffmpeg_rev 55 | " 56 | 57 | 58 | PREFIX="$(pwd)/ffmpeg_build" 59 | PATH=$HOME/bin:$PATH 60 | 61 | common_config_options="--enable-static --disable-shared" 62 | 63 | # this needs to be exported for opus.pc to be found. No idea why. 64 | export CFLAGS="$CFLAGS -fPIC" CXXFLAGS="$CFLAGS" 65 | export LDFLAGS="$LDFLAGS -L$PREFIX/lib" 66 | export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" 67 | 68 | mkdir -p ffmpeg_sources ffmpeg_build ~/bin 69 | 70 | 71 | function do_yum { 72 | sudo -nl yum 2&>1 >/dev/null || { echo " 73 | This script needs to run \`sudo yum\`. 74 | One way to enable the user running this script to do this is by adding a file in /etc/sudoers.d/ with the following contents: 75 | 76 | Cmnd_Alias PKG_MANAGERS = /bin/yum 77 | `whoami` ALL=(ALL) NOPASSWD: PKG_MANAGERS 78 | 79 | "; exit 1; } 80 | 81 | sudo -n yum -y update 82 | sudo -n yum -y upgrade 83 | 84 | sudo -n yum install -y \ 85 | epel-release 86 | 87 | sudo -n yum remove -y \ 88 | nasm yasm # these are too old wrt ffmpeg requirements: we will have to build them from sources 89 | 90 | sudo -n yum install -y \ 91 | autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel \ 92 | libass-devel \ 93 | SDL SDL-devel \ 94 | libva-devel \ 95 | libvdpau-devel \ 96 | libxcb-devel \ 97 | libXfixes-devel 98 | } 99 | 100 | function do_apt { 101 | sudo -nl apt-get 2&>1 >/dev/null || { echo " 102 | This script needs to run \`sudo apt-get\`. 103 | One way to enable the user running this script to do this is by adding a file in /etc/sudoers.d/ with the following contents: 104 | 105 | Cmnd_Alias PKG_MANAGERS = /usr/bin/apt-get 106 | $(whoami) ALL=(ALL) NOPASSWD: PKG_MANAGERS 107 | 108 | (Do \`apt-get install sudo\` if necessay.) 109 | "; exit 1; } 110 | 111 | sudo -n apt-get update -y 112 | sudo -n apt-get upgrade -y 113 | 114 | sudo -n apt-get remove -y \ 115 | nasm yasm # these are too old wrt ffmpeg requirements: we will have to build them from sources 116 | 117 | sudo -n apt-get install -y \ 118 | autoconf automake build-essential libtool pkg-config texinfo cmake git mercurial curl \ 119 | libass-dev \ 120 | libfreetype6-dev \ 121 | libsdl2-dev \ 122 | libtheora-dev \ 123 | libva-dev \ 124 | libvdpau-dev \ 125 | libvorbis-dev \ 126 | libxcb1-dev \ 127 | libxcb-shm0-dev \ 128 | libxcb-xfixes0-dev \ 129 | zlib1g-dev 130 | } 131 | 132 | 133 | 134 | 135 | function install_yasm { 136 | local s=yasm-1.3.0 137 | local t=$s.tar.gz 138 | 139 | (cd ffmpeg_sources 140 | curl -O -L http://www.tortall.net/projects/yasm/releases/$t 141 | tar xzf $t 142 | (cd $s 143 | ./configure --prefix="$PREFIX" --bindir="$HOME/bin" 144 | make 145 | make install) 146 | rm -rf $s) 147 | } 148 | 149 | function install_nasm { 150 | local s=nasm-2.13.02 151 | local t=$s.tar.bz2 152 | 153 | (cd ffmpeg_sources 154 | curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/$t 155 | tar xjf $t 156 | (cd $s 157 | ./autogen.sh 158 | ./configure --prefix="$PREFIX" --bindir="$HOME/bin" 159 | make 160 | make install) 161 | rm -rf $s) 162 | } 163 | 164 | 165 | function is_version_ok { 166 | (IFS="." 167 | local v=($1) req=($2) 168 | if (( ${v[0]} < ${req[0]} )); then false; else 169 | if (( ${v[0]} > ${req[0]} )); then true; else 170 | if (( ${v[1]} < ${req[1]} )); then false; else 171 | if (( ${v[1]} > ${req[1]} )); then true; else 172 | if test -n "${v[2]}" && (( ${v[2]} < ${req[2]} )); then false; else 173 | true 174 | fi 175 | fi 176 | fi 177 | fi 178 | fi) 179 | } 180 | 181 | 182 | function check_yasm { 183 | if which yasm >/dev/null 2>&1; then 184 | local v=$(yasm --version | awk '/^yasm / { print $2 }') 185 | if is_version_ok "$v" "1.3.0"; then 186 | echo "found yasm version $v" 187 | else 188 | echo "found yasm version $v, which is too old" 189 | false 190 | fi 191 | else 192 | echo "yasm not found" 193 | false 194 | fi 195 | } 196 | 197 | function check_nasm { 198 | if which nasm >/dev/null 2>&1; then 199 | local v=$(nasm --version | awk '/^NASM / { print $3 }') 200 | if is_version_ok "$v" "2.13.0"; then 201 | echo "found nasm version $v" 202 | else 203 | echo "found nasm version $v, which is too old" 204 | false 205 | fi 206 | else 207 | echo "nasm not found" 208 | false 209 | fi 210 | } 211 | 212 | 213 | function check_lame { 214 | if which lame >/dev/null 2>&1; then 215 | local v=$(lame --version | awk '/^LAME / { print $4 }') 216 | if is_version_ok "$v" "3.100"; then 217 | echo "found lame version $v" 218 | else 219 | echo "found lame version $v, which is too old" 220 | false 221 | fi 222 | else 223 | echo "lame not found" 224 | false 225 | fi 226 | } 227 | 228 | function check_opus { 229 | local v=$(pkg-config --modversion opus) 230 | if test -n "$v"; then 231 | if is_version_ok "$v" "1.2.1"; then 232 | echo "found opus version $v" 233 | else 234 | echo "found opus version $v, which is too old" 235 | false 236 | fi 237 | else 238 | echo "opus not found" 239 | false 240 | fi 241 | } 242 | 243 | function check_libogg { 244 | local v=$(pkg-config --modversion ogg) 245 | if test -n "$v"; then 246 | if is_version_ok "$v" "1.3.3"; then 247 | echo "found ogg version $v" 248 | else 249 | echo "found ogg version $v, which is too old" 250 | false 251 | fi 252 | else 253 | echo "ogg not found" 254 | false 255 | fi 256 | } 257 | 258 | function check_libvorbis { 259 | local v=$(pkg-config --modversion vorbis) 260 | if test -n "$v"; then 261 | if is_version_ok "$v" "1.3.5"; then 262 | echo "found vorbis version $v" 263 | else 264 | echo "found vorbis version $v, which is too old" 265 | false 266 | fi 267 | else 268 | echo "vorbis not found" 269 | false 270 | fi 271 | } 272 | 273 | 274 | 275 | 276 | function build_lame { 277 | echo " 278 | - - - - lame" 279 | 280 | if check_lame; then 281 | true 282 | else 283 | local s="lame-3.100" 284 | local t=$s.tar.gz 285 | 286 | (cd ffmpeg_sources 287 | test -r "$t" || curl -O -L http://downloads.sourceforge.net/project/lame/lame/3.100/$t 288 | test -d $s || tar xzf $t 289 | (cd $s 290 | ./configure --prefix="$PREFIX" --bindir="$HOME/bin" --enable-nasm $common_config_options 291 | make $MAKEOPTS 292 | make install) 293 | rm -rf $s) 294 | fi 295 | } 296 | 297 | 298 | function build_opus { 299 | echo " 300 | - - - - opus" 301 | 302 | if check_opus; then 303 | true 304 | else 305 | local s="opus-1.2.1" 306 | local t=$s.tar.gz 307 | 308 | (cd ffmpeg_sources 309 | test -r "$t" || curl -O -L https://archive.mozilla.org/pub/opus/$t 310 | test -d $s || tar xzf $t 311 | (cd $s 312 | ./configure --prefix="$PREFIX" $common_config_options 313 | make $MAKEOPTS 314 | make install) 315 | rm -rf $s) 316 | fi 317 | } 318 | 319 | function build_libogg { 320 | echo " 321 | - - - - libogg" 322 | 323 | if check_libogg; then 324 | true 325 | else 326 | local s="libogg-1.3.3" 327 | local t=$s.tar.gz 328 | 329 | (cd ffmpeg_sources 330 | test -r "$t" || curl -O -L http://downloads.xiph.org/releases/ogg/$t 331 | test -d $s || tar xzf $t 332 | (cd $s 333 | ./configure --prefix="$PREFIX" --bindir="$HOME/bin" $common_config_options 334 | make $MAKEOPTS 335 | make install) 336 | rm -rf $s) 337 | fi 338 | } 339 | 340 | function build_libvorbis { 341 | echo " 342 | - - - - libvorbis" 343 | 344 | if check_libvorbis; then 345 | true 346 | else 347 | local s="libvorbis-1.3.5" 348 | local t=$s.tar.gz 349 | 350 | (cd ffmpeg_sources 351 | test -r "$t" || curl -O -L http://downloads.xiph.org/releases/vorbis/$t 352 | test -d $s || tar xzf $t 353 | (cd $s 354 | ./configure --prefix="$PREFIX" --bindir="$HOME/bin" $common_config_options 355 | make $MAKEOPTS 356 | make install) 357 | rm -rf $s) 358 | fi 359 | } 360 | 361 | 362 | ## pull specific versions for the builds below 363 | 364 | function build_x264 { 365 | echo " 366 | - - - - x264" 367 | local d=x264 368 | 369 | cd ffmpeg_sources 370 | if test -d $d; then 371 | cd $d 372 | git pull 373 | make distclean || : 374 | else 375 | git clone https://code.videolan.org/videolan/x264.git 376 | cd $d 377 | fi 378 | 379 | git checkout "$x264_rev" || return 1 380 | export x264_rev=$(git describe --always --abbrev HEAD) 381 | 382 | ./configure --prefix="$PREFIX" --bindir="$HOME/bin" --disable-cli --enable-pic $common_config_options 383 | make $MAKEOPTS && make install && cd ../.. 384 | } 385 | 386 | 387 | function build_x265 { 388 | echo " 389 | - - - - x265" 390 | local d=x265 391 | 392 | cd ffmpeg_sources 393 | if test -d $d; then 394 | cd $d 395 | rm -rf build/linux/* 396 | else 397 | hg clone https://bitbucket.org/multicoreware/x265 398 | cd $d 399 | fi 400 | 401 | hg update -r "$x265_rev" 402 | export x265_rev=$(hg id --id) 403 | 404 | cd build/linux 405 | cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$PREFIX" -DENABLE_SHARED:bool=off ../../source 406 | make $MAKEOPTS && make install && mv $PREFIX/bin/x265 $HOME/bin && rmdir $PREFIX/bin && cd ../../.. 407 | } 408 | 409 | 410 | function build_fdk { 411 | echo " 412 | - - - - fdk_aac" 413 | local d=fdk-aac 414 | 415 | cd ffmpeg_sources 416 | if test -d $d; then 417 | cd $d 418 | git pull 419 | make distclean || : 420 | else 421 | git clone https://github.com/mstorsjo/fdk-aac 422 | cd $d 423 | fi 424 | 425 | git checkout "$fdk_aac_rev" || return 1 426 | fdk_aac_rev=$(git describe --always --abbrev HEAD) 427 | 428 | autoreconf -fiv 429 | ./configure --prefix="$PREFIX" $common_config_options 430 | make $MAKEOPTS && make install && cd ../.. 431 | } 432 | 433 | 434 | function build_vpx { 435 | echo " 436 | - - - - vpx" 437 | local d=libvpx 438 | 439 | cd ffmpeg_sources 440 | if test -d $d; then 441 | cd $d 442 | git pull 443 | make distclean || : 444 | else 445 | git clone https://chromium.googlesource.com/webm/libvpx.git 446 | cd $d 447 | fi 448 | 449 | git checkout "$vpx_rev" || return 1 450 | export vpx_rev=$(git describe --always --abbrev HEAD) 451 | 452 | ./configure --prefix="$PREFIX" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic $common_config_options 453 | make $MAKEOPTS && make install && cd ../.. 454 | } 455 | 456 | 457 | function build_ffmpeg { 458 | echo " 459 | - - - - ffmpeg 460 | " 461 | local d=ffmpeg 462 | 463 | cd ffmpeg_sources 464 | if test -d $d; then 465 | cd $d 466 | git pull 467 | make distclean || : 468 | else 469 | git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg 470 | cd $d 471 | fi 472 | 473 | git checkout "$ffmpeg_rev" || return 1 474 | export ffmpeg_rev=$(git describe --always --abbrev HEAD) 475 | 476 | ./configure \ 477 | --prefix="$PREFIX" \ 478 | --pkg-config-flags="--static" \ 479 | --extra-libs="-lm -lpthread" \ 480 | --enable-pic \ 481 | --bindir="$HOME/bin" \ 482 | --extra-cflags="-I$PREFIX/include -static" \ 483 | --enable-gpl \ 484 | --enable-libass \ 485 | --enable-libfreetype \ 486 | --enable-libmp3lame \ 487 | --enable-libopus \ 488 | --enable-libvorbis \ 489 | --enable-libvpx \ 490 | --enable-libfdk_aac \ 491 | --enable-libfdk-aac \ 492 | --enable-libx264 \ 493 | --enable-nonfree \ 494 | --enable-static 495 | make $MAKEOPTS && make install && 496 | echo " 497 | Build successfully completed: ffmpeg installed in $PREFIX 498 | " && cd ../.. 499 | } 500 | 501 | 502 | 503 | 504 | 505 | test -r /etc/redhat-release && do_yum 506 | test -r /etc/debian_version && do_apt 507 | 508 | check_yasm || install_yasm || { echo "Failed to build yasm"; exit 3; } 509 | check_nasm || install_nasm || { echo "Failed to build nasm"; exit 3; } 510 | 511 | # these are at static versions 512 | build_lame 513 | build_opus 514 | build_libogg 515 | build_libvorbis 516 | # some others are pulled newest 517 | build_x264 || exit 2 518 | build_x265 || exit 2 519 | build_fdk || exit 2 520 | build_vpx || exit 2 521 | 522 | build_ffmpeg || exit 2 523 | 524 | echo 525 | 526 | ffmpeg -version || exit 4 527 | 528 | echo " 529 | ffmpeg binary successfully built with these components: 530 | 531 | libvpx: $vpx_rev 532 | x264: $x264_rev 533 | x265: $x265_rev 534 | fdk_aac: $fdk_aac_rev 535 | ffmpeg: $ffmpeg_rev 536 | 537 | " 538 | --------------------------------------------------------------------------------