rdp / ffmpeg-windows-build-helpers

Helper script for cross compiling some media tools for windows, like customizable ffmpeg.exe (with or without non-free components, etc), and some other bonuses like mplayer, mp4box, mxf, etc.
GNU General Public License v3.0
1.08k stars 412 forks source link

Windows XP compatible build with updated libraries #219

Closed Reino17 closed 7 years ago

Reino17 commented 7 years ago

I'd like to share the Windows XP compatible build I've made, including my notes for the compilers. This is therefore a report rather than an 'issue'.

Compared to rdp's '_cross_compileffmpeg.sh', it uses the following working(!) updated libraries:

openssl-1.1.0e     --> openssl-1.0.2k
gmp-6.0.0          --> gmp-6.1.2
nettle-3.1         --> nettle-3.3
gnutls-3.5.9       --> gnutls-3.5.10
zlib-1.2.8         --> zlib-1.2.11
xz-5.2.2           --> xz-5.2.3
libpng-1.5.26      --> libpng-1.5.28
libiconv-1.14      --> libiconv-1.15
frei0r-plugins-1.4 --> frei0r-plugins-1.5.0
libsndfile-1.0.25  --> libsndfile-1.0.27
libwebp-0.5.0      --> libwebp-0.6.0
opencore-amr-0.1.3 --> opencore-amr-0.1.5
vo-amrwbenc-0.1.2  --> vo-amrwbenc-0.1.3
libogg-1.3.1       --> ogg_git
libvorbis-1.3.4    --> vorbis_git
speexdsp-1.2rc3    --> speexdsp_git
wavpack-4.70.0     --> removed
xvidcore-1.3.3     --> removed
opus-1.1           --> opus_git
orc-0.4.18         --> orc-0.4.26
freetype-2.6.3     --> freetype-2.7.1
expat-2.1.0        --> expat-2.2.0
fftw-3.3.5         --> fftw-3.3.6-pl2
netcdf-4.4.1       --> netcdf-4.4.1.1
fontconfig-2.11.94 --> fontconfig-2.12.1
fribidi-0.19.4     --> fribidi-0.19.7
libass-0.13.1      --> libass-0.13.6

'_cross_compileffmpeg.log' contains logs for library updates that didn't work well.

First of all, to compile on my WinXP pc, I had to grab the latest WinXP compatible Cygwin setup and change a few things.

This is the '_cross_compileffmpeg.sh' I've successfully been using. And '_cross_compileffmpeg.diff' is the difference compared to rdp's '_cross_compileffmpeg.sh':

--- cross_compile_ffmpeg-git.sh   2017-03-23 13:17:25.906250000 +0100
+++ cross_compile_ffmpeg.sh   2017-03-29 18:00:27.875000000 +0200
@@ -637,21 +637,23 @@ build_libx264() {
 }

 build_librtmp() {
-  #  download_and_unpack_file http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz # has some odd configure failure
-
+  #download_and_unpack_file http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz rtmpdump-2.3 # has some odd configure failure
+  #cd rtmpdump-2.3/librtmp
+  #make install CRYPTO=GNUTLS OPT='-O2 -g' "CROSS_COMPILE=$cross_prefix" SHARED=no "prefix=$mingw_w64_x86_64_prefix" || exit 1
+  ##make install CRYPTO=OPENSSL OPT='-O2 -g' "CROSS_COMPILE=$cross_prefix" SHARED=no "prefix=$mingw_w64_x86_64_prefix" || exit 1 # doesn't work
+  #cd ../..
   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"
-  #make install CRYPTO=GNUTLS OPT='-O2 -g' "CROSS_COMPILE=$cross_prefix" SHARED=no "prefix=$mingw_w64_x86_64_prefix" || exit 1
+  #do_make_and_make_install "CRYPTO=OPENSSL OPT=-O2 CROSS_COMPILE=$cross_prefix SHARED=no prefix=$mingw_w64_x86_64_prefix" # doesn't work
   sed -i.bak 's/-lrtmp -lz/-lrtmp -lwinmm -lz/' "$PKG_CONFIG_PATH/librtmp.pc"
   # also build .exe's for fun:
   cd ..
-   if [[ ! -f rtmpsuck.exe ]]; then # hacky not do it twice
-     # TODO do_make here instead...not easy since it doesn't seem to accept env. variable for LIB_GNUTLS...
-     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
+    #if [[ ! -f rtmpsuck.exe ]]; then # hacky not do it twice
+    #  #TODO do_make here instead...not easy since it doesn't seem to accept env. variable for LIB_GNUTLS...
+    #  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() {
@@ -712,7 +714,7 @@ build_libxavs() {
 }

 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.27.tar.gz
 }

 build_libbs2b() {
@@ -730,24 +732,20 @@ build_libgme_game_music_emu() {
 }

 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.3.tar.bz2
 }

 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
 }

-build_wavpack() {
-  generic_download_and_make_and_install http://wavpack.com/wavpack-4.70.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 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.28.tar.xz  # libtheora can't take 1.6.x :|
 }

 build_libopenjpeg() {
@@ -827,10 +825,12 @@ build_libgsm() {
 }

 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.2-alpha2.tar.gz
+  #cd opus-1.2-alpha2
+  do_git_checkout https://github.com/xiph/opus.git
+  cd opus_git
+    apply_patch http://rwijnsma.home.xs4all.nl/files/ffmpeg/libopus.patch # allow it to work with shared builds
+    generic_configure_make_install
   cd ..
 }

@@ -862,8 +862,8 @@ build_libdvdcss() {
 }

 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.5.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() {
@@ -885,15 +885,24 @@ build_libjpeg_turbo() {
 }

 build_libogg() {
-  generic_download_and_make_and_install http://downloads.xiph.org/releases/ogg/libogg-1.3.1.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
+  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
+  do_git_checkout https://github.com/xiph/speexdsp.git
+  cd speexdsp_git
+    generic_configure_make_install
+  cd ..
 }

 build_libspeex() {
@@ -906,7 +915,7 @@ build_libspeex() {
   cd speex_git
     generic_configure_make_install
   cd ..
-}  
+}

 build_libtheora() {
   cpu_count=1 # can't handle it
@@ -916,16 +925,20 @@ build_libtheora() {
     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
-    # 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 ..
+  generic_download_and_make_and_install https://www.fribidi.org/download/fribidi-0.19.7.tar.bz2 # got report of still failing?
+  #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 ..

   #do_git_checkout http://anongit.freedesktop.org/git/fribidi/fribidi.git
   #cd fribidi_git
@@ -935,14 +948,14 @@ build_libfribidi() {
 }

 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.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.1.2.tar.xz
+  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 +966,7 @@ build_gmp() {
 }

 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://gstreamer.freedesktop.org/src/orc/orc-0.4.26.tar.xz
 }

 build_libxml2() {
@@ -977,8 +990,8 @@ build_libschroedinger() {
 }

 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 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,8 +1005,8 @@ build_gnutls() {
 }

 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.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 ..
@@ -1008,34 +1021,16 @@ build_bzlib2() {
 }

 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.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() {
-  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...
-  sed -i.bak "s/-mno-cygwin//" platform.inc # remove old compiler flag that now apparently breaks us
-
-  cpu_count=1 # possibly can't build this multi-thread ? http://betterlogic.com/roger/2014/02/xvid-build-woe/
-  do_make_and_make_install
-  cpu_count=$original_cpu_count
-  cd ../../..
-
-  # force a static build after the fact by only leaving the .a file, not the .dll.a file
-  if [[ -f "$mingw_w64_x86_64_prefix/lib/xvidcore.dll.a" ]]; then
-    rm $mingw_w64_x86_64_prefix/lib/xvidcore.dll.a || exit 1
-    mv $mingw_w64_x86_64_prefix/lib/xvidcore.a $mingw_w64_x86_64_prefix/lib/libxvidcore.a || exit 1
-  fi
-}
-
 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.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,11 +1039,10 @@ build_fontconfig() {
   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
-  cd openssl-1.1.0e
+  download_and_unpack_file https://www.openssl.org/source/openssl-1.0.2k.tar.gz
+  cd openssl-1.0.2k
   export CC="${cross_prefix}gcc"
   export AR="${cross_prefix}ar"
   export RANLIB="${cross_prefix}ranlib"
@@ -1089,12 +1083,12 @@ build_fdk_aac() {
 }

 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.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.15.tar.gz 
+  cd libiconv-1.15
     export CFLAGS=-O2 # ??
     generic_configure_make_install
     reset_cflags
@@ -1102,8 +1096,8 @@ build_iconv() {
 }

 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://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
@@ -1167,7 +1161,7 @@ build_lame() {
 }

 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://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,7 +1169,7 @@ build_vamp_plugin() {
 }

 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://fftw.org/fftw-3.3.6-pl2.tar.gz # said to make it "double precision-er"
 }

 build_libsamplerate() {
@@ -1261,8 +1255,8 @@ build_twolame() {

 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.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 ..
@@ -1282,8 +1276,8 @@ build_libcurl() {

 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.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 +1494,9 @@ build_ffmpeg() {
   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-avisynth --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 --disable-schannel --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-avisynth --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"
+    config_options="$config_options --enable-gpl --enable-libx264 --enable-libx265 --enable-frei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-libxavs"
   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] 
@@ -1612,7 +1606,6 @@ build_dependencies() {
   build_frei0r
   build_libsndfile
   build_libbs2b # needs libsndfile
-  build_wavpack
   build_libgme_game_music_emu
   build_libwebp
   build_libflite # not for now till after rubberband
@@ -1622,9 +1615,9 @@ build_dependencies() {
   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
@@ -1632,8 +1625,7 @@ build_dependencies() {
   build_libexpat
   build_libxml2
   build_libbluray # needs libxml2, freetype
-  # build_libjpeg_turbo # mplayer can use this, VLC qt might need it? [replaces libjpeg]
-  build_libxvid
+  #build_libjpeg_turbo # mplayer can use this, VLC qt might need it? [replaces libjpeg]
   build_libxavs
   build_libsoxr
   #build_libebur128 # needs speex # Now included in ffmpeg as internal library
@@ -1666,7 +1658,7 @@ build_dependencies() {
     build_fdk_aac
     # build_faac # not included for now, too poor quality output :)
   fi
-  # build_openssl # hopefully do not need it anymore, since we use gnutls everywhere, so just don't even build it anymore...
+  #build_openssl # hopefully do not need it anymore, since we use gnutls everywhere, so just don't even build it anymore...
   build_librtmp # needs gnutls [or openssl...]
   build_libx264 # at bottom as it might build an ffmpeg which needs all the above deps...
 }
@@ -1735,7 +1727,7 @@ build_vlc=n
 build_lsw=n
 git_get_latest=y
 prefer_stable=y
-build_intel_qsv=y
+build_intel_qsv=n
 #disable_nonfree=n # have no value by default to force user selection
 original_cflags='-mtune=core2 -O3' #  be careful, these override lots of stuff in makesfiles :|
 # if you specify a march it needs to first so x264's configure will use it :|

To make FFMpeg WinXP compatible I had to change build_intel_qsv=y to build_intel_qsv=n. Otherwise the error "The procedure entry point _wfopen_s could not be located in the dynamic link library msvcrt.dll" would return.

TLS support on Windows XP: I couldn't open TLS 1.2 https-urls and at first I thought I'd need OpenSSL instead of the default GnuTLS, but in the end it was all about --disable-schannel. The build I've now made (--disable-schannel --enable-gnutls) works fine too!

wavpack-4.70.0, xvidcore-1.3.3 --> removed: Native support in FFMpeg (https://ffmpeg.org/general.html#Supported-File-Formats_002c-Codecs-or-Features). Decoding as well as encoding.

opus-1.1 --> opus_git: I've updated the "allow-it-to-work-with-shared-builds"-patch, but haven't tested it.

fribidi-0.19.4 --> fribidi-0.19.7: Judging the v0.19.7's source-code, the patch isn't needed anymore.

Reino17 commented 7 years ago

https://ffmpeg.zeranoe.com/forum/viewtopic.php?f=13&t=3572#p10122:

Today when I did some testing with -c:v libx264 another fatal error popped up:

The exception Illegal Instruction
An attempt was made to execute an illegal instruction.
(0xc000001d) occurred in the application at location 0x011e166a.

I have narrowed it down to ffmpeg-20150823-git-1bf76cd-win32-static.7z being the latest working build. ffmpeg-20150825-git-4c39892-win32-static.7z shows the fatal error.

I wrongfully assumed a ffmpeg commit was the culprit for this error, as I've recently found out that with AbeChin's ffmpeg builds I could once again use the libx264 video encoder. Examining its build configuration and comparing it to mine I found original_cflags='-mtune=core2 -O3' to be the cause and original_cflags='-mtune=generic -mfpmath=sse -msse' to be the solution for my non-sse2 cpu.

diff:

--- cross_compile_ffmpeg.sh   2017-03-29 18:00:27.875000000 +0200
+++ cross_compile_ffmpeg.sh   2017-04-02 09:47:21.765625000 +0200
@@ -1481,7 +1481,7 @@ build_ffmpeg() {
     # avoid installing this to system?
     postpend_configure_opts="$postpend_configure_opts --prefix=$final_install_dir --disable-libgme" # gme broken for shared as of yet TODO...
   else
-    postpend_configure_opts="--enable-static --disable-shared $postpend_configure_opts --prefix=$mingw_w64_x86_64_prefix"
+    postpend_configure_opts="$postpend_configure_opts --prefix=$mingw_w64_x86_64_prefix" # --enable-static and --disable-shared are the default values already
   fi

   do_git_checkout $git_url $output_dir $ffmpeg_git_checkout_version 
@@ -1521,7 +1521,7 @@ build_ffmpeg() {
     #  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

-  config_options="$config_options --enable-runtime-cpudetect" # not sure what this even does but this is the most compatible
+  #config_options="$config_options --enable-runtime-cpudetect" # enabled by default nowadays and --disable-runtime-cpudetect to disable

   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
   if [[ "$do_debug_build" = "y" ]]; then
@@ -1729,7 +1729,8 @@ git_get_latest=y
 prefer_stable=y
 build_intel_qsv=n
 #disable_nonfree=n # have no value by default to force user selection
-original_cflags='-mtune=core2 -O3' #  be careful, these override lots of stuff in makesfiles :|
+#original_cflags='-mtune=core2 -O3' #  be careful, these override lots of stuff in makesfiles :|
+original_cflags='-mtune=generic -mfpmath=sse -msse' # for non-sse2 cpus
 # if you specify a march it needs to first so x264's configure will use it :|
 build_x264_with_libav=n
 ffmpeg_git_checkout_version=

ffmpeg-N-85093-g7942907-win32-static_legacy.7z

rdp commented 7 years ago

OK adjusted it in af7a79a

On Sun, Apr 2, 2017 at 7:21 AM, Reino Wijnsma notifications@github.com wrote:

https://ffmpeg.zeranoe.com/forum/viewtopic.php?f=13&t=3572#p10122:

Today when I did some testing with -c:v libx264 another fatal error popped up:

The exception Illegal Instruction An attempt was made to execute an illegal instruction. (0xc000001d) occurred in the application at location 0x011e166a.

I have narrowed it down to ffmpeg-20150823-git-1bf76cd-win32-static.7z being the latest working build. ffmpeg-20150825-git-4c39892-win32-static.7z shows the fatal error.

I wrongfully assumed a ffmpeg commit was the culprit for this error, as I've recently found out that with AbeChin's ffmpeg builds http://blog.k-tai-douga.com/category/359294-1.html I could once again use the libx264 video encoder. Examining its build configuration and comparing it to mine I found original_cflags='-mtune=core2 -O3' to be the cause and original_cflags='-mtune=generic -mfpmath=sse -msse' to be the solution for my non-sse2 cpu.

diff:

--- cross_compile_ffmpeg.sh 2017-03-29 18:00:27.875000000 +0200+++ cross_compile_ffmpeg.sh 2017-04-02 09:47:21.765625000 +0200@@ -1481,7 +1481,7 @@ build_ffmpeg() {

avoid installing this to system?

 postpend_configure_opts="$postpend_configure_opts --prefix=$final_install_dir --disable-libgme" # gme broken for shared as of yet TODO...

else- postpend_configure_opts="--enable-static --disable-shared $postpend_configure_opts --prefix=$mingw_w64_x86_64_prefix"+ postpend_configure_opts="$postpend_configure_opts --prefix=$mingw_w64_x86_64_prefix" # --enable-static and --disable-shared are the default values already fi

do_git_checkout $git_url $output_dir $ffmpeg_git_checkout_version @@ -1521,7 +1521,7 @@ build_ffmpeg() {

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

  • config_options="$config_options --enable-runtime-cpudetect" # not sure what this even does but this is the most compatible+ #config_options="$config_options --enable-runtime-cpudetect" # enabled by default nowadays and --disable-runtime-cpudetect to disable

    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 if [[ "$do_debug_build" = "y" ]]; then@@ -1729,7 +1729,8 @@ git_get_latest=y prefer_stable=y build_intel_qsv=n

    disable_nonfree=n # have no value by default to force user selection-original_cflags='-mtune=core2 -O3' # be careful, these override lots of stuff in makesfiles :|+#original_cflags='-mtune=core2 -O3' # be careful, these override lots of stuff in makesfiles :|+original_cflags='-mtune=generic -mfpmath=sse -msse' # for non-sse2 cpus

    if you specify a march it needs to first so x264's configure will use it :|

    build_x264_with_libav=n ffmpeg_git_checkout_version=

ffmpeg-N-85093-g7942907-win32-static_legacy.7z http://rwijnsma.home.xs4all.nl/files/ffmpeg/ffmpeg-N-85093-g7942907-win32-static_legacy.7z

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rdp/ffmpeg-windows-build-helpers/issues/219#issuecomment-290986078, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAw0Amgg0tro_9mZMrBIdqvg8hoMz7Eks5rr6DmgaJpZM4Mtr3W .

hydra3333 commented 7 years ago

Just wondering, at some point would 'cross_compile_ffmpeg.sh' be updated to use some/many/all of the later library source code versions (as patched) as shown above ?

edit: never mind, making mods to align with the later versions zeranoe mentions on his build website, and hope they build without requiring further patches

rdp commented 7 years ago

Yeah it's somewhat of a low prio right now, if somebody wants to send it as a diff though I could definitely apply that. I did bump the openssl version recently, that's about it though...

On Fri, Apr 7, 2017 at 5:05 PM, hydra3333 notifications@github.com wrote:

Just wondering, at some point would 'cross_compile_ffmpeg.sh' be updated to use some/many/all of the later library source code versions as shown above ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rdp/ffmpeg-windows-build-helpers/issues/219#issuecomment-292672155, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAw0AAdDkWII9awbRpI5JaIca9G1ZAIks5rtsE8gaJpZM4Mtr3W .

hydra3333 commented 7 years ago

OK not being very clever, if I can I'll update your generic (non-OpenCL :)) script and post a diff file. He he, google here I come ...

hydra3333 commented 7 years ago

OK, attached is (i) a proposed patch cross_compile_ffmpeg.patch (non-XP safe) (ii) together with a companion libopus.patch patch to be uploaded into https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/libopus.patch

Summary of Changes:

  1. the external library software versions to be built should align more closely with Zeranoe's build
  2. some other external library software versions have been updated
  3. one or two have been moved to GIT rather than vanilla download
  4. x264 now downloads the master from GIT rather than the stable, to get the latest and greatest updates
  5. build_x264_with_libav defaults to yes so that x264 can input mpeg files
  6. build_lsw defaults to yes ...
  7. building lsw now forces a second rebuild of lsw then of libx264, so that x264 gets built with LSMASH and thus can output .mp4 files directly
  8. enable_opencl defaults to no (with no commandline option either)
  9. provision has been made for future nvidia openCL integration 9.1 gendef now gets built with the mingw toolchain; dlltool is a dependency which apparently gets built by the mingw toolchain 9.2 however building with OpenCL requires pre-copying of NVIDIA openCL .DLL files, and relvant KHRONOS headers so, after extracting ffmpeg-windows-build-helpers-master to a local folder, run this first in Windows (later, I manually copy the updated ffmpeg-windows-build-helpers-master folder into an ubuntu VM to then use the script to build ffmpeg)
    echo on
    ECHO "Copy this file c:\Windows\System32\OpenCL.dll into ~/Desktop/ffmpeg-windows-build-helpers-master/openclx64/ for 64 bit "
    ECHO "Copy this file c:\Windows\Syswow64\OpenCL.dll into ~/Desktop/ffmpeg-windows-build-helpers-master/openclx32/ for 32 bit "
    mkdir .\openclx64
    mkdir .\openclx32
    copy /b /z /y /v /d c:\Windows\System32\OpenCL.dll .\openclx64\OpenCL.dll
    copy /b /z /y /v /d c:\Windows\Syswow64\OpenCL.dll .\openclx32\OpenCL.dll
    mkdir .\ffmpeg-windows-build-helpers-master\openclx32
    copy /b /z /y /v /d .\openclx32\*.* .\ffmpeg-windows-build-helpers-master\openclx32\*.*
    mkdir .\ffmpeg-windows-build-helpers-master\openclx64
    copy /b /z /y /v /d .\openclx64\*.* .\ffmpeg-windows-build-helpers-master\openclx64\*.*
    pause
    exit

    6.3 OpenCL 1.2 headers are downloaded from Khronos (v1.2 works for nvidia moderate range GPUs eg 750Ti)

cross_compile_ffmpeg.patch.txt libopus.patch.txt edit: don't use these patches, refer issue below, ... reviewing the script and will suggest another in due course.

Notes: If you wanted, you could omit the OpenCL provisioning, since the KHRONOS opencl header file versions can get fairly specific to the nvidia video card. However, if you leave it in, it's a basic example of how to go about it.

No luck with openjpeg 2.1.2 as yet. edit: openjpeg 2.1.2 issue fixed, refer below

And, as always, I am happy to be corrected.

And, many thanks to Reino17.

hydra3333 commented 7 years ago

No, please don't use that patch.

ffmpeg now throws an error "the program can's start because libgme.dll is missing from your computer. try reinstalling the program to fix this problem." :(

Jolly, bother, and dash it all.

jpham986 commented 7 years ago

can someone fix the binutils ? I'm still getting

make[4]: Entering directory '/cygdrive/g/ffmpeg_work/f11/bhelper/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/pkgs/binutils/build/x86_64-w64-mingw32/ld' /bin/sh ./libtool --tag=CC --mode=link gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -DELF_LIST_OPTIONS=FALSE -DELF_SHLIB_LIST_OPTIONS=FALSE -DELF_PLT_UNWIND_LIST_OPTIONS=FALSE -g -O2 -Wl,--stack,12582912 -o ld-new.exe ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o plugin.o ldbuildid.o ei386pep.o ei386pe.o deffilep.o pep-dll.o pe-dll.o ../bfd/libbfd.la ../libiberty/libiberty.a libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -DELF_LIST_OPTIONS=FALSE -DELF_SHLIB_LIST_OPTIONS=FALSE -DELF_PLT_UNWIND_LIST_OPTIONS=FALSE -g -O2 -Wl,--stack -Wl,12582912 -o ld-new.exe ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o plugin.o ldbuildid.o ei386pep.o ei386pe.o deffilep.o pep-dll.o pe-dll.o ../bfd/.libs/libbfd.a -L/cygdrive/g/ffmpeg_work/f11/bhelper/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/pkgs/binutils/build/x86_64-w64-mingw32/zlib -lz ../libiberty/libiberty.a ldlex-wrapper.o: In function yylex': /cygdrive/g/ffmpeg_work/f11/bhelper/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/pkgs/binutils/build/x86_64-w64-mingw32/ld/../../../source/binutils-2.27/ld/ldlex.c:3352: undefined reference toyywrap' ldlex-wrapper.o: In function input': /cygdrive/g/ffmpeg_work/f11/bhelper/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/pkgs/binutils/build/x86_64-w64-mingw32/ld/../../../source/binutils-2.27/ld/ldlex.c:3655: undefined reference toyywrap' collect2: error: ld returned 1 exit status make[4]: *** [Makefile:1143: ld-new.exe] Error 1 make[4]: Leaving directory '/cygdrive/g/ffmpeg_work/f11/bhelper/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/pkgs/binutils/build/x86_64-w64-mingw32/ld'

On Sat, Apr 8, 2017 at 6:35 PM, hydra3333 notifications@github.com wrote:

No, please don't use that patch.

ffmpeg now throws an error "the program can's start because libgme.dll is missing from your computer. try reinstalling the program to fix this problem." :(

Jolly, bother, and dash it all.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rdp/ffmpeg-windows-build-helpers/issues/219#issuecomment-292757481, or mute the thread https://github.com/notifications/unsubscribe-auth/ATj-X2oPSgnblecn19ccuAW7g9QNZFrGks5ruDXRgaJpZM4Mtr3W .

hydra3333 commented 7 years ago

OK, ffmpeg built like this doesn't appear to crash. Attached is (i) a proposed patch cross_compile_ffmpeg.patch (non-XP safe) (ii) together with a new companion libopus.patch patch to be uploaded by rdp into this place https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/libopus.patch

Files: cross_compile_ffmpeg.patch.txt libopus.patch.txt cross_compile_ffmpeg_updated_versions_temp.sh.txt

Summary of Changes:

  1. external library software versions should align more closely with Zeranoe's build or newer per Reino17
  2. other external library software versions have been updated, and some source links have changed too since I got an occasional "connection refused"
  3. one or two libraries have changed to use GIT rather than vanilla fixed version download
  4. x264 now downloads the master from GIT rather than the stable, to get the latest and greatest updates (a lot of new and good things happen and we desire them)
  5. build_x264_with_libav defaults to yes so that x264 can input mpeg files directly
  6. build_lsw defaults to yes ...
  7. build_lsw=y now forces a second rebuild of lsw and then of libx264, so that x264.exe gets built with LSMASH and thus can output .mp4 files directly
  8. enable_opencl defaults to no (with no commandline option either) since nvidia based openCL can be somewhat card group specific
  9. provision has been made for future nvidia based openCL integration (enable_opencl=y) 9.1 gendef now gets built with the mingw toolchain; dlltool is a dependency which apparently gets built by the mingw toolchain 9.2 however building with OpenCL requires pre-copying the x32 and x64 NVIDIA openCL .DLL files, and relevant KHRONOS headers of the right version (eg v1.2 for 750Ti) so, after extracting ffmpeg-windows-build-helpers-master to a local folder, run this first in Windows (later, I manually copy the updated ffmpeg-windows-build-helpers-master folder into an ubuntu VM to then use the files in the folders and the script to build ffmpeg with openCL)
    echo on
    ECHO "Copy this file c:\Windows\System32\OpenCL.dll into ~/Desktop/ffmpeg-windows-build-helpers-master/openclx64/ for 64 bit "
    ECHO "Copy this file c:\Windows\Syswow64\OpenCL.dll into ~/Desktop/ffmpeg-windows-build-helpers-master/openclx32/ for 32 bit "
    mkdir .\openclx64
    mkdir .\openclx32
    copy /b /z /y /v /d c:\Windows\System32\OpenCL.dll .\openclx64\OpenCL.dll
    copy /b /z /y /v /d c:\Windows\Syswow64\OpenCL.dll .\openclx32\OpenCL.dll
    mkdir .\ffmpeg-windows-build-helpers-master\openclx32
    copy /b /z /y /v /d .\openclx32\*.* .\ffmpeg-windows-build-helpers-master\openclx32\*.*
    mkdir .\ffmpeg-windows-build-helpers-master\openclx64
    copy /b /z /y /v /d .\openclx64\*.* .\ffmpeg-windows-build-helpers-master\openclx64\*.*
    pause
    exit

    9.3 OpenCL 1.2 headers are downloaded from Khronos (v1.2 works for nvidia moderate range GPUs eg 750Ti)

Notes: If you wanted, you could omit the OpenCL provisioning, since the KHRONOS opencl header file versions can get fairly specific to the nvidia video card. However, if you leave it in, it's a basic example of how to go about it.

Many thanks to Reino17 and schmidthubert ... and rdp.

I am happy to be corrected.

ghost commented 7 years ago

I see you're having fun ... :)

I checked and found 2 things: libcaca => beta19 and xvid => 1.3.4

Also patches/mingw-w64-build-3.6.7.local has a hardcoded "gmp-6.1.1" at line 690 which should be changed to "gmp-$gmp_release_ver" because we're at 6.1.2 now and that version is working fine for me and so is mpfr_release_ver='3.1.5' in the same file :)

Also you can add --enable-libkvazaar to the configure options now. Its LGPL not GPL, so add globally, here goes:

config_options="$init_options --enable-libkvazaar ...

plus:

build_libkvazaar() { #example: ffmpeg -y -i input.mp4 -c:v libkvazaar -kvazaar-params "threads=auto,preset=medium,wpp=1" -rc vbr -b:v 1500k -maxrate 2000k -vf scale=1280:-1 -c:a copy output.mp4 do_git_checkout https://github.com/ultravideo/kvazaar.git cd kvazaar_git # apply_patch file://localhost$(pwd)/../../../patches/kvazaar_rdo_gcc7snapshot.patch # ATM only needed for gcc7+ sed -i.bak 's/^AM_PROG_AR$/m4_ifdef([AM_PROG_AR], [AM_PROG_AR])/' configure.ac do_configure "--prefix=$mingw_w64_x86_64_prefix --host=$host_target --disable-shared" do_make_and_make_install sed -i.bak 's/Cflags: -I${incdir}$/Cflags: -I${incdir} -DKVZ_STATIC_LIB/' "$PKG_CONFIG_PATH/kvazaar.pc" cd .. }

plus the obvious:

build_dependencies() { build_libkvazaar build_libdlfcn ...

Attached patch not needed for rdp's build then ... ;)

kvazaar_rdo_gcc7snapshot.patch.txt

hydra3333 commented 7 years ago

Thank you, I did have some fun learning :) and will check the things you raised (only rdp can change his patches/mingw-w64-build-3.6.7.local although I suppose ordinary illiterate peasants like me can create a local copy to try out the change) ... suggestions on a free web host which allows direct downloads with the filename on the end of the url (as is required by one of the functions) would be welcome.

"xvid => 1.3.4" ... xvid isn't built (the function is there though) as Reino17 linked to an ffmpeg web page which suggested it was now handled "internally".

kvazaar ... an open-source HEVC encoder ... looks interesting ... kvazaar_rdo_gcc7snapshot.patch.txt held in abeyance (and anticipation) until gcc v7 arrives in rdp's script and zeranoe's toolchain, then :)

ghost commented 7 years ago

kvazaar was promising but since libx265 has made so much progress and has good speed now (for those who (have to) rely on Intels GPU and don't own Nvidia GTX's) then there's not much "use", I just added it in case anyone (still) wants it :)

As for xvid handled internally I'll check!

ghost commented 7 years ago

Nope, xvid code still comes from xvid. What's inside is the "handling" as in eg. "--enable-libkvazaar" before. But the lib has to be supplied. Check the following, this is what happens if you try to configure ffmpeg under linux with just --enable-gpl and --enable-xvid, no further switches:

me@console:/tmp/ffmpeg# grep -inr xvid_version * libavcodec/libxvid.c:136: XVID_VERSION_MAJOR(XVID_VERSION), libavcodec/libxvid.c:137: XVID_VERSION_MINOR(XVID_VERSION), libavcodec/libxvid.c:138: XVID_VERSION_PATCH(XVID_VERSION)); libavcodec/libxvid.c:482: xvid_gbl_init.version = XVID_VERSION; libavcodec/libxvid.c:490: xvid_enc_create.version = XVID_VERSION; libavcodec/libxvid.c:506:#if (XVID_VERSION <= 0x010303) && (XVID_VERSION >= 0x010300) libavcodec/libxvid.c:528: rc2pass1.version = XVID_VERSION; libavcodec/libxvid.c:544: rc2pass2.version = XVID_VERSION; libavcodec/libxvid.c:576: single.version = XVID_VERSION; libavcodec/libxvid.c:778: xvid_enc_frame.version = XVID_VERSION; libavcodec/libxvid.c:779: xvid_enc_stats.version = XVID_VERSION; me@console:/tmp/ffmpeg# ./configure --enable-gpl --enable-libxvid ERROR: libxvid not found If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "config.log" produced by configure as this will help solve the problem. me@console:/tmp/ffmpeg# cd ../xvidcore me@console:/tmp/xvidcore# grep -inr xvid_version * ChangeLog:3850: set XVID_VERSION to 1.2.-127 [...] src/xvid.h:60:#define XVID_VERSION XVID_MAKE_VERSION(1,3,4) [...] me@console:/tmp/xvidcore#

As you can see even something as simple as the xvid version comes from extern ... libxvidcore.a is 1.1MB in size, that's compiled ...

ghost commented 7 years ago

The following should be missing if compiled without --enable-xvid (this is from ffmpeg -h full):

libxvid AVOptions: -lumi_aq E..V.... Luminance masking AQ (from 0 to 1) (default 0) -variance_aq E..V.... Variance AQ (from 0 to 1) (default 0) -ssim E..V.... Show SSIM information to stdout (from 0 to 2) (default off) off E..V.... avg E..V.... frame E..V.... -ssim_acc E..V.... SSIM accuracy (from 0 to 4) (default 2) -gmc E..V.... use GMC (from 0 to 1) (default 0) -me_quality E..V.... Motion estimation quality (from 0 to 6) (default 0) -mpeg_quant E..V.... Use MPEG quantizers instead of H.263 (from 0 to 1) (default 0)

ghost commented 7 years ago

https://www.ffmpeg.org/ffmpeg-all.html#libxvid

"The native mpeg4 encoder supports the MPEG-4 Part 2 format, so users can encode to this format without this library"

So that's all that's handled "internally" ..

Reino17 commented 7 years ago

@hydra3333

-      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

What does --enable-gendef do?

  1. x264 now downloads the master from GIT rather than the stable, to get the latest and greatest updates
-  do_git_checkout "https://github.com/cisco/openh264.git" openh264 24916a652ee5d3
+  download_and_unpack_file https://github.com/cisco/openh264/archive/v1.6.0.tar.gz openh264-1.6.0

Why then move away from git for OpenH264?

-  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

I have no problem connecting to http://tukaani.org/xz/xz-5.2.3.tar.bz2.

+  #apply_patch http://rwijnsma.home.xs4all.nl/files/ffmpeg/libopus.patch # allow it to work with shared builds

https://github.com/rdp/ffmpeg-windows-build-helpers/issues/218#issuecomment-292717900:

Yes, OK changed to that now, however the updated patch by Reino17 still seems to need to be applied to the GIT version..

Judging opus_defines.h from git, then yes, probably. However, I only do static builds, so someone should test compiling a shared build.

+  generic_download_and_make_and_install https://www.fribidi.org/download/fribidi-0.19.7.tar.bz2 # 1.19.7 doesn't need patching ?

https://github.com/rdp/ffmpeg-windows-build-helpers/issues/219#issue-218039600:

Judging the v0.19.7's source-code, the patch isn't needed anymore.

-  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

I have no problem connecting to https://fossies.org/linux/misc/bzip2-1.0.6.tar.gz.

+  # 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

I have no problem building v2.7.1. Maybe the fact that I'm using the latest WinXP compatible Cygwin has something to do with it? It's v2.874 from 25 Aug 2016 and you're using the latest version for Win7 and up, I take it?

+  # 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

My '_cross_compileffmpeg.log' already mentioned that.

+  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"
...
+  generic_download_and_make_and_install https://github.com/google/snappy/releases/download/1.1.4/snappy-1.1.4.tar.gz
...
+  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  

Thanks! libgme and libopenjpeg are built without problems now. Now those that remain unsuccessful are:

gsm-1.0-pl14          --> gsm-1.0-pl16
libtheora-1.2.0alpha1 --> theora_git (libpng-1.5.26 --> libpng-1.6.29)
vamp-plugin-sdk-2.6   --> vamp-plugin-sdk-2.7.1
libsamplerate-0.1.8   --> libsamplerate-0.1.9
libcaca-0.99.beta18   --> libcaca-0.99.beta19
libdvdread-4.9.9      --> libdvdread-5.0.3
libdvdnav-4.2.1       --> libdvdnav-5.0.3
libdvdcss-1.2.13      --> libdvdcss-1.4.0
libbluray-0.7.0       --> libbluray-1.0.0


I would advice you to include:

-  download_and_unpack_file https://www.openssl.org/source/openssl-1.1.0e.tar.gz
-  cd openssl-1.1.0e
+  download_and_unpack_file https://www.openssl.org/source/openssl-1.0.2k.tar.gz # This setup needs an update for OpenSSL 1.1.x. See https://github.com/rdp/ffmpeg-windows-build-helpers/issues/214#issuecomment-288736482.
+  cd openssl-1.0.2k

If someone wants to build FFMpeg with OpenSSL, then at least he won't get any errors. Or someone has to update build_openssl() {...}.

+  download_and_unpack_file https://github.com/libjpeg-turbo/libjpeg-turbo/archive/1.5.1.tar.gz libjpeg-turbo-1.5.1
+  download_and_unpack_file https://www.lua.org/ftp/lua-5.3.4.tar.gz
+  generic_download_and_make_and_install https://curl.haxx.se/download/curl-7.53.1.tar.gz

I'm only using rdp's script to build FFMpeg, but for other stuff you can then also update (untested of course):

+  download_and_unpack_file http://pkgs.fedoraproject.org/repo/pkgs/qt/qt-everywhere-opensource-src-4.8.7.tar.gz/d990ee66bf7ab0c785589776f35ba6ad/qt-everywhere-opensource-src-4.8.7.tar.gz
+  download_and_unpack_file http://downloads.xvid.org/downloads/xvidcore-1.3.4.tar.gz xvidcore


+prefer_stable=n # get the latest by default, we want the latest and greatest don't we ?

I've seen that this only applies to x265. I hardly have any experience with Shell script, but wouldn't the following work and wouldn't it be appropriate to implement this for x264 as well?

if [[ $prefer_stable = "n" ]]; then
  do_git_checkout "http://git.videolan.org/git/x264.git" $checkout_dir "origin/master"
else
  do_git_checkout "http://git.videolan.org/git/x264.git" $checkout_dir "origin/stable"
fi


build_x264_with_libav defaults to yes so that x264 can input mpeg files directly

I'd say, keep the default "no". I think the majority of users of this script use it to build FFMpeg and not x264. It takes another 60-90min to build a FFMpeg without libx264 for this.

Ok, with '_cross_compileffmpeg.sh' ('_cross_compileffmpeg.diff') I've successfully built ffmpeg-N-85396-g20f7872-win32-static_legacy.7z. Compared to last one:

game-music-emu-0.6.0     --> game-music-emu-0.6.1
snappy-1.1.3-14-g32d6d7d --> snappy-1.1.4
openjpeg-1.5.2           --> openjpeg-2.1.2


@jpham986 See https://github.com/rdp/ffmpeg-windows-build-helpers/issues/201#issuecomment-285940185. I haven't tested it, because I'm still on WinXP, but this should be a workaround.

Reino17 commented 7 years ago

@schmidthubert

I checked and found 2 things: libcaca => beta19 ...

My '_cross_compileffmpeg.sh':

# beta19 and git are xp unfriendly. libcaca-0.99.beta19 and FFMpeg are compiled without
problems, but FFMpeg then returns: "The procedure entry point _vsnprintf_s could not be
located in the dynamic link library msvcrt.dll". See http://caca.zoy.org/changeset/4822
and http://caca.zoy.org/changeset/4823 ?


Nope, xvid code still comes from xvid.

Well, that's a surprise then. I don't use XviD anymore, but is it bad to not have these options anymore for diehard XviD-encoders? What about WavPack? Does the built-in implementation also have limitations? I've just quickly done some decoding and encoding and all went fine.

ghost commented 7 years ago

Just some points:

I have no problem connecting to ...

Well I prefer to stick with bitbucket, sourceforge, github etc as 1.) who knows what some tuukani (Tumbuktu?) website is doing with/to some sourcecode and 2.) who knows if such a site will still be there in a couple of days ...

gendef

It exist to rip of some info off ie. DLL's for which no sourcecode is provided, NVidia in this case.

old openssl

These days a lot is going on with SSL, TLS etc, so most people 1.) have the 10 bucks to buy a legit Windows 7 CD on ebay and 2.) want to have the most recent openssl version they can find => security holes etc ..

libcaca beta19 / _vsnprintf_s win xp

I understand all that but this is a script for the "majority". It shouldn't be a problem to stick with your version and then just do a compare to rdp's (there's graphical diff tools for that you know) and then only cherry pick from rdp's script(s) what you need in the future ...

ghost commented 7 years ago

wavpack

The same as for xvid applies:

doc/encoders.texi:1181:A wrapper providing WavPack encoding through libwavpack. doc/encoders.texi:1185:Requires the presence of the libwavpack headers and library during [...] doc/encoders.texi:1187:@code{--enable-libwavpack}.

ghost commented 7 years ago

me@console:/tmp/ffmpeg# ./configure --enable-libwavpack ERROR: libwavpack not found

ghost commented 7 years ago

But you're more lucky there as it seems: https://www.ffmpeg.org/ffmpeg-all.html#wavpack

"This is a libavcodec-native WavPack encoder. There is also an encoder based on libwavpack, but there is virtually no reason to use that encoder."

So it seems you need --with-libav then, just check your exe-helpfiles ... edit: I'm not really sure here, you should google for some ffmpeg example cmdlines howto use that etc.

ghost commented 7 years ago

I don't use XviD anymore, but is it bad to not have these options anymore for diehard XviD-encoders?

Some old devices like old mobile phones and tablets etc can still deal with xvid but not hevc so xvid is still in use today :)

Reino17 commented 7 years ago

Well I prefer to stick with bitbucket, sourceforge, github etc

You have a point there.

These days a lot is going on with SSL, TLS etc, so most people 1.) have the 10 bucks to buy a legit Windows 7 CD on ebay and 2.) want to have the most recent openssl version they can find => security holes etc ..

Are you saying you had success building OpenSSL 1.1.0e with it's current configuration?

I understand all that but this is a script for the "majority".

I started this 'issue' with "This is a report rather than an 'issue'.". So it was never my intention to demand for my cross_compile_ffmpeg.sh to be used. I just report. :)

So it seems you need --with-libavcodec then, just check your exe-helpfiles ...

Could you elaborate on this? Need it for what and where?

Some old devices like old mobile phones and tablets etc can still deal with xvid but not hevc so xvid is still in use today :)

But are these options really needed for old devices? Wouldn't ffmpeg -i input.avi -c:v mpeg4 -vtag xvid output.avi create a good enough output?

ghost commented 7 years ago

openssl just builds normally for me, no exports and no unsets as in rdp's script: build_openssl() { download_and_unpack_file https://www.openssl.org/source/openssl-1.1.0e.tar.gz cd openssl-1.1.0e if [ "$bits_target" = "32" ]; then do_configure "--prefix=$mingw_w64_x86_64_prefix no-shared no-asm mingw" ./Configure else do_configure "--prefix=$mingw_w64_x86_64_prefix no-shared no-asm mingw64" ./Configure fi cpu_count=1 do_make_and_make_install "$make_prefix_options" cpu_count=$original_cpu_count cd .. }

Need it for what and where?

I thought it was you who needed that wavpack functionality? That's why I wrote you should check all your ffmpeg exe's help to find "wavpack". If not we can forget about this ...

But are these options really needed for old devices? Wouldn't ffmpeg -i input.avi -c:v mpeg4 -vtag xvid output.avi create a good enough output?

Yes, but no "finetuning" then, no parameters, nothing then. Check the complete xvid options, none of that is available then.

ghost commented 7 years ago

Here are some screens from xvid if installed standalone, all this functionality is missing from ffmpeg then if compiled without xvid lib. http://www.computerbild.de/download/Xvid-1158807.html

ghost commented 7 years ago

I wrote:

openssl just builds normally for me

Sorry, but that's nonsense as it's been long commented out in build_dependencies(). I thought it was at least still building but just not included anymore at the end. But not so, sorry for that! :(

Reino17 commented 7 years ago

So you also got ERROR: openssl not found with OpenSSL 1.1.0e?

I thought it was you who needed that wavpack functionality?

Who doesn't? But why include libwavpack when wavpack can do everything too? In the meantime I've noticed:

ffmpeg.exe -hide_banner -h encoder=wavpack
Encoder wavpack [WavPack]:
    General capabilities: small
    Threading capabilities: none
    Supported sample formats: u8p s16p s32p fltp
WavPack encoder AVOptions:
  -joint_stereo      <boolean>    E...A...  (default auto)
  -optimize_mono     <boolean>    E...A...  (default false)

ffmpeg.exe -hide_banner -h encoder=libwavpack
Encoder libwavpack []:
    General capabilities: delay small
    Threading capabilities: none
    Supported sample formats: s32

Every 16bit audio you feed to libwavpack it converts to 32bit, as somehow that's all it supports...

ffmpeg.exe -i "input.wav" -c:a wavpack -compression_level 4 "output.wv" works just fine (where -compression_level 4 equals wavpack's -hhx2), so libwavpack isn't needed at all.

Btw, I still don't understand what you meant with --with-libavcodec. Is it a valid parameter? It's not in FFMpeg's configure at least.

Yes, but no "finetuning" then, no parameters, nothing then. Check the complete xvid options, none of that is available then.

I've just done 2 quick XviD encodes on a 640x480 video sample. One with -c:v mpeg4 -vtag xvid -b:v 1000k, the other with -c:v libxvid -b:v 1000k. You can see right away that libxvid produces a better result than mpeg4. I'll include libxvid again next time. ;)

ghost commented 7 years ago

But why include libwavpack when wavpack can do everything too?

This is what I meant! All you had to do is check your ffmpeg's help ... :)

Btw, I still don't understand what you meant with --with-libavcodec

Sorry, I'm not familar with wavpack nor use it, wrong idea/track on my part in the rush ...

I'll include libxvid again next time. ;)

On the cmdline you'll have to make that an uppercase "-vtag XVID" as otherwise some important details are missing as you can see with tools like mediainfo etc ...

And just for fun openssl is already compiling again but now's got some libcrypto errors. Already got libs and .pc files :) Will try to check later this week if I get it working again. But that's a monster and complex anyway so I guess I'll stumble from one error to next etc, so I'm not sure! ...

hydra3333 commented 7 years ago

Why then move away from git for OpenH264?

Oops, sorry, my mistake, I'll revert to using GIT.

What does --enable-gendef do?

It's a prereqisite for building OpenCL for nvidia, it examines DLLs and gets information from them.

Nope, xvid code still comes from xvid.

Ah, OK, sorry, I'll reinstate libxvid in my OpenCL based patch.

I have no problem connecting to http://tukaani.org/xz/xz-5.2.3.tar.bz2

Neither did I until it refused connections circa 4 times in a row. Sourceforge worked https://sourceforge.net/projects/lzmautils/files/xz-5.2.3.tar.xz Half a dozen one or the other.

Yes, OK changed to that now, however the updated patch by Reino17 still seems to need to be applied to the GIT version.. Judging opus_defines.h from git, then yes, probably. However, I only do static builds, so someone should test compiling a shared build.

Yes I only do static builds too. Happy for someone to test it :)

fribidi Judging the v0.19.7's source-code, the patch isn't needed anymore.

OK.

download_and_unpack_file http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz I have no problem connecting to https://fossies.org/linux/misc/bzip2-1.0.6.tar.gz.

Yes. bzip is apparently the official site though.

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 I have no problem building v2.7.1. Maybe the fact that I'm using the latest WinXP compatible Cygwin has something to do with it? It's v2.874 from 25 Aug 2016 and you're using the latest version for Win7 and up, I take it?

OK I'll try it again (ubuntu 16.4.2 in a vm).

generic_download_and_make_and_install http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz # 0.1.9 fails to build

My 'cross_compile_ffmpeg.log' already mentioned that.

yes and thank you.

OK, will change my patch to use that for openssl, but not change to switch on the building of it ... I got a "big talking to" today from work's security buddahs about PCI-DSS requiring "offing" TLSv1.0 let alone SSL ...

OK. Will update my patch to use openssl-1.0.2k Do you know of these patches still apply ? --

    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

wouldn't it be appropriate to implement this for x264 as well?

if [[ $prefer_stable = "n" ]]; then
do_git_checkout "http://git.videolan.org/git/x264.git" $checkout_dir "origin/master"
else
do_git_checkout "http://git.videolan.org/git/x264.git" $checkout_dir "origin/stable"
fi

Yes. Fair enough. Will update my patch.

build_x264_with_libav defaults to yes so that x264 can input mpeg files directly I'd say, keep the default "no". I think the majority of users of this script use it to build FFMpeg and not x264. It takes another 60-90min to build a FFMpeg without libx264 for this.

Yes. Fair enough. Will update my patch. Also set build_lsw=n

I think I'll also reinstate wavpack anyway in my OpenCL based patch.

Having done this (well, Reino17 and schmidthubert having done all this) there's no guarantee that rdp will choose to use any parts of it. Oh well. Thanks for the fun.

hydra3333 commented 7 years ago

As at 2017.04.10, with the updates mentioned in the post above (as yet ex freetype v2.7.1 though), this OpenCL-based patch should result in a new script which appears to work per the changelist here https://github.com/rdp/ffmpeg-windows-build-helpers/issues/219#issuecomment-292779215 (assuming rdp uploads and hosts libopus.patch)

Attached is (i) a proposed patch cross_compile_ffmpeg.patch (non-XP safe) (ii) together with a new companion libopus.patch patch to be uploaded by rdp into this place https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/libopus.patch

Files: cross_compile_ffmpeg.patch.txt libopus.patch.txt

I invoke the patched rdp script (not XP safe) like this: (i) do the pre-build Windows OpenCL stuff mentioned above (ii) edit the patched rdp script to ensure enable_opencl=y, because I seriously covet enormous speed gains of using unsharp-with-OpenCL (iii) then call the patched rdp script from a script like this (if libopus.patch isn't "up" yet, I use another copy of it and edit the script to point to it)

#!/bin/bash
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
# gendef is installed with mingw
# and is for building libbluray 0.9.2
sudo apt-get install -y ant
set -x
cd ~/Desktop
sudo chmod 777 -R *
cd ffmpeg-windows-build-helpers-master
# multi
sudo ./cross_compile_ffmpeg_updated_versions.sh --cflags='-O3' --gcc-cpu-count=2 --sandbox-ok=y --build-ffmpeg-shared=n --build-ffmpeg-static=y --disable-nonfree=n --build-x264-with-libav=y --build-intel-qsv=y --build-libmxf=n --build-mp4box=y --build-mplayer=n --build-vlc=y --git-get-latest=y --prefer-stable=n --high-bitdepth=n --compiler-flavors=multi --enable-gpl=y --build-lsw=y
exit

Very many thanks to Reino17 and schmidthubert and rdp and others.

ghost commented 7 years ago

OK. Will update my patch to use openssl-1.0.2k

openssl 1.1.0e with --enable-openssl as well is building for me now again as follows:

build_openssl() { download_and_unpack_file https://www.openssl.org/source/openssl-1.1.0e.tar.gz cd openssl-1.1.0e export CC="${cross_prefix}gcc" export AR="${cross_prefix}ar" export RANLIB="${cross_prefix}ranlib" if [ "$bits_target" = "32" ]; then do_configure "--prefix=$mingw_w64_x86_64_prefix -static mingw" ./Configure else do_configure "--prefix=$mingw_w64_x86_64_prefix -static mingw64" ./Configure fi do_make_and_make_install unset CC unset AR unset RANLIB cd .. }

So not much of a change then after all. It was just again a question of a PROPER wipe ... :)

hydra3333 commented 7 years ago

Thank you.

"PROPER wipe ..."

https://github.com/rdp/ffmpeg-windows-build-helpers/issues/218#issuecomment-290991840

Deleting the sandbox isn't proper cleaning actually. There's $mingw_w64_x86_64_prefix/lib/* and headers/files etc left

https://github.com/rdp/ffmpeg-windows-build-helpers/issues/218#issuecomment-291002321

some people only delete the win32 and x86_64 folders inside the sandbox and keep the cross_compilers folder, and that's not good enough ...

Just to confirm, do you mean: when building a library, first check those folders for files which may have already been created by a previous run of that build function and remove them prior to running the function again ? Sort of like a pre-build cleanup in each function ? Or is there more to it than that ?
I suppose as a once-off way to find the files to be removed, an initial "ls -alR" of the sandbox/cross_compilers folder tree and then "again with a diff" after each function call would show the additional files to be removed as a "begin" phase of that function ?

Edit: not sure if that's what you meant at all nor if this assists, attached is a zip listing the files each function creates under folder cross_compilers diffs2.zipx.txt

ghost commented 7 years ago

It's not just the difference in files. It's because of the dependencies. There are/will be libs which are linked against "other components" (libs and object files etc). So if you change any of the "other components" like say the gnutls version then nettle MAY throw errors unless it's removed/rebuild as well etc. Standalone things which do not depend on anything else and for which no dependencies exist elsewhere, like for instance that recent kvazaar addition, can just simply be removed (just use find . '*kvazaar*' | xargs rm -fr) and be rebuild and it should compile/build without any further hassle/waste of time ..

hydra3333 commented 7 years ago

OK thank you schmidthubert. Based on your comment it seems uncertain what to remove other than delete the complete sandbox every time I suppose.

Playing around for my own purposes, in addition to the build library version updates I considered updating to gcc 6.3.0 etc, a bit like this using a locally updated copy of mingw-w64-build-3.6.7.local

#mingw_w64_release_ver='5.0.1' # or git :) #mingw_w64_ver='git'
mingw_w64_release_ver='5.0.2'
gcc_release_ver='6.3.0' 
gcc_old_release_ver='4.9.4' # default if none specified, was 4.9.4 cannot be same as gcc_release_ver above, apparently, as a note...
#mpfr_release_ver='3.1.3'
mpfr_release_ver='3.1.5'
mpc_release_ver='1.0.3'
#binutils_release_ver='2.27'
binutils_release_ver='2.28'
#gmp_release_ver='6.1.1'
gmp_release_ver='6.1.2'
isl_release_ver='0.16.1'
pthreads_w32_release_ver='2-9-1'

And then I re-read DeadSix27's work including a patch for GCC 6.3.0 weak references (?) and whatnot https://github.com/rdp/ffmpeg-windows-build-helpers/issues/211#issue-213185367

# 2017.04.11 patch per https://github.com/rdp/ffmpeg-windows-build-helpers/issues/211#issuecomment-290362233
#                  and https://github.com/DeadSix27/modular_cross_compile_script/blob/dev/mingw-build-script.sh
if [ "$gcc_ver" == "6.3.0" ]; then # We only support 6.3.0, patch the directx headers to work with vlc snd possibly other things, credits to: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-headers-git for the patches.
    cd "mingw-w64-$mingw_w64_ver"
        echo "Patching mingw headers"
        curl --retry 5 "https://raw.githubusercontent.com/DeadSix27/modular_cross_compile_script/master/patches/mingw/0003-dxgi-Add-missing-dxgi-1.2-structs-and-interfaces.patch" -O --fail || exit 1
        curl --retry 5 "https://raw.githubusercontent.com/DeadSix27/modular_cross_compile_script/master/patches/mingw/0004-d3d11-Add-missing-d3d11-1.1-structs-and-interfaces.patch" -O --fail || exit 1
        curl --retry 5 "https://raw.githubusercontent.com/DeadSix27/modular_cross_compile_script/master/patches/mingw/0005-bessel_complex.patch" -O --fail || exit 1
        curl --retry 5 "https://raw.githubusercontent.com/DeadSix27/modular_cross_compile_script/master/patches/mingw/0006-processor_format.patch" -O --fail || exit 1
        echo "applying patch 0003-dxgi-Add-missing-dxgi-1.2-structs-and-interfaces.patch"
        patch -p1 < "0003-dxgi-Add-missing-dxgi-1.2-structs-and-interfaces.patch"
        echo "applying patch 0004-d3d11-Add-missing-d3d11-1.1-structs-and-interfaces.patch"
        patch -p1 < "0004-d3d11-Add-missing-d3d11-1.1-structs-and-interfaces.patch"
        echo "applying patch 0005-bessel_complex.patch"
        patch -p1 < "0005-bessel_complex.patch"
        echo "applying patch 0006-processor_format.patch"
        patch -p1 < "0006-processor_format.patch"
        echo "Done"
    cd ..
fi

and

# 2017.04.11 patch per https://github.com/rdp/ffmpeg-windows-build-helpers/issues/211#issuecomment-290362233
#                  and https://github.com/DeadSix27/modular_cross_compile_script/blob/dev/mingw-build-script.sh
    if [ "$gcc_ver" == "6.3.0" ]; then #DeadSix27: Patch gcc 6.3.0 for mingw: https://github.com/Alexpux/MINGW-packages/issues/1580
        cd gcc-"$gcc_ver"
            echo "Patching GCC 6.3.0 weak refs"
            curl --retry 5 "https://raw.githubusercontent.com/DeadSix27/modular_cross_compile_script/master/patches/gcc_6_3_0_weak_refs_x86_64.patch" -O --fail || exit 1
            echo "applying patch"
            patch -p1 < "gcc_6_3_0_weak_refs_x86_64.patch"
            echo "Done"
        cd ..
    fi

Both the updated copy of mingw-w64-build-3.6.7.local and the updated cross_compile_ffmpeg_updated_versions.sh are attached, and now also include non-rdp patch file download dependencies. Oh well. mingw-w64-build-3.6.7.h3333.local.txt cross_compile_ffmpeg_updated_versions.sh.txt

Well, why not, gave it a whirl and the same thing which built under 4.9.4 built x32 and x64 under 6.3.0, without crashing at least. So far, so good, ffmpeg.exe doesn't crash immediately, showing

ffmpeg.exe -version -buildconf
ffmpeg version N-85457-g8378466 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (GCC)
configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --disable-w32threads --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 --enable-gpl --enable-libx264 --enable-libx265 --enable-frei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-libxavs --enable-libxvid --enable-avisynth --enable-libmfx --enable-avresample --extra-libs=-lpsapi --extra-libs=-lspeexdsp --extra-cflags=-O3 --enable-static --disable-shared --prefix=/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32 --enable-nonfree --enable-libfdk-aac --enable-opencl --enable-runtime-cpudetect
libavutil      55. 61.100 / 55. 61.100
libavcodec     57. 92.100 / 57. 92.100
libavformat    57. 72.100 / 57. 72.100
libavdevice    57.  7.100 / 57.  7.100
libavfilter     6. 84.101 /  6. 84.101
libavresample   3.  6.  0 /  3.  6.  0
libswscale      4.  7.100 /  4.  7.100
libswresample   2.  8.100 /  2.  8.100
libpostproc    54.  6.100 / 54.  6.100

However x264.exe no longer shows as built with lsmash support; I wonder what I did wrong.

x264.exe --help
x264 core:148 r2762 90a61ec
Syntax: x264 [options] -o outfile infile
Infile can be raw (in which case resolution is required),
  or YUV4MPEG (*.y4m),
  or Avisynth if compiled with support (yes).
  or libav* formats if compiled with lavf support (yes) or ffms support (no).
Outfile type is selected by filename:
 .264 -> Raw bytestream
 .mkv -> Matroska
 .flv -> Flash Video
 .mp4 -> MP4 if compiled with GPAC or L-SMASH support (no)
Output bit depth: 8 (configured at compile time)

Time to look for the build bug (it worked under 4.9.4) and then for some ffmpeg.exe crash-detection tests I suppose. At a guess, I suppose the updated scripts have compatibility broken for anything other than running under Ubuntu 16.04.2.

ghost commented 7 years ago

If the lsw + l-smash folders with contents are there then as I said before: run the script for a second time and check again or do some graphical diff to the stuff that worked before. I don't personally mind an additional run of the script as long as it's producing the expected result(s) at the end then that's OK for me :)

hydra3333 commented 7 years ago

yes, the updated script tries to auto re-run building lsw and x264 again a second time at the end (and appeared to have worked under 4.9.4) ... i'll try again under 6.3.0 and see.

ghost commented 7 years ago

a patch for GCC 6.3.0 weak references (?)

Here: https://github.com/rdp/ffmpeg-windows-build-helpers/issues/203#issuecomment-285281419

ghost commented 7 years ago

I wrote:

Attached patch not needed for rdp's build then ... ;) kvazaar_rdo_gcc7snapshot.patch.txt

That gcc7+ patch is not needed anymore, the issue is fixed now: https://github.com/ultravideo/kvazaar/issues/164#issuecomment-293237765

Reino17 commented 7 years ago

@hydra3333:

Do you know of these patches still apply ? --

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

No, sorry. Someone else should test that. I only use the script to build FFMpeg. I only noticed there was a new version available for qt-everywhere-opensource. That's all.

Files: cross_compile_ffmpeg.patch.txt libopus.patch.txt

As I'm still relatively new to Github, can you explain to me how you upload (temporary) files to someone's repository like this?

@schmidthubert:

openssl 1.1.0e with --enable-openssl as well is building for me now again...

Are you saying you had success building OpenSSL 1.1.0e with it's current configuration?

I should've asked: "... and compiling FFMpeg?!" Because I've also had succes building OpenSSL 1.1.0e with both configs (the original and yours), but got ERROR: openssl not found once FFMpeg finished configuring. I got this error without --enable-librtmp mind you, because...

Would you mind having a look at build_librtmp as well? With

build_librtmp() {
  #  download_and_unpack_file http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz rtmpdump-2.3 # 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"
  do_make_and_make_install "CRYPTO=OPENSSL OPT=-O2 CROSS_COMPILE=$cross_prefix SHARED=no prefix=$mingw_w64_x86_64_prefix" # Won't build: 'ERROR: librtmp not found using pkg-config'.
  sed -i.bak 's/-lrtmp -lz/-lrtmp -lwinmm -lz/' "$PKG_CONFIG_PATH/librtmp.pc"
  # also build .exe's for fun:
  cd ..
    #if [[ ! -f rtmpsuck.exe ]]; then # hacky not do it twice
    #  #TODO do_make here instead...not easy since it doesn't seem to accept env. variable for LIB_GNUTLS...
    #  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 ..
}

I'm getting:

making /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/rtmpdump_git/librtmp as $ PATH=/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin:$PATH make CRYPTO=OPENSSL OPT=-O2 CROSS_COMPILE=/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32- SHARED=no prefix=/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32 -j 1

rm -f *.o *.a *.so *.so.1 librtmp.pc
/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_OPENSSL  -O2    -c -o rtmp.o rtmp.c
In file included from handshake.h:86:0,
                 from rtmp.c:152:
dh.h: In function 'DHInit':
dh.h:256:12: error: dereferencing pointer to incomplete type
   MP_new(dh->g);
            ^
dh.h:171:19: note: in definition of macro 'MP_new'
 #define MP_new(m) m = BN_new()
                   ^
In file included from handshake.h:86:0,
                 from rtmp.c:152:
dh.h:258:10: error: dereferencing pointer to incomplete type
   if (!dh->g)
          ^
In file included from handshake.h:86:0,
                 from rtmp.c:152:
dh.h:261:15: error: dereferencing pointer to incomplete type
   MP_gethex(dh->p, P1024, res); /* prime P1024, see dhgroups.h */
               ^
dh.h:179:49: note: in definition of macro 'MP_gethex'
 #define MP_gethex(u, hex, res) res = BN_hex2bn(&u, hex)
                                                 ^
dh.h:267:14: error: dereferencing pointer to incomplete type
   MP_set_w(dh->g, 2); /* base 2 */
              ^
dh.h:172:38: note: in definition of macro 'MP_set_w'
 #define MP_set_w(mpi, w) BN_set_word(mpi, w)
                                      ^
In file included from handshake.h:86:0,
                 from rtmp.c:152:
dh.h:269:5: error: dereferencing pointer to incomplete type
   dh->length = nKeyBits;
     ^
dh.h: In function 'DHGenerateKey':
dh.h:296:32: error: dereferencing pointer to incomplete type
       res = isValidPublicKey(dh->pub_key, dh->p, q1);
                                ^
dh.h:296:45: error: dereferencing pointer to incomplete type
       res = isValidPublicKey(dh->pub_key, dh->p, q1);
                                             ^
In file included from handshake.h:86:0,
                 from rtmp.c:152:
dh.h:299:14: error: dereferencing pointer to incomplete type
    MP_free(dh->pub_key);
              ^
dh.h:178:30: note: in definition of macro 'MP_free'
 #define MP_free(mpi) BN_free(mpi)
                              ^
dh.h:300:14: error: dereferencing pointer to incomplete type
    MP_free(dh->priv_key);
              ^
dh.h:178:30: note: in definition of macro 'MP_free'
 #define MP_free(mpi) BN_free(mpi)
                              ^
In file included from handshake.h:86:0,
                 from rtmp.c:152:
dh.h:301:6: error: dereferencing pointer to incomplete type
    dh->pub_key = dh->priv_key = 0;
      ^
dh.h:301:20: error: dereferencing pointer to incomplete type
    dh->pub_key = dh->priv_key = 0;
                    ^
dh.h: In function 'DHGetPublicKey':
dh.h:317:17: error: dereferencing pointer to incomplete type
   if (!dh || !dh->pub_key)
                 ^
In file included from /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/include/openssl/asn1.h:24:0,
                 from /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/include/openssl/objects.h:916,
                 from /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/include/openssl/evp.h:27,
                 from /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/include/openssl/x509.h:23,
                 from /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/include/openssl/ssl.h:50,
                 from rtmp.c:60:
dh.h:320:20: error: dereferencing pointer to incomplete type
   len = MP_bytes(dh->pub_key);
                    ^
dh.h:320:9: note: in expansion of macro 'MP_bytes'
   len = MP_bytes(dh->pub_key);
         ^
In file included from handshake.h:86:0,
                 from rtmp.c:152:
dh.h:325:15: error: dereferencing pointer to incomplete type
   MP_setbin(dh->pub_key, pubkey + (nPubkeyLen - len), len);
               ^
dh.h:181:40: note: in definition of macro 'MP_setbin'
 #define MP_setbin(u,buf,len) BN_bn2bin(u,buf)
                                        ^
In file included from handshake.h:86:0,
                 from rtmp.c:152:
dh.h: In function 'DHComputeSharedSecretKey':
dh.h:367:36: error: dereferencing pointer to incomplete type
   if (isValidPublicKey(pubkeyBn, dh->p, q1))
                                    ^
In file included from rtmp.c:152:0:
handshake.h: In function 'InitRC4Encryption':
handshake.h:120:12: error: storage size of 'ctx' isn't known
   HMAC_CTX ctx;
            ^
handshake.h:125:3: warning: implicit declaration of function 'HMAC_CTX_init' [-Wimplicit-function-declaration]
   HMAC_setup(ctx, secretKey, 128);
   ^
handshake.h:127:3: warning: implicit declaration of function 'HMAC_CTX_cleanup' [-Wimplicit-function-declaration]
   HMAC_finish(ctx, digest, digestLen);
   ^
handshake.h:120:12: warning: unused variable 'ctx' [-Wunused-variable]
   HMAC_CTX ctx;
            ^
handshake.h: In function 'HMACsha256':
handshake.h:269:12: error: storage size of 'ctx' isn't known
   HMAC_CTX ctx;
            ^
handshake.h:269:12: warning: unused variable 'ctx' [-Wunused-variable]
rtmp.c: In function 'RTMP_ReadPacket':
rtmp.c:3555:7: warning: variable 'didAlloc' set but not used [-Wunused-but-set-variable]
   int didAlloc = FALSE;
       ^
make: *** [<builtin>: rtmp.o] Error 1

@hydra3333:

cleanup

Here's what I do to remove a external library (Windows user, mind you):

This works for me.

do_investigate() {...}

What does it do? Has it something to do with what I just explained?

+  # 2017.04.09 ... well, apparently 1.6.0 works, so why not try the latest GIT now and hope for the best ?
+  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]

do_git_checkout "https://github.com/cisco/openh264.git" is the latest git afaik. I don't know why rdp needs this specific commit. My latest FFMpeg build was successfully with OpenH264 like this.

hydra3333 commented 7 years ago

@Reino17 re

Files: cross_compile_ffmpeg.patch.txt libopus.patch.txt As I'm still relatively new to Github, can you explain to me how you upload (temporary) files to someone's repository like this?

I'm a linux dummy, I don't know how to use GIT either (as yet). A Pull ? I suspect @rdp would have to approve it (and the other new file dependencies as well, eg hosting the other patches) if he decides to use any portion of the script.

Do you know of these patches still apply ? -- 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 No, sorry. Someone else should test that. I only use the script to build FFMpeg. I only noticed there was a new version available for qt-everywhere-opensource. That's all.

I'm hoping a clever person could take a look, I don't use it.

do_investigate() {...} What does it do? Has it something to do with what I just explained?

Yes. That was a dummie's attempt at logging (via rolling diff's) what files the build functions create within any part of the cross-compiler's folder tree, with a view to then finding out more about dependencies and addressing them. The logging worked, but it turned out not to be useful, per https://github.com/rdp/ffmpeg-windows-build-helpers/issues/219#issuecomment-293183255 I gave up on it in the end, but left the code in since the logging did work.

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] do_git_checkout "https://github.com/cisco/openh264.git" openh264 is the latest git afaik. I don't know why rdp needs this specific commit. My latest FFMpeg build was successfully with OpenH264 like this.

Yes, silly me, I was a tad windy about changing it at the time. I'll pull that trigger now and google questions about it later, in true coder cowperson fashion :) do_git_checkout "https://github.com/cisco/openh264.git" openh264

Not touching OpenSSL in my own script until someone indicates a working build function (I don't use it), and I'm not sure rdp would want to touch any of my changes anyway so I'm likely to have to compare and change my script when rdo' releases updates.

I also see @DeadSix27 is active and making heaps of changes to the python built script over at https://github.com/DeadSix27/modular_cross_compile_script (my links to patches on his GIT site no longer work, so I need to fix them) ... and so am looking forward to DeadSix27's results.

ghost commented 7 years ago

@Reino17: I checked. It looks as if rtmpdump's openssl development stopped at some point, maybe in 2010 already. So it's not compatible with newer openssl versions anymore and therefore runs into these errors. Just search for "hmac_ctx_st" for instance and check its definition in openssl 1.0.2k and openssl.git, I'm running into similar errors as you:

make[1]: *** Waiting for unfinished jobs.... hashswf.c:292:12: error: field 'ctx' has incomplete type HMAC_CTX ctx; ^

I don't think anyone will fix/update rtmpdump's code to work again with newer openssl versions. WinXP is dead now anyway, and it's the time of TLS now. You should really spend those 20 bucks for Win7 / Win81 Pro now ... :bell:

Reino17 commented 7 years ago

https://rtmpdump.mplayerhq.hu/:

To build with all features enabled, you will also need a Cryptography library and the zlib compression library. It uses OpenSSL by default, but you can also use GnuTLS or PolarSSL instead.

If it's true what you say, then why would they still put this on their frontpage? I think I'll send them a mail one of these days about the error we got.

and it's the time of TLS now

I hope you don't believe OpenSSL only supports SSL. See https://en.wikipedia.org/wiki/Comparison_of_TLS_implementations#Protocol_support.

Anyway, I've already successfully built RTMPDump with GnuTLS (+nettle and gmp), so I'm good. But if you include OpenSSL in your script, then I'd say you'd also have to make it work for those who prefer OpenSSL over GnuTLS.

Apart from building OpenSSL, did you now also successfully built FFMpeg with OpenSSL 1.1.0e??

You should really spend those 20 bucks for Win7 / Win81 Pro now

I'd have to buy a completely new computer first. ;)

DeadSix27 commented 7 years ago

@Reino17 he means it doesn't support OpenSSL 1.1.x, only 1.0.x, a lot of sources have that issue, kinda annoying.

ghost commented 7 years ago

@Reino17

and it's the time of TLS now

I hope you don't believe OpenSSL only supports SSL. See >https://en.wikipedia.org/wiki/Comparison_of_TLS_implementations#Protocol_support.

Don't worry, I know which is which and what is what ...

Apart from building OpenSSL, did you now also successfully built FFMpeg with OpenSSL 1.1.0e??

Maybe you don't yet quite understand the concept of a program? If no code in a program is calling a certain function then no code of that function is actually included/(in ffmpeg mostly:statically) linked to/with that program. So if there are no openssl function calls from librtmp (because it's using gnutls now) then no code FROM openssl will be included/linked in/with ffmpeg.exe even if "ffmpeg -buildconf" shows BOTH --enable-gnutls AND --enable-openssl because that's just a BUILDCONF-"string" and "ffmpeg -protocols" will still/only tell you that ffmpeg can "speak" https and tls, that's all ... Try this: include "--enable-openssl" 3 times in $config_options, that will will help you zilch, it's still only a BUILDCONF-string without any further meaning regarding the function(s) of ffmpeg ...

You should really spend those 20 bucks for Win7 / Win81 Pro now

I'd have to buy a completely new computer first. ;)

I don't know any computer which doesn't work with Win7. There's Intel+AMD drivers for CPU+chipset even if older and in case your onboard USB or network card doesn't work there's PCI(e) cards with drivers for all OS's ...

Reino17 commented 7 years ago

@DeadSix27 That's probably because of https://www.openssl.org/docs/faq.html#MISC5

@schmidthubert

Maybe you don't yet quite understand the concept of a program? ...

I may be new to cross compiling, but that I do understand. But I wasn't talking about RTMPDump.

openssl 1.1.0e with --enable-openssl as well is building for me now again...

Are you saying you had success building OpenSSL 1.1.0e with it's current configuration?

I should've asked: "... and compiling FFMpeg?!" Because I've also had succes building OpenSSL 1.1.0e with both configs (the original and yours), but got ERROR: openssl not found once FFMpeg finished configuring. I got this error without --enable-librtmp mind you.

I actually should've asked: "Are you saying you had success building FFMpeg with --enable-openssl (OpenSSL 1.1.0.e) and without --enable-librtmp (because it doesn't work with OpenSSL at the moment anyway)? Because only then I get ERROR: openssl not found. And this again is most likely because of https://www.openssl.org/docs/faq.html#MISC5

ghost commented 7 years ago

Why do you want to include --enable-openssl at all again?

Reino17 commented 7 years ago

I'm fine with GnuTLS, but I was trying get the latest OpenSSL working.

Roger's script is publicly available for everyone to use. Eventhough GnuTLS is used at the moment in favour of OpenSSL, I'd try to make OpenSSL work for those who want to use it if it were my script. That's my opinion, but I realize now you have a completely different mindset.

ghost commented 7 years ago

Yes, and it's not just me. At least nobody but you is complaining ...

And openssl is working fine, everywhere and on a lot of Linux servers. Your problems are not openssl's fault. If projects like librtmp cannot or will not keep up with the pace then "the world" will work around such problems, it's really that easy. Luckily we have TLS now and prefer that over SSL :) It's not that SSL is dead at all but you can ask the rtmpdump programmers (and others) for their reasons as well ...

ghost commented 7 years ago

Besides:

Because only then I get ERROR: openssl not found.

There's no such thing like a librtmp dependency in ffmpeg's ./configure, all there's is

--enable-gcrypt enable gcrypt, needed for rtmp(t)e support if openssl, librtmp or gmp is not used [no] --enable-gmp enable gmp, needed for rtmp(t)e support if openssl or librtmp is not used [no] --enable-gnutls enable gnutls, needed for https support if openssl is not used [no]

and --enable-openssl enable openssl, needed for https support if gnutls is not used [no]

and that's that. It's the other way around:

ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"

So if you get openssl "not found" errors then that MAYBE because you didn't nuke your sandbox COMPLETLY which maybe cluttered by a lot of dependencies/symbols already because you switched ffmpegs options a lot and simply "forgot" about cleaning it. Such drastic changes will never work without PROPER wiping ... It's 0's and 1's, there's no "maybe". To be 100% sure as in 1's you have to ALWAYS wipe it IF NOT 100% sure, there's no 0,9 in computing ...

Reino17 commented 7 years ago

I really don't understand why you keep on going about RTMPDump when I explicitly said I got the error without --enable-librtmp! It's FFMpeg that complains about ERROR: openssl not found, not RTMPDump.

I'm rather punctual when it comes to cleaning, but of course, there's always the possibility I forgot something. I'll come back at this when I've done a fresh run.