--- cross_compile_ffmpeg.sh 2017-04-05 17:10:26.000000000 -0700 +++ cross_compile_ffmpeg_updated_versions_temp.sh 2017-04-09 03:53:01.277788999 -0700 @@ -183,7 +183,7 @@ if [[ ($compiler_flavors == "win32" || $compiler_flavors == "multi") && ! -f ../$win32_gcc ]]; then echo "building win32 cross compiler..." download_gcc_build_script $zeranoe_script_name - nice ./$zeranoe_script_name $zeranoe_script_options --build-type=win32 || exit 1 + nice ./$zeranoe_script_name $zeranoe_script_options --build-type=win32 --enable-gendef || exit 1 if [[ ! -f ../$win32_gcc ]]; then echo "failure building 32 bit gcc? recommend nuke sandbox (rm -rf sandbox) and start over..." exit 1 @@ -192,14 +192,12 @@ if [[ ($compiler_flavors == "win64" || $compiler_flavors == "multi") && ! -f ../$win64_gcc ]]; then echo "building win64 x86_64 cross compiler..." download_gcc_build_script $zeranoe_script_name - nice ./$zeranoe_script_name $zeranoe_script_options --build-type=win64 || exit 1 + nice ./$zeranoe_script_name $zeranoe_script_options --build-type=win64 --enable-gendef || exit 1 if [[ ! -f ../$win64_gcc ]]; then echo "failure building 64 bit gcc? recommend nuke sandbox (rm -rf sandbox) and start over..." exit 1 fi fi - - rm -f build.log # left over stuff... reset_cflags cd .. @@ -561,8 +559,10 @@ } build_libopenh264() { - do_git_checkout "https://github.com/cisco/openh264.git" openh264 24916a652ee5d3 # need this to match ffmpeg's apparently or openh264v1.4 [this is last commit before 1.5 AFAICT] - cd openh264 + #do_git_checkout "https://github.com/cisco/openh264.git" openh264 24916a652ee5d3 # need this to match ffmpeg's apparently or openh264v1.4 [this is last commit before 1.5 AFAICT] + #cd openh264 + download_and_unpack_file https://github.com/cisco/openh264/archive/v1.6.0.tar.gz openh264-1.6.0 + cd openh264-1.6.0 if [ $bits_target = 32 ]; then local arch=i686 # or x86? else @@ -591,7 +591,8 @@ checkout_dir="${checkout_dir}_normal_bitdepth" fi - do_git_checkout "http://repo.or.cz/r/x264.git" $checkout_dir "origin/stable" # guess we always prefer stable here... + #do_git_checkout "http://repo.or.cz/r/x264.git" $checkout_dir "origin/stable" # guess we always prefer stable here... + do_git_checkout "http://git.videolan.org/git/x264.git" $checkout_dir "origin/master" # live well, punt for the latest version rather than the stable cd $checkout_dir local configure_flags="--host=$host_target --enable-static --cross-prefix=$cross_prefix --prefix=$mingw_w64_x86_64_prefix --enable-strip" # --enable-win32thread --enable-debug is another useful option here? @@ -638,7 +639,6 @@ build_librtmp() { # download_and_unpack_file http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz # has some odd configure failure - do_git_checkout "http://repo.or.cz/r/rtmpdump.git" cd rtmpdump_git/librtmp do_make_and_make_install "CRYPTO=GNUTLS OPT=-O2 CROSS_COMPILE=$cross_prefix SHARED=no prefix=$mingw_w64_x86_64_prefix" @@ -651,20 +651,16 @@ make SYS=mingw CRYPTO=GNUTLS OPT=-O2 CROSS_COMPILE=$cross_prefix SHARED=no LIB_GNUTLS="`pkg-config --libs gnutls` -lz" || exit 1 # NB not multi process here so we can ensure existence of rtmpsuck.exe means "we made it all the way to the end" fi cd .. - } build_qt() { build_libjpeg_turbo # libjpeg a dependency [?] - unset CFLAGS # it makes something of its own first, which runs locally, so can't use a foreign arch, or maybe it can, but not important enough: http://stackoverflow.com/a/18775859/32453 XXXX could look at this # download_and_unpack_file http://download.qt-project.org/official_releases/qt/5.1/5.1.1/submodules/qtbase-opensource-src-5.1.1.tar.xz qtbase-opensource-src-5.1.1 # not officially supported seems...so didn't try it - download_and_unpack_file http://pkgs.fedoraproject.org/repo/pkgs/qt/qt-everywhere-opensource-src-4.8.5.tar.gz/1864987bdbb2f58f8ae8b350dfdbe133/qt-everywhere-opensource-src-4.8.5.tar.gz cd qt-everywhere-opensource-src-4.8.5 # download_and_unpack_file http://download.qt-project.org/archive/qt/4.8/4.8.1/qt-everywhere-opensource-src-4.8.1.tar.gz # cd qt-everywhere-opensource-src-4.8.1 - apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/imageformats.patch apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/qt-win64.patch # vlc's configure options...mostly @@ -690,7 +686,6 @@ cd .. } - build_libebur128() { do_git_checkout https://github.com/jiixyj/libebur128.git cd libebur128_git @@ -712,7 +707,8 @@ } build_libsndfile() { - generic_download_and_make_and_install http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.25.tar.gz + #generic_download_and_make_and_install http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.25.tar.gz + generic_download_and_make_and_install http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.27.tar.gz } build_libbs2b() { @@ -722,47 +718,65 @@ } build_libgme_game_music_emu() { - download_and_unpack_file https://sourceforge.net/projects/ffmpegwindowsbi/files/dependency_libraries/game-music-emu-0.6.0.tar.bz2 # was bitbucket, but cygwin curl didn't like it :| - cd game-music-emu-0.6.0 - sed -i.bak "s|SHARED|STATIC|" gme/CMakeLists.txt - do_cmake_and_install + #download_and_unpack_file https://sourceforge.net/projects/ffmpegwindowsbi/files/dependency_libraries/game-music-emu-0.6.0.tar.bz2 # was bitbucket, but cygwin curl didn't like it :| + #cd game-music-emu-0.6.0 + # sed -i.bak "s|SHARED|STATIC|" gme/CMakeLists.txt + # do_cmake_and_install +# seems to be an issue building 0.6.1 "the program can's start because libgme.dll is missing from your computer. try reinstalling the program to fix this problem." +# ok, this https://github.com/ShiftMediaProject/game-music-emu says +# To build a static library instead of shared (the default), pass -DBUILD_SHARED_LIBS=OFF to the cmake command when running cmake. + download_and_unpack_file https://bitbucket.org/mpyne/game-music-emu/downloads/game-music-emu-0.6.1.tar.bz2 + cd game-music-emu-0.6.1 + do_cmake_and_install "-DBUILD_SHARED_LIBS=OFF" cd .. } build_liblzma() { - generic_download_and_make_and_install http://tukaani.org/xz/xz-5.2.2.tar.bz2 + #generic_download_and_make_and_install http://tukaani.org/xz/xz-5.2.2.tar.bz2 + #generic_download_and_make_and_install http://tukaani.org/xz/xz-5.2.3.tar.bz2 # this refused to connect :( + generic_download_and_make_and_install https://sourceforge.net/projects/lzmautils/files/xz-5.2.3.tar.xz } build_libsnappy() { - generic_download_and_make_and_install https://sourceforge.net/projects/ffmpegwindowsbi/files/dependency_libraries/google-snappy-1.1.3-14-g32d6d7d.tar.gz google-snappy-32d6d7d + #generic_download_and_make_and_install https://sourceforge.net/projects/ffmpegwindowsbi/files/dependency_libraries/google-snappy-1.1.3-14-g32d6d7d.tar.gz google-snappy-32d6d7d + generic_download_and_make_and_install https://github.com/google/snappy/releases/download/1.1.4/snappy-1.1.4.tar.gz } build_wavpack() { - generic_download_and_make_and_install http://wavpack.com/wavpack-4.70.0.tar.bz2 +# 2017.04.09 ffmpeg apparently now has Native support for this Encoding and Decoding ... comment out the call to this function + #generic_download_and_make_and_install http://wavpack.com/wavpack-4.70.0.tar.bz2 + generic_download_and_make_and_install http://wavpack.com/wavpack-5.1.0.tar.bz2 } build_libwebp() { - generic_download_and_make_and_install http://downloads.webmproject.org/releases/webp/libwebp-0.5.0.tar.gz + #generic_download_and_make_and_install http://downloads.webmproject.org/releases/webp/libwebp-0.5.0.tar.gz + generic_download_and_make_and_install https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-0.6.0.tar.gz } build_libpng() { # generic_download_and_make_and_install https://download.sourceforge.net/libpng/libpng-1.6.12.tar.xz - generic_download_and_make_and_install https://download.sourceforge.net/libpng/libpng-1.5.26.tar.xz # libtheora can't take 1.6.x :| + #generic_download_and_make_and_install https://download.sourceforge.net/libpng/libpng-1.5.26.tar.xz # libtheora can't take 1.6.x :| + generic_download_and_make_and_install https://download.sourceforge.net/libpng/libpng-1.5.28.tar.xz # libtheora can't take 1.6.x :| } build_libopenjpeg() { # does openjpeg 2.0 work with ffmpeg? possibly not yet... - download_and_unpack_file https://sourceforge.net/projects/openjpeg.mirror/files/1.5.2/openjpeg-1.5.2.tar.gz - cd openjpeg-1.5.2 - export CFLAGS="$CFLAGS -DOPJ_STATIC" # see https://github.com/rdp/ffmpeg-windows-build-helpers/issues/37 - generic_configure_make_install - reset_cflags + #download_and_unpack_file https://sourceforge.net/projects/openjpeg.mirror/files/1.5.2/openjpeg-1.5.2.tar.gz + #cd openjpeg-1.5.2 + # export CFLAGS="$CFLAGS -DOPJ_STATIC" # see https://github.com/rdp/ffmpeg-windows-build-helpers/issues/37 + # generic_configure_make_install + # reset_cflags + # 2017.04.09 ... how to build 2.1.2, see schmidthubert post https://github.com/rdp/ffmpeg-windows-build-helpers/issues/218#issuecomment-292743142 + download_and_unpack_file https://github.com/uclouvain/openjpeg/archive/v2.1.2.tar.gz openjpeg-2.1.2 + cd openjpeg-2.1.2 + export CFLAGS="$CFLAGS -DOPJ_STATIC" + do_cmake_and_install "-DBUILD_SHARED_LIBS:BOOL=off -DBUILD_THIRDPARTY:BOOL=on -DBUILD_PKGCONFIG_FILES:BOOL=on" + reset_cflags cd .. } build_libvpx() { local checkout_dir="libvpx_git" - do_git_checkout https://chromium.googlesource.com/webm/libvpx $checkout_dir v1.6.1 # [had probs with master once...so only a stable option presently] cd $checkout_dir apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/vpx_160_semaphore.patch -p1 # perhaps someday can remove this after 1.6.0 or mingw fixes it LOL @@ -778,7 +792,6 @@ cd .. } - build_libilbc() { do_git_checkout https://github.com/dekkers/libilbc.git cd libilbc_git @@ -827,10 +840,17 @@ } build_libopus() { - download_and_unpack_file http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz - cd opus-1.1 - apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/opus11.patch # allow it to work with shared builds - generic_configure_make_install + #download_and_unpack_file http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz + #cd opus-1.1 + #apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/opus11.patch # allow it to work with shared builds + #download_and_unpack_file http://downloads.xiph.org/releases/opus/opus-1.1.4.tar.gz + #cd opus-1.1.4 + do_git_checkout https://github.com/xiph/opus.git + cd opus_git + # rdp will need to upload this new patch to his server as libopus.patch + #apply_patch http://rwijnsma.home.xs4all.nl/files/ffmpeg/libopus.patch # allow it to work with shared builds + apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/libopus.patch # allow it to work with shared builds + generic_configure_make_install cd .. } @@ -862,8 +882,10 @@ } build_libopencore() { - generic_download_and_make_and_install https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-0.1.3.tar.gz - generic_download_and_make_and_install https://sourceforge.net/projects/opencore-amr/files/vo-amrwbenc/vo-amrwbenc-0.1.2.tar.gz + #generic_download_and_make_and_install https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-0.1.3.tar.gz + generic_download_and_make_and_install https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-0.1.5.tar.gz + #generic_download_and_make_and_install https://sourceforge.net/projects/opencore-amr/files/vo-amrwbenc/vo-amrwbenc-0.1.2.tar.gz + generic_download_and_make_and_install https://sourceforge.net/projects/opencore-amr/files/vo-amrwbenc/vo-amrwbenc-0.1.3.tar.gz } build_libdlfcn() { @@ -875,8 +897,10 @@ } build_libjpeg_turbo() { - download_and_unpack_file https://sourceforge.net/projects/libjpeg-turbo/files/1.5.0/libjpeg-turbo-1.5.0.tar.gz - cd libjpeg-turbo-1.5.0 + #download_and_unpack_file https://sourceforge.net/projects/libjpeg-turbo/files/1.5.0/libjpeg-turbo-1.5.0.tar.gz + #cd libjpeg-turbo-1.5.0 + download_and_unpack_file https://github.com/libjpeg-turbo/libjpeg-turbo/archive/1.5.1.tar.gz libjpeg-turbo-1.5.1 + cd libjpeg-turbo-1.5.1 #do_cmake_and_install "-DNASM=yasm" # couldn't figure out a static only build with cmake...maybe you can these days dunno generic_configure "NASM=yasm" do_make_and_make_install @@ -885,15 +909,29 @@ } build_libogg() { - generic_download_and_make_and_install http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz + #generic_download_and_make_and_install http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz + #generic_download_and_make_and_install http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz + do_git_checkout https://github.com/xiph/ogg.git + cd ogg_git + generic_configure_make_install + cd .. } build_libvorbis() { - generic_download_and_make_and_install http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz + #generic_download_and_make_and_install http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz + #generic_download_and_make_and_install http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz + do_git_checkout https://github.com/xiph/vorbis.git + cd vorbis_git + generic_configure_make_install + cd .. } build_libspeexdsp() { - generic_download_and_make_and_install http://downloads.xiph.org/releases/speex/speexdsp-1.2rc3.tar.gz + #generic_download_and_make_and_install http://downloads.xiph.org/releases/speex/speexdsp-1.2rc3.tar.gz + do_git_checkout https://github.com/xiph/speexdsp.git + cd speexdsp_git + generic_configure_make_install + cd .. } build_libspeex() { @@ -904,7 +942,7 @@ #cd .. do_git_checkout https://github.com/xiph/speex.git cd speex_git - generic_configure_make_install + generic_configure_make_install cd .. } @@ -916,33 +954,39 @@ generic_configure_make_install cd .. cpu_count=$original_cpu_count + #do_git_checkout https://github.com/xiph/theora.git + #cd theora_git + #generic_configure_make_install + #cd .. } build_libfribidi() { # generic_download_and_make_and_install http://fribidi.org/download/fribidi-0.19.5.tar.bz2 fribidi-0.19.5 # got report of still failing? - download_and_unpack_file http://fribidi.org/download/fribidi-0.19.4.tar.bz2 - cd fribidi-0.19.4 + #download_and_unpack_file http://fribidi.org/download/fribidi-0.19.4.tar.bz2 + #cd fribidi-0.19.4 # make it export symbols right... - apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/fribidi.diff - generic_configure_make_install - cd .. - + #apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/fribidi.diff + #generic_configure_make_install #do_git_checkout http://anongit.freedesktop.org/git/fribidi/fribidi.git #cd fribidi_git # ./bootstrap # couldn't figure out how to make this work... # generic_configure_make_install #cd .. + generic_download_and_make_and_install https://www.fribidi.org/download/fribidi-0.19.7.tar.bz2 # 1.19.7 doesn't need patching ? } build_libass() { - generic_download_and_make_and_install https://github.com/libass/libass/releases/download/0.13.1/libass-0.13.1.tar.gz + #generic_download_and_make_and_install https://github.com/libass/libass/releases/download/0.13.1/libass-0.13.1.tar.gz + generic_download_and_make_and_install https://github.com/libass/libass/releases/download/0.13.6/libass-0.13.6.tar.gz # fribidi, fontconfig, freetype throw them all in there for good measure, trying to help mplayer once though it didn't help [FFmpeg needed a change for fribidi here though I believe] sed -i.bak 's/-lass -lm/-lass -lfribidi -lfontconfig -lfreetype -lexpat -lm/' "$PKG_CONFIG_PATH/libass.pc" } build_gmp() { - download_and_unpack_file https://gmplib.org/download/gmp/gmp-6.0.0a.tar.xz gmp-6.0.0 - cd gmp-6.0.0 + #download_and_unpack_file https://gmplib.org/download/gmp/gmp-6.0.0a.tar.xz gmp-6.0.0 + #cd gmp-6.0.0 + download_and_unpack_file https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz gmp-6.1.2 + cd gmp-6.1.2 export CC_FOR_BUILD=/usr/bin/gcc export CPP_FOR_BUILD=usr/bin/cpp generic_configure "ABI=$bits_target" @@ -953,7 +997,8 @@ } build_orc() { - generic_download_and_make_and_install https://download.videolan.org/contrib/orc-0.4.18.tar.gz + #generic_download_and_make_and_install https://download.videolan.org/contrib/orc-0.4.18.tar.gz + generic_download_and_make_and_install https://gstreamer.freedesktop.org/src/orc/orc-0.4.26.tar.xz } build_libxml2() { @@ -977,8 +1022,10 @@ } build_gnutls() { - download_and_unpack_file http://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.5/gnutls-3.5.9.tar.xz - cd gnutls-3.5.9 + #download_and_unpack_file http://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.5/gnutls-3.5.9.tar.xz + #cd gnutls-3.5.9 + download_and_unpack_file https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.5/gnutls-3.5.10.tar.xz + cd gnutls-3.5.10 sed -i.bak 's/mkstemp(tmpfile)/ -1 /g' src/danetool.c # fix x86_64 absent? but danetool is just an exe AFAICT so this hack should be ok... # --disable-cxx don't need the c++ version, in an effort to cut down on size... XXXX test size difference... # --enable-local-libopts to allow building with local autogen installed, @@ -992,15 +1039,18 @@ } build_libnettle() { - download_and_unpack_file https://ftp.gnu.org/gnu/nettle/nettle-3.1.tar.gz - cd nettle-3.1 + #download_and_unpack_file https://ftp.gnu.org/gnu/nettle/nettle-3.1.tar.gz + #cd nettle-3.1 + download_and_unpack_file https://ftp.gnu.org/gnu/nettle/nettle-3.3.tar.gz + cd nettle-3.3 generic_configure "--disable-openssl --with-included-libtasn1" # in case we have both gnutls and openssl, just use gnutls [except that gnutls uses this so...huh? https://github.com/rdp/ffmpeg-windows-build-helpers/issues/25#issuecomment-28158515 do_make_and_make_install cd .. } build_bzlib2() { - download_and_unpack_file https://fossies.org/linux/misc/bzip2-1.0.6.tar.gz + #download_and_unpack_file https://fossies.org/linux/misc/bzip2-1.0.6.tar.gz # this became unavailable :( + download_and_unpack_file http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz cd bzip2-1.0.6 apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/bzip2_cross_compile.diff do_make "$make_prefix_options libbz2.a bzip2 bzip2recover install" @@ -1008,14 +1058,17 @@ } build_zlib() { - download_and_unpack_file https://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz - cd zlib-1.2.8 + #download_and_unpack_file https://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz + #cd zlib-1.2.8 + download_and_unpack_file https://sourceforge.net/projects/libpng/files/zlib/1.2.11/zlib-1.2.11.tar.gz + cd zlib-1.2.11 do_configure "--static --prefix=$mingw_w64_x86_64_prefix" do_make_and_make_install "$make_prefix_options ARFLAGS=rcs" cd .. } build_libxvid() { +# 2017.04.09 ffmpeg apparently now has Native support for this Encoding and Decoding ... comment out the call to this function download_and_unpack_file http://downloads.xvid.org/downloads/xvidcore-1.3.3.tar.gz xvidcore cd xvidcore/build/generic do_configure "--host=$host_target --prefix=$mingw_w64_x86_64_prefix $config_opts" # no static option... @@ -1034,8 +1087,10 @@ } build_fontconfig() { - download_and_unpack_file https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.94.tar.gz - cd fontconfig-2.11.94 + #download_and_unpack_file https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.94.tar.gz + #cd fontconfig-2.11.94 + download_and_unpack_file https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.1.tar.gz + cd fontconfig-2.12.1 export CFLAGS= # compile fails with -march=sandybridge ... with mingw 4.0.6 at least ... generic_configure --disable-docs do_make_and_make_install @@ -1044,7 +1099,6 @@ sed -i.bak 's/-L${libdir} -lfontconfig[^l]*$/-L${libdir} -lfontconfig -lfreetype -lexpat/' "$PKG_CONFIG_PATH/fontconfig.pc" } - build_openssl() { # warning, this is a very old version of openssl since we don't really use it anymore hasn't been updated in awhile... download_and_unpack_file https://www.openssl.org/source/openssl-1.1.0e.tar.gz @@ -1089,12 +1143,15 @@ } build_libexpat() { - generic_download_and_make_and_install https://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz + #generic_download_and_make_and_install https://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz + generic_download_and_make_and_install https://sourceforge.net/projects/expat/files/expat/2.2.0/expat-2.2.0.tar.bz2 } build_iconv() { - download_and_unpack_file https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz - cd libiconv-1.14 + #download_and_unpack_file https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz + #cd libiconv-1.14 + download_and_unpack_file https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz + cd libiconv-1.15 export CFLAGS=-O2 # ?? generic_configure_make_install reset_cflags @@ -1102,8 +1159,11 @@ } build_freetype() { - download_and_unpack_file https://download.videolan.org/contrib/freetype2/freetype-2.6.3.tar.gz - cd freetype-2.6.3 + #download_and_unpack_file https://download.videolan.org/contrib/freetype2/freetype-2.6.3.tar.gz + #cd freetype-2.6.3 + # version 2.7.1 wouldn't build ???? :( + download_and_unpack_file https://sourceforge.net/projects/freetype/files/freetype2/2.7.1/freetype-2.7.1.tar.bz2 + cd freetype-2.7.1 if [[ `uname -s` == CYGWIN* ]]; then generic_configure "--build=i686-pc-cygwin --with-png=no" # hard to believe but needed... else @@ -1135,7 +1195,6 @@ # apparently ffmpeg expects prefix-sdl-config not sdl-config that they give us, so rename... export CFLAGS=-DDECLSPEC= # avoid SDL trac tickets 939 and 282, and not worried about optimizing yet... download_and_unpack_file http://libsdl.org/release/SDL2-2.0.5.tar.gz - cd SDL2-2.0.5 generic_configure # apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/sdl2.xinput.diff mingw-w64 master needs it? @@ -1167,7 +1226,8 @@ } build_vamp_plugin() { - download_and_unpack_file https://sourceforge.net/projects/ffmpegwindowsbi/files/dependency_libraries/vamp-plugin-sdk-2.6.tar.gz + #download_and_unpack_file https://sourceforge.net/projects/ffmpegwindowsbi/files/dependency_libraries/vamp-plugin-sdk-2.6.tar.gz + download_and_unpack_file https://code.soundsoftware.ac.uk/attachments/download/1520/vamp-plugin-sdk-2.6.tar.gz cd vamp-plugin-sdk-2.6 generic_configure do_make_and_make_install "$make_prefix_options sdkstatic" @@ -1175,11 +1235,14 @@ } build_fftw() { - generic_download_and_make_and_install http://www.fftw.org/fftw-3.3.5.tar.gz # said to make it "double precision-er" + #generic_download_and_make_and_install http://www.fftw.org/fftw-3.3.5.tar.gz # said to make it "double precision-er" + generic_download_and_make_and_install http://www.fftw.org/fftw-3.3.6-pl2.tar.gz } build_libsamplerate() { generic_download_and_make_and_install http://www.mega-nerd.com/SRC/libsamplerate-0.1.8.tar.gz # can use this, but uses speex bundled by default [any difference?] + # version 0.1.9 wouldn't build :( see if someone can spend time on it + #generic_download_and_make_and_install http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz # 0.1.9 fails to build } build_librubberband() { @@ -1245,8 +1308,10 @@ } build_lua() { - download_and_unpack_file https://www.lua.org/ftp/lua-5.3.3.tar.gz - cd lua-5.3.3 + #download_and_unpack_file https://www.lua.org/ftp/lua-5.3.3.tar.gz + #cd lua-5.3.3 + download_and_unpack_file https://www.lua.org/ftp/lua-5.3.4.tar.gz + cd lua-5.3.4 export AR="${cross_prefix}ar rcu" # needs rcu parameter so have to call it out different :| do_make "CC=${cross_prefix}gcc RANLIB=${cross_prefix}ranlib generic" # generic == "generic target" and seems to result in a static build, no .exe's blah blah the mingw option doesn't even build liblua.a unset AR @@ -1261,8 +1326,10 @@ build_frei0r() { # theoretically we could get by with just copying a .h file in, but why not build the .dll's here anyway, for fun, and in case useful? :) - download_and_unpack_file https://files.dyne.org/frei0r/releases/frei0r-plugins-1.4.tar.gz - cd frei0r-plugins-1.4 + #download_and_unpack_file https://files.dyne.org/frei0r/releases/frei0r-plugins-1.4.tar.gz + #cd frei0r-plugins-1.4 + download_and_unpack_file https://files.dyne.org/frei0r/releases/frei0r-plugins-1.5.0.tar.gz + cd frei0r-plugins-1.5.0 sed -i.bak "s/find_package (Cairo)//g" CMakeLists.txt do_cmake_and_install cd .. @@ -1277,13 +1344,16 @@ } build_libcurl() { - generic_download_and_make_and_install https://curl.haxx.se/download/curl-7.46.0.tar.gz + #generic_download_and_make_and_install https://curl.haxx.se/download/curl-7.46.0.tar.gz + generic_download_and_make_and_install https://curl.haxx.se/download/curl-7.53.1.tar.gz } build_netcdf() { # used for sofalizer filter - download_and_unpack_file http://gfd-dennou.org/arch/ucar/unidata/pub/netcdf/netcdf-4.4.1.tar.gz - cd netcdf-4.4.1 + #download_and_unpack_file http://gfd-dennou.org/arch/ucar/unidata/pub/netcdf/netcdf-4.4.1.tar.gz + #cd netcdf-4.4.1 + download_and_unpack_file http://gfd-dennou.org/arch/ucar/unidata/pub/netcdf/netcdf-4.4.1.1.tar.gz + cd netcdf-4.4.1.1 generic_configure --disable-netcdf-4 --disable-dap # its dependencies were *hard* LOL do_make_and_make_install cd .. @@ -1500,9 +1570,11 @@ fi init_options="--arch=$arch --target-os=mingw32 --cross-prefix=$cross_prefix --pkg-config=pkg-config --disable-w32threads" - config_options="$init_options --enable-libsoxr --enable-fontconfig --enable-libass --enable-libbluray --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-decklink --extra-libs=-loleaut32 --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-bzlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2 --enable-gray --enable-libopenh264 --enable-netcdf --enable-libflite --enable-lzma --enable-libsnappy --enable-libzimg" + #config_options="$init_options --enable-libsoxr --enable-fontconfig --enable-libass --enable-libbluray --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-decklink --extra-libs=-loleaut32 --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-bzlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2 --enable-gray --enable-libopenh264 --enable-netcdf --enable-libflite --enable-lzma --enable-libsnappy --enable-libzimg" + config_options="$init_options --enable-libsoxr --enable-fontconfig --enable-libass --enable-libbluray --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-decklink --extra-libs=-loleaut32 --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-bzlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-libwebp --enable-libgme --enable-dxva2 --enable-gray --enable-libopenh264 --enable-netcdf --enable-libflite --enable-lzma --enable-libsnappy --enable-libzimg" if [[ $enable_gpl == 'y' ]]; then - config_options="$config_options --enable-gpl --enable-libx264 --enable-libx265 --enable-frei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-libxavs --enable-libxvid --enable-avisynth" + #config_options="$config_options --enable-gpl --enable-libx264 --enable-libx265 --enable-frei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-libxavs --enable-libxvid --enable-avisynth" + config_options="$config_options --enable-gpl --enable-libx264 --enable-libx265 --enable-frei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-libxavs --enable-avisynth" fi # other possibilities (you'd need to also uncomment the call to their build method): # --enable-w32threads # [worse UDP than pthreads, so not using that] @@ -1526,7 +1598,13 @@ # other possible options: --enable-openssl [unneeded since we use gnutls] # apply_patch https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/nvresize2.patch "-p1" # uncomment if you want to test nvresize filter [et al] http://ffmpeg.org/pipermail/ffmpeg-devel/2015-November/182781.html patch worked with 7ab37cae34b3845 fi - + + # ---------- for future opencl build compatibility - start + # add the opencl commandline switch --enable-opencl for "the real kahuna" and hope for the best + if [[ $enable_opencl == 'y' ]]; then + config_options="$config_options --enable-opencl" + fi + # ---------- for future opencl build compatibility - end config_options="$config_options --enable-runtime-cpudetect" # not sure what this even does but this is the most compatible do_debug_build=n # if you need one for backtraces/examining segfaults using gdb.exe ... change this to y :) XXXX make it affect x264 too...and make it param @@ -1608,11 +1686,10 @@ build_libnettle # needs gmp build_iconv # mplayer I think needs it for freetype [just it though], vlc also wants it. looks like ffmpeg can use it too...not sure what for :) build_gnutls # needs libnettle, can use iconv it appears - build_frei0r build_libsndfile build_libbs2b # needs libsndfile - build_wavpack + #build_wavpack # 2017.04.09 ffmpeg apparently now has Native support for this ... comment out the call to this function and in ffmpeg config_options --enable_wavpack build_libgme_game_music_emu build_libwebp build_libflite # not for now till after rubberband @@ -1622,9 +1699,9 @@ build_libopus build_libopencore build_libogg + build_libvorbis # needs libogg build_libspeexdsp # needs libogg for exe's build_libspeex # needs libspeexdsp - build_libvorbis # needs libogg build_libtheora # needs libvorbis, libogg build_orc build_libschroedinger # needs orc @@ -1633,18 +1710,16 @@ build_libxml2 build_libbluray # needs libxml2, freetype # build_libjpeg_turbo # mplayer can use this, VLC qt might need it? [replaces libjpeg] - build_libxvid + #build_libxvid # 2017.04.09 ffmpeg apparently now has Native support for this Encoding and Decoding ... comment out the call to this function and in ffmpeg config_options --enable_libxvid build_libxavs build_libsoxr #build_libebur128 # needs speex # Now included in ffmpeg as internal library build_libx265 build_libopenh264 - build_vamp_plugin # requires libsndfile build_fftw build_libsamplerate build_librubberband # needs libsndfile, vamp_plugin [though it never uses it], fftw, libsamplerate [some of which it doesn't have to use, but configure require they be installed, so we use them anyway...gah] - build_lame build_twolame build_vidstab @@ -1732,18 +1807,19 @@ build_mp4box=n build_mplayer=n build_vlc=n -build_lsw=n +build_lsw=y # yes, so x264 can be built with it ... we want the latest and greatest don't we ? git_get_latest=y -prefer_stable=y +prefer_stable=n # get the latest by default, we want the latest and greatest don't we ? build_intel_qsv=y #disable_nonfree=n # have no value by default to force user selection original_cflags='-mtune=generic -O3' # be careful, these override lots of stuff in makesfiles :| can't use mtune=core2 since it bworks it for some cpu's # if you specify a march it needs to first so x264's configure will use it :| -build_x264_with_libav=n +# change a couple of the defaults ffmpeg_git_checkout_version= build_ismindex=n enable_gpl=y - +build_x264_with_libav=y +enable_opencl=n # this is niche, not for everyone, you need to do "external" work beforehand for this to build # parse command line parameters, if any while true; do case $1 in @@ -1805,7 +1881,6 @@ * ) break ;; esac done - reset_cflags # also overrides any "native" CFLAGS, which we may need if there are some 'linux only' settings in there check_missing_packages # do this first since it's annoying to go through prompts then be rejected intro # remember to always run the intro, since it adjust pwd @@ -1842,8 +1917,73 @@ make_prefix_options="CC=${cross_prefix}gcc AR=${cross_prefix}ar PREFIX=$mingw_w64_x86_64_prefix RANLIB=${cross_prefix}ranlib LD=${cross_prefix}ld STRIP=${cross_prefix}strip CXX=${cross_prefix}g++" mkdir -p win32 cd win32 +# ---------- for future opencl build, provided files are pre-copied into the righ folders before running this script - start +# dependencies sudo apt-get install -y subversion curl texinfo g++ bison flex cvs yasm automake libtool-bin ed autoconf gcc cmake git make pkg-config zlib1g-dev mercurial unzip pax wget nasm curl ant +# ... gendef is installed with mingw + if [[ $enable_opencl == 'y' ]]; then + set -x + echo "We assume that the 32bit dll c:\Windows\syswow64\OpenCL.dll has been pre-copied into ffmpeg-windows-build-helpers-master/openclx32/OpenCL.dll (name case sensitive)" + pwd + echo $path + #read -p "Press Enter to continue... or control-C if the pwd is not the sandbox/win32 folder" + mkdir openclx32 + cp ../../openclx32/* ./openclx32 + cd openclx32 + echo "" + #echo "${cross_prefix}gendef OpenCL.dll ...gendef was compiled when building mingw by adding --enable-gendef" + #${cross_prefix}gendef OpenCL.dll + echo "${mingw_bin_path}gendef OpenCL.dll ...gendef was compiled when building mingw by adding --enable-gendef" + ${mingw_bin_path}/gendef OpenCL.dll + echo "" + #read -p "after gendef Press Enter to continue... or control-C if not happy" + echo "---" + echo "" + echo "dlltool runs next, it gets built within mingw, although you do have to search to find it" + ${cross_prefix}dlltool -l libOpenCL.a -d OpenCL.def -k -A + echo "" + #read -p "after dlltool Press Enter to continue... or control-C if not happy" + echo "---" + echo "" + echo "32 bit get the OpenCL 1.2 headers from Khronos ..." + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/opencl.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_platform.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_ext.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_egl.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_dx9_media_sharing.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_d3d10.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_d3d11.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_gl.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_gl_ext.h -O --fail || exit 1 + echo "-------------------------------------------------------------" + #read -p "Press Enter to continue... or control-C if not happy" + pwd + ls -al + #/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include + #/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib + mkdir ${mingw_w64_x86_64_prefix}/include/OpenCL + mkdir ${mingw_w64_x86_64_prefix}/include/CL + echo "---" + cp *.h ${mingw_w64_x86_64_prefix}/include/OpenCL + cp *.h ${mingw_w64_x86_64_prefix}/include/CL + cp *.a ${mingw_w64_x86_64_prefix}/lib + echo "---" + cd .. + echo "" + #read -p "Press Enter to continue... or control-C if not happy" + set +x + fi + #read -p "Press Enter to continue... or control-C if not happy" +# ---------- for future opencl build, provided files are pre-copied into the right folders before running this script - end build_dependencies build_apps + # ---------- rebuild x264 with lsw so that if can produce .mp4 output files - start + # https://github.com/rdp/ffmpeg-windows-build-helpers/issues/218#issuecomment-290147276 + if [[ $build_lsw == 'y' ]]; then + build_lsw + build_libx264 + fi + # ---------- rebuild x264 with lsw so that if can produce .mp4 output files - end cd .. fi @@ -1860,8 +2000,73 @@ make_prefix_options="CC=${cross_prefix}gcc AR=${cross_prefix}ar PREFIX=$mingw_w64_x86_64_prefix RANLIB=${cross_prefix}ranlib LD=${cross_prefix}ld STRIP=${cross_prefix}strip CXX=${cross_prefix}g++" mkdir -p x86_64 cd x86_64 +# ---------- for future opencl build, provided files are pre-copied into the right folders before running this script - start +# dependencies sudo apt-get install -y subversion curl texinfo g++ bison flex cvs yasm automake libtool-bin ed autoconf gcc cmake git make pkg-config zlib1g-dev mercurial unzip pax wget nasm curl ant +# ... gendef is installed with mingw + if [[ $enable_opencl == 'y' ]]; then + set -x + echo "We assume that the 64bit dll c:\Windows\System32\OpenCL.dll has been pre-copied into ffmpeg-windows-build-helpers-master/openclx64/OpenCL.dll (name case sensitive)" + pwd + echo $path + #read -p "Press Enter to continue... or control-C if the pwd is not the sandbox/win64 folder" + mkdir openclx64 + cp ../../openclx64/* ./openclx64 + cd openclx64 + echo "" + #echo "${cross_prefix}gendef OpenCL.dll ...gendef was compiled when building mingw by adding --enable-gendef" + #${cross_prefix}gendef OpenCL.dll + echo "${mingw_bin_path}gendef OpenCL.dll ...gendef was compiled when building mingw by adding --enable-gendef" + ${mingw_bin_path}/gendef OpenCL.dll + echo "" + #read -p "after gendef Press Enter to continue... or control-C if not happy" + echo "---" + echo "" + echo "dlltool runs next, it gets built within mingw" + ${cross_prefix}dlltool -l libOpenCL.a -d OpenCL.def -k -A + echo "" + #read -p "after dlltool Press Enter to continue... or control-C if not happy" + echo "---" + echo "" + echo "64 bit get the OpenCL 1.2 headers from Khronos ..." + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/opencl.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_platform.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_ext.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_egl.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_dx9_media_sharing.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_d3d10.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_d3d11.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_gl.h -O --fail || exit 1 + curl -4 https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl12/cl_gl_ext.h -O --fail || exit 1 + echo "-------------------------------------------------------------" + #read -p "Press Enter to continue... or control-C if not happy" + pwd + ls -al + #/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include + #/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib + mkdir ${mingw_w64_x86_64_prefix}/include/OpenCL + mkdir ${mingw_w64_x86_64_prefix}/include/CL + echo "---" + cp *.h ${mingw_w64_x86_64_prefix}/include/OpenCL + cp *.h ${mingw_w64_x86_64_prefix}/include/CL + cp *.a ${mingw_w64_x86_64_prefix}/lib + echo "---" + cd .. + echo "" + #read -p "Press Enter to continue... or control-C if not happy" + set +x + fi + #read -p "Press Enter to continue... or control-C if not happy" +# ---------- for future opencl build, provided files are pre-copied into the right folders before running this script - end build_dependencies build_apps + # ---------- rebuild x264 with lsw so that if can produce .mp4 output files - start + # https://github.com/rdp/ffmpeg-windows-build-helpers/issues/218#issuecomment-290147276 + if [[ $build_lsw == 'y' ]]; then + build_lsw + build_libx264 + fi + # ---------- rebuild x264 with lsw so that if can produce .mp4 output files - end cd .. fi