[Ffmpeg-devel] more stuff for win32

Axel Holzinger aholzinger
Sun Jul 9 15:14:49 CEST 2006

Hello Ramiro et all,

first of all good to hear that somebody is addressing the win32 issues :-)

> Hello,
> I have done some changes in the makefiles for better support for win32.
> The first removes ldconfig from the main Makefile if CONFIG_WIN32 
> is set. Well, it doesn't remove, it just doesn't add it. I know 
> the ldconfig line can fail and the make will still go on (because 
> of the - sign), but this is just a suggestion.

Can't comment on that, cause I'm not so much into makefiles :-)

> The second changes common.mak and fixes the problems with 
> SLIBNAME_WITH_MAJOR for win32. When CONFIG_WIN32 is set, making 
> SLIBNAME doesn't make SLIBNAME_WITH_MAJOR first to call ln later, 
> it just builds SLIBNAME directly. This fixes the problem with the 
> dlls with version number not being found.

This is extremely helpful. The version numbers in the DLL filenames
aren't really optimal, mainly because of one DLL pointing to the
other. As soon as you have a new version, you have to replace all
3 DLLs and change your application to load the new ones. So many
thanks for this. I will give it a try ASAP.

> Additionally the patch 
> installs the .lib files in the "$(prefix)/lib" folder so that I 
> don't have to copy them to the Visual Studio's lib folder 
> everytime. I just point the linker to this folder and never copy 
> anything to Visual Studio's lib folder.

Also good point. I still prefer to load the DLLs dynamically.

> I still have the problem with ffmpeg.exe and dlls. The error is 
> "The application failed to initialize properly (0xc0000005)". 
> Weird thing is that output_example.exe works well with the dlls, 
> and my programs too. It's just ffmpeg.exe that does this. Did 
> anyone find out exactly what does this, and got it working? I 
> think it might be something wrong with the way the dlls are 
> linked with GCC.
> Or can anyone point me in a better direction to investigate? I 
> tried loading it with Dependency Walker, but get the same thing, 
> with not much more information. What I get is:
> First chance exception 0xC0000005 (Access Violation) occurred in 
> "c:\windows\syswow64\NTDLL32.DLL" at address 0x7D627029 by thread 1.
> First chance exception 0xC0000005 (Access Violation) occurred in 
> "c:\windows\syswow64\NTDLL32.DLL" at address 0x7D64A8C6 by thread 1.
> Second chance exception 0xC0000005 (Access Violation) occurred in 
> "c:\windows\syswow64\NTDLL32.DLL" at address 0x7D64A8C6 by thread 1.

I did also discover this and helped myself by building ffmpeg
statically (enable-static). Then ffmpeg.exe will already include
all the library code.

In any case thanks a lot for your effort.

> I also find it weird that, looking through Dependency Walker, 
> AVCODEC.DLL and AVFORMAT.dll are imported several times. The 
> first time, many functions are imported (which is what is 
> expected). And the subsequent times (10 for avformat and 8 for 
> avcodec), only one global variable is imported, such as 
> first_avcodec (8 times), first_iformat (twice), first_oformat 
> (twice), ffm_nopts (twice), first_image_format (twice), 
> first_protocol (once), and loop_input (once)...
> Another thing: how is the __attribute__((visibility("default"))) 
> thing going? I'm pretty sure it would help a lot for windows 
> dlls. That way the dll could only provide the correct API, 
> exporting less symbols, and not making such a mess.
> Bye,
> Ramiro Polla

More information about the ffmpeg-devel mailing list