Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ffmpeg[x264]:x86-windows] build failure #12896

Closed
ivanovmp opened this issue Aug 13, 2020 · 14 comments
Closed

[ffmpeg[x264]:x86-windows] build failure #12896

ivanovmp opened this issue Aug 13, 2020 · 14 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@ivanovmp
Copy link

Host Environment

  • OS: Windows 10 Home Single Language (Russian) x64
  • Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29110

To Reproduce
Steps to reproduce the behavior:
./vcpkg install ffmpeg[x264]:x86-windows

Failure logs

C:\misc\vcpkg>vcpkg install ffmpeg[x264]
Computing installation plan...
The following packages will be built and installed:
    ffmpeg[avresample,core,gpl,x264]:x86-windows
Detecting compiler hash for triplet x86-windows...
Starting package 1/1: ffmpeg:x86-windows
Building package ffmpeg[avresample,core,gpl,x264]:x86-windows...
Could not locate cached archive: C:\Users\user\AppData\Local\vcpkg\archives\1b\1b8a04433b7d1d7bb2b8ba405b4abc179877ae06.zip
-- Using cached C:/misc/vcpkg/downloads/ffmpeg-ffmpeg-n4.2.tar.gz
-- Cleaning sources at C:/misc/vcpkg/buildtrees/ffmpeg/src/n4.2-a4d149a5c6.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/misc/vcpkg/downloads/ffmpeg-ffmpeg-n4.2.tar.gz
-- Applying patch 0001-create-lib-libraries.patch
-- Applying patch 0003-fix-windowsinclude.patch
-- Applying patch 0004-fix-debug-build.patch
-- Applying patch 0005-fix-libvpx-linking.patch
-- Applying patch 0006-fix-StaticFeatures.patch
-- Using source at C:/misc/vcpkg/buildtrees/ffmpeg/src/n4.2-a4d149a5c6.clean
-- Acquiring MSYS Packages...
-- Acquiring MSYS Packages... OK
-- Building Options: --enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect --enable-gpl --disable-openssl --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-libvpx --enable-libx264 --disable-opencl --disable-lzma --disable-bzlib --enable-avresample --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp --disable-avisynth  --disable-static --enable-shared --extra-cflags=-DHAVE_UNISTD_H=0
-- Building Release Options:  --extra-cflags=-MD --extra-cxxflags=-MD
-- Building ffmpeg for Release
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
    Command failed: C:/misc/vcpkg/downloads/tools/msys2/msys64/usr/bin/bash.exe --noprofile --norc C:/misc/vcpkg/ports/ffmpeg\build.sh C:/misc/vcpkg/buildtrees/ffmpeg/x86-windows-rel C:/misc/vcpkg/buildtrees/ffmpeg/src/n4.2-a4d149a5c6.clean C:/misc/vcpkg/packages/ffmpeg_x86-windows "--enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect --enable-gpl --disable-openssl --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-libvpx --enable-libx264 --disable-opencl --disable-lzma --disable-bzlib --enable-avresample --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp --disable-avisynth  --disable-static --enable-shared --extra-cflags=-DHAVE_UNISTD_H=0  --extra-cflags=-MD --extra-cxxflags=-MD"
    Working Directory: C:/misc/vcpkg/buildtrees/ffmpeg/x86-windows-rel
    Error code: 1
    See logs for more information:
      C:\misc\vcpkg\buildtrees\ffmpeg\build-x86-windows-rel-out.log

Call Stack (most recent call first):
  ports/ffmpeg/portfile.cmake:210 (vcpkg_execute_required_process)
  scripts/ports.cmake:79 (include)


Error: Building package ffmpeg:x86-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: ffmpeg:x86-windows
  Vcpkg version: 2020.06.15-nohash

Additionally, attach any relevant sections from the log files above.

Contents of C:\misc\vcpkg\buildtrees\ffmpeg\build-x86-windows-rel-out.log:

=== CONFIGURING ===
ERROR: libx264 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
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

Additional context
I have been waiting for several months for x264 being fixed for Windows, and, when I have finally got it fixed, I can't install x264 version of ffmpeg because of some brand new incredible issues.

@PhoebeHui PhoebeHui self-assigned this Aug 14, 2020
@PhoebeHui PhoebeHui added the category:port-bug The issue is with a library, which is something the port should already support label Aug 14, 2020
@PhoebeHui
Copy link
Contributor

cc @Sibras

@ivanovmp
Copy link
Author

#12904

@emptyVoid
Copy link
Contributor

@Neumann-A, could you take a look at this one please? Looks like the renaming of libx264 libraries in #11836 didn't go quite well with ffmpeg.

@Neumann-A
Copy link
Contributor

custom configure script ...... try commenting line 4465 in the configure script
-lx264) echo libx264.lib ;;
or change that to
-lx264) echo x264.lib ;;

I was just following the name of the *.pc file in x264

@samofoz
Copy link

samofoz commented Aug 14, 2020

custom configure script ...... try commenting line 4465 in the configure script
-lx264) echo libx264.lib ;;
or change that to
-lx264) echo x264.lib ;;

I was just following the name of the *.pc file in x264

Same problem after modifying C:\vcpackage\vcpkg\buildtrees\ffmpeg\src\n4.2-a4d149a5c6.clean\configure as per above.

@Sibras
Copy link
Contributor

Sibras commented Aug 14, 2020

@Neumann-A, could you take a look at this one please? Looks like the renaming of libx264 libraries in #11836 didn't go quite well with ffmpeg.

libx264.lib is the default name on windows, changing that will break any user using x264 not just ffmpeg. This can be fixed by patching the ffmpeg side of things but I would recommend not changing lib names as that breaks all downstream users of x264.

@Neumann-A
Copy link
Contributor

The default name for x264 in a shared build is libx264.dll.lib

@Sibras
Copy link
Contributor

Sibras commented Aug 20, 2020

The default name for x264 in a shared build is libx264.dll.lib

Not with msvc compilation. Previously vcpkg output libx264.lib on windows up until the recent change. FFmpeg has been independently using libx264.lib for linking for years without any issue.

Mingw can output a "libx264.dll.a" lib that when converted to a msvc compatible file gets the ".dll.lib" extension but by default ffmpeg has always expected the msvc compiled "libx264.lib"

@Neumann-A
Copy link
Contributor

Neumann-A commented Aug 20, 2020

Mingw can output a "libx264.dll.a" lib that when converted to a msvc compatible file gets the ".dll.lib" extension

libtool will output dll.lib with native windows tools (meaning MSVC).

I changed it because the *.pc file generated by the x264 buildsystem clearly states: -lx264 Which on windows + autotools means searching for x264.lib or x264.dll.lib. Otherwise the pc file must be changed to read -llibx264. The correct way for ffmpeg to handle this is to not hardcode library names......and either use pkg-config or let the user supply the name

@Sibras
Copy link
Contributor

Sibras commented Aug 20, 2020

By default ffmpeg does use pkg-config to get x264 information. The pkgconfig file for x264 does in fact say x264 which is why ffmpeg then does an internal conversion that converts all instances of x264.lib to libx264.lib when using msvc. So your right, in that upstream x264 never output a valid pkgconfig.

So to correct that we can either change the lib name as you did or correct the pkgconfig file to match the output lib name. The former requires updating downstream projects (such as ffmpeg) whereas the later does not. Either approach would be technically valid for the pkg-config approach, However I was merely pointing out that all the windows projects that previously used x264 would not be using pkgconfig and would be expecting libx264.lib as that was the previous default. So i wasnt referring to ports but any user of vcpkg would find it no longer works as the defaults have been changed.

@nineKnight
Copy link

I'm new here and caught into this situation. So why not just make a copy of x264.lib to libx264.lib? It seems to work.

@ivanovmp
Copy link
Author

Please, do something. @Sibras has highlighted two possible ways to fix the issue (if I understood correctly), so why not just choose any and implement?

@sdcb
Copy link
Contributor

sdcb commented Sep 27, 2020

Same error on ffmpeg[x264]:x64-windows:

CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:85 (message):
    Command failed: C:/_/3rd/vcpkg/downloads/tools/msys2/8f86d90f10246c56/usr/bin/bash.exe ./build.sh
    Working Directory: C:/_/3rd/vcpkg/buildtrees/ffmpeg/x64-windows-rel
    Error code: 1
    See logs for more information:
      C:\_\3rd\vcpkg\buildtrees\ffmpeg\build-x64-windows-rel-out.log

Call Stack (most recent call first):
  ports/ffmpeg/portfile.cmake:411 (vcpkg_execute_required_process)
  scripts/ports.cmake:79 (include)


Error: Building package ffmpeg:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: ffmpeg:x64-windows
  Vcpkg version: 2020.06.15-nohash

@PhoebeHui
Copy link
Contributor

Currently this issue shoud be fixed now, please get latest source and try again.

I tried to build ffmpeg:x64-windows with latest source, it installed successfully.

Building package ffmpeg[avcodec,avdevice,avfilter,avformat,avresample,core,gpl,postproc,swresample,swscale,x264]:x64-windows... done
Installing package ffmpeg[avcodec,avdevice,avfilter,avformat,avresample,core,gpl,postproc,swresample,swscale,x264]:x64-windows...
Installing package ffmpeg[avcodec,avdevice,avfilter,avformat,avresample,core,gpl,postproc,swresample,swscale,x264]:x64-windows... done
Elapsed time for package ffmpeg:x64-windows: 23.05 min

Total elapsed time: 27.32 min

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

8 participants