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 and zlib support #7084

Closed
velorom opened this issue Jun 28, 2019 · 5 comments · Fixed by #11277
Closed

ffmpeg and zlib support #7084

velorom opened this issue Jun 28, 2019 · 5 comments · Fixed by #11277
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist

Comments

@velorom
Copy link

velorom commented Jun 28, 2019

I trying to install FFmpeg on Windows 10, VS2017.
FFmpeg compiled and installed normally, but there is no zlib support.
I tried to dig config.log of FFmpeg and found these lines:

check_pkg_config zlib zlib zlib.h zlibVersion
test_pkg_config zlib zlib zlib.h zlibVersion
false --exists --print-errors zlib
check_lib zlib zlib.h zlibVersion -lz
check_func_headers zlib.h zlibVersion -lz
test_ld cc -lz
test_cc
BEGIN ./ffconf.o2M6qpqs/test.c
    1	#include <zlib.h>
    2	#include <stdint.h>
    3	long check_zlibVersion(void) { return (long) zlibVersion; }
    4	int main(void) { int ret = 0;
    5	 ret |= ((intptr_t)check_zlibVersion) & 0xFFFF;
    6	return ret; }
END ./ffconf.o2M6qpqs/test.c
cl -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_WIN32_WINNT=0x0600 -nologo -DHAVE_UNISTD_H=0 -MD -c -Fo./ffconf.o2M6qpqs/test.o ./ffconf.o2M6qpqs/test.c
test.c
d:\develop\visualstudio\vcpkg\installed\x86-windows\include\zconf.h(477): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

I found that problem is in this command option -DHAVE_UNISTD_H=0.
zlib checks for this definition present and not for its value.

@velorom
Copy link
Author

velorom commented Jun 28, 2019

OK. In addition to the above. From the official documentation of FFmpeg:

If you wish to build with zlib support, you will have to grab a compatible zlib binary from somewhere, with an MSVC import lib, or if you wish to link statically, you can follow the instructions below to build a compatible zlib.lib with MSVC. Regardless of which method you use, you must still follow step 3, or compilation will fail.

1. Grab the zlib sources.
2. Edit win32/Makefile.msc so that it uses -MT instead of -MD, since this is how FFmpeg is built as well.
3. Edit zconf.h and remove its inclusion of unistd.h. This gets erroneously included when building FFmpeg.

@velorom
Copy link
Author

velorom commented Jun 29, 2019

Another addition. It looks that FFmpeg is searching for zlib.lib library name for debug version (not zlibd.lib)

@LilyWangL LilyWangL added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Jul 1, 2019
@zeFresk
Copy link

zeFresk commented Jul 10, 2019

Same problem using VS2019 when trying to install ffmpeg[ffmpeg,ffserver,ffplay,ffprobe,openssl,lzma,bzip2,vpx,x264,opencl,nonfree,gpl] with almost all the .lib
But the log show that release builds are fine somehow.

@LilyWangL
Copy link
Contributor

LilyWangL commented Jul 31, 2020

@Sibras Could you please submit a Pull Request to commit your changes?
Thanks.

@Sibras
Copy link
Contributor

Sibras commented Aug 1, 2020

A PR has been waiting for a while #11277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants