msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.21k stars 1.19k forks source link

Compile ffmpeg did not include the 3rd-party libraries #18898

Open huangjinshe opened 8 months ago

huangjinshe commented 8 months ago

Description / Steps to reproduce the issue

  1. Open Mingw32
  2. Install: pacman -S mingw32/mingw-w64-i686-openh264
  3. use configure command:
    ./Configure --enable-shared --disable-static    .....  skip ....    
    --extra-cxxflags='-I/mingw32/include' --extra-ldflags='-L/mingw32/lib`  --enable-libopenh264
  4. compile ffmpeg with make command.

Expected behavior

Normal running without dependency missing error: I want ffmpeg dlls (like avformat.dll or avcodec.dll) include the openh264 libraries.

Actual behavior

Run ffmpeg.exe in windows, it show: openh264.dll missing something like that.

Verification

Windows Version

Win11

MINGW environments affected

Are you willing to submit a PR?

No response

huangjinshe commented 8 months ago

I think it should automatically link the dll and header and then compile with ffmpeg, not let us copy the h264.dll to bin folder alone.

Biswa96 commented 8 months ago

Please provide the exact configure command and ffmpeg version. Also, it is not required to pass /mingw32 directories with compiler and linker flags.

huangjinshe commented 8 months ago

./configure --enable-shared --pkg-config-flags=--static --disable-static --pkg-config=pkg-config --enable-version3 --arch=i686 --target-os=mingw32 --enable-version3 --enable-sdl2 --extra-cflags=-DLIBTWOLAME_STATIC --extra-ldflags=-pthread --extra-ldflags="-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic" --disable-debug --disable-doc --extra-cxxflags='-L/mingw32/include' --extra-ldexeflags='-L/mingw32/lib' --disable-postproc --disable-symver --disable-stripping --disable-videotoolbox --disable-mediacodec --disable-libxavs2 --disable-libx264 --disable-libx265 --disable-librav1e --disable-vaapi --disable-librubberband --disable-libdrm --disable-libuavs3d --disable-libsvtav1 --disable-bzlib --disable-fontconfig --enable-gnutls --enable-iconv --disable-libass --disable-libbluray --disable-libfreetype --enable-libmp3lame --enable-libopenjpeg --disable-libopus --enable-libshine --disable-libsnappy --enable-libsoxr --enable-cuda-llvm --disable-libtheora --enable-libtwolame --enable-libvpx --enable-libwebp --enable-libopenh264 --disable-libxml2 --enable-libzimg --disable-lzma --enable-zlib --enable-gmp --disable-libvorbis --disable-libmysofa --disable-libspeex --disable-libmfx --enable-libvpl --enable-amf --enable-ffnvcodec --disable-libaom --enable-cuvid --enable-d3d11va --disable-libplacebo --enable-nvdec --enable-dxva2 --disable-avisynth --prefix=/home/admin/output --enable-libfdk-aac --enable-asm --enable-x86asm --enable-cross-compile --enable-vulkan --disable-libshaderc --enable-small --enable-runtime-cpudetect

The all library I already installed by pacman.

Biswa96 commented 8 months ago

In that command, static library is disabled but --static option is added with pkgconfig flag. Do you want static or shared build?

huangjinshe commented 8 months ago

shared, but I need to all 3rd part libraries compiled in ffmpeg dll.

Biswa96 commented 8 months ago

I have tried to compile with your given command. ffmpeg did not compile statically. It still depends on various other DLLs, not only openh264. Probably, the build environment still prefers shared library over static ones. Still, this does not seems like an issue to me. Just need to play with the configuration part.

huangjinshe commented 8 months ago

@Biswa96 Thank you , but I need shared libraries which include 3rd party libraries in ffmpeg dll inside. Any advice for that?

Biswa96 commented 8 months ago

I completely understand that it is a legitimate use case; however, I am unaware of the necessary information required to compile ffmpeg that way. Please wait for others to comment.