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.09k stars 414 forks source link

Building frei0r errors out #707

Open Kadigan opened 1 year ago

Kadigan commented 1 year ago

I don't see an option to disable frei0r in any way; it seems to be expected to be built. However, building frei0r fails no matter what I do - it throws a ton of errors on stuff like std::thread, std::future, and a few failed assertions when trying to build filter "kaleid0sc0pe".

Had to edit it out by disabling it in the build queue, and removing --enable-frei0r from the cmdline.

Is that something that'll see an update, or is this ticket relevant?

timothymowens commented 1 year ago

I believe this is an issue that needs to be created for the frei0r project. It looks like they recently added the kaleid0sc0pe filter with v2.3.1, which seems to be breaking complilation when building for Windows via mingw.

I submitted a ticket to them: https://github.com/dyne/frei0r/issues/178

timothymowens commented 1 year ago

As a side note, I made the following edit to the build_frei0r() function in the cross_compile_ffmpeg.sh script and was able to successfully move on past the frei0r issue. This simply downloads the previous v2.3.0 build instead of latest:

build_frei0r() {
  #do_git_checkout https://github.com/dyne/frei0r.git
  #cd frei0r_git
  download_and_unpack_file https://github.com/dyne/frei0r/archive/refs/tags/v2.3.0.tar.gz frei0r-2.3.0
  cd frei0r-2.3.0
    sed -i.bak 's/-arch i386//' CMakeLists.txt # OS X https://github.com/dyne/frei0r/issues/64
    do_cmake_and_install "-DWITHOUT_OPENCV=1" # XXX could look at this more...

    mkdir -p $cur_dir/redist # Strip and pack shared libraries.
    if [ $bits_target = 32 ]; then
      local arch=x86
    else
      local arch=x86_64
    fi
    archive="$cur_dir/redist/frei0r-plugins-${arch}-$(git describe --tags).7z"
    if [[ ! -f "$archive.done" ]]; then
      for sharedlib in $mingw_w64_x86_64_prefix/lib/frei0r-1/*.dll; do
        ${cross_prefix}strip $sharedlib
      done
      for doc in AUTHORS ChangeLog COPYING README.md; do
        sed "s/$/\r/" $doc > $mingw_w64_x86_64_prefix/lib/frei0r-1/$doc.txt
      done
      7z a -mx=9 $archive $mingw_w64_x86_64_prefix/lib/frei0r-1 && rm -f $mingw_w64_x86_64_prefix/lib/frei0r-1/*.txt
      touch "$archive.done" # for those with no 7z so it won't restrip every time
    fi
  cd ..
}
mitchcapper commented 1 year ago

reverting to the old version works but its still pretty easy to use master and just disable the module with sed or any other string manipulation. Each is independent so I don't think it causes any issues.

Kadigan commented 1 year ago

Does the script have the ability to "blacklist" known-incompatible lib versions, at least until the issue is resolved (as I understand, it's a mingw issue with using win32 threads and no futures support)? Is it a thing?

mitchcapper commented 1 year ago

The frei0r lib is a set of optional filters for ffmpeg that apply things like effects. The kaleid0sc0pe is an arbitrary effect recently added to frei0r. It does require a threads feature that mingw does not by default support (there may be a work around). The first of the frei0r lib however doesn't use those features so simply excluding this specific filter resolves the issue without locking this helper script to static in time frei0r lib.

Kadigan commented 1 year ago

From what I could see, they're adding some extra checks to verify actual support for those C++11 features, so hopefully this won't show up again in this particular library.

rdp commented 1 year ago

should be work arounded now, hopefully, till they merge the check on their end...

Reino17 commented 1 year ago

I see you're still installing these... https://github.com/rdp/ffmpeg-windows-build-helpers/blob/6e499973c574b071fbe9064a4603f32de2b01113/cross_compile_ffmpeg.sh#L1423-L1428 ...so why not use them?

sed -i.bak 's/<future>/"mingw.future.h"/' src/filter/kaleid0sc0pe/kaleid0sc0pe.cpp
This works for me.