microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.02k stars 6.35k forks source link

FFmpeg build doesn't show version info in the DLL files #18775

Open iqHpi opened 3 years ago

iqHpi commented 3 years ago

Environment

Reproduction Path vcpkg.exe install ffmpeg[core,ffmpeg,swresample,swscale,avdevice]:x86-windows

Installation was successful. And the following dll files are created -

vcpkg/installed/x86-windows/bin/avcodec-58.dll
vcpkg/installed/x86-windows/bin/avdevice-58.dll
vcpkg/installed/x86-windows/bin/avfilter-7.dll
vcpkg/installed/x86-windows/bin/avformat-58.dll
vcpkg/installed/x86-windows/bin/avutil-56.dll
vcpkg/installed/x86-windows/bin/swresample-3.dll
vcpkg/installed/x86-windows/bin/swscale-5.dll

But there is no version info in the dll files.

avcodec-58

Regardless of version info, FFmpeg works well. No issue with that.

NancyLi1013 commented 3 years ago

Hi @iqHpi

Thanks for posting this issue.

Sorry for the delay. Do you want to see what version here?

iqHpi commented 3 years ago

This is what I get when I build FFmpeg without vcpkg. avcodec-58_old

I need to see the DLL file version as marked in red. Thanks. @NancyLi1013

JackBoosY commented 3 years ago

In avcodecres.rc:

            VALUE "FileVersion",      AV_STRINGIFY(LIBAVCODEC_VERSION)

I can confirm these rc files doesn't be used in the build process. cc @mcmtroffaes

mcmtroffaes commented 3 years ago

It looks like windres isn't provided by the msys2 build environment set up by the ffmpeg portfile. Maybe installing binutils into the environment will fix this?

dg0yt commented 3 years ago

Does this use libtool? It might need two environment variables: WINDRES and RC. Cf. vcpkg_configure_make.

mcmtroffaes commented 3 years ago

I'm honestly not sure but I suspect not since it doesn't use automake (which vcpkg_configure_make more or less assumes). But I can see in the configure script that that the mingw build checks for windres, but the win32/win64 build does not. I'm hoping it's just a matter of adding binutils to msys and adding a line to the configure script to check for windres also on win32/win64.

iqHpi commented 3 years ago

Hi. Any update?

mcmtroffaes commented 3 years ago

Well, the mingw builds do have the version info but the msvc builds do not, and this is an upstream "feature". I thought maybe we could use windres also with the msvc build (copying what the mingw build does) but that doesn't work unfortunately... I'm slightly out of my depth when it comes to windres/rc. Perhaps what your requesting would better be discussed on the ffmpeg list, maybe someone there has the necessary skills to properly support rc with the msvc build.

For now, if you need the dll info, I suggest using one of the mingw triplets. If that doesn't show the dll info then that would be a bug in vcpkg.

LilyWangLL commented 2 years ago

@iqHpi Sorry I am late. According to the comment from Matthias, this issue should be a upstream issue, could you report this issue on upstream: https://github.com/ffmpeg/ffmpeg. If there are fix of this issue on upstream, we will sync fix to VCPKG.

iqHpi commented 2 years ago

@iqHpi Sorry I am late, according to the comment from Matthias. This issue should be a upstream issue, could you report this issue on upstream: https://github.com/ffmpeg/ffmpeg. If there are fix of this issue on upstream, we will sync fix to VCPKG.

There is no versioning issue if I build FFMPEG from source. So, probably this is not a upstream issue.

LilyWangLL commented 2 years ago

Thanks for your reply, I will double confirm.

gerard-ryan-immersaview commented 1 year ago

For anyone interested, I was able to backport an upstream patch with slight modifications to work with msys2 here.

dg0yt commented 1 year ago

For anyone interested, I was able to backport an upstream patch with slight modifications to work with msys2 here.

Would scripts/buildsystems/make_wrapper/windres-rc help?

gerard-ryan-immersaview commented 1 year ago

For anyone interested, I was able to backport an upstream patch with slight modifications to work with msys2 here.

Would scripts/buildsystems/make_wrapper/windres-rc help?

Perhaps, If there is an FFmpeg configure script option to override what windres executable FFmpeg actually uses.