Guide : How to compile ffmpeg under Windows7 and VS2012

Questions that occur when trying to compile FFmpeg.
sdancer75
Posts: 11
Joined: Fri Jul 26, 2013 2:35 pm

Re: Guide : How to compile ffmpeg under Windows7 and VS2012

Post by sdancer75 » Thu Nov 14, 2013 8:50 am

check this video tutorial ! Hope it helps

http://rapidshare.com/share/7EBD83E96E4 ... 8015213159

sudeep
Posts: 2
Joined: Fri Nov 15, 2013 9:31 am

Re: Guide : How to compile ffmpeg under Windows7 and VS2012

Post by sudeep » Fri Nov 15, 2013 9:33 am

I followed the steps. When I try to run example code I got

error C3861: 'UINT64_C': identifier not found

I resolved it by using the code below


#ifdef __cplusplus
#define __STDC_CONSTANT_MACROS
#ifdef _STDINT_H
#undef _STDINT_H
#endif
# include "stdint.h"
#endif


It compiled. I then got linker error saying unable to resolve symbol like below

error LNK2019: unresolved external symbol "struct AVDictionaryEntry * __cdecl av_dict_get(struct AVDictionary *,char const *,struct AVDictionaryEntry const *,int)" ([email protected]@[email protected]@[email protected]@[email protected]@Z) referenced in function _main

I have tried the following:
1) verified that linker > input > additional dependencies has lib files listed.
2) Dlls are in the debug folder.
3) Verifies both dlls and lib files are 32 bit (using dependency walker and dumpbin)

But still not able to figure out what is wrong. Any help is greatly appreciated.

sudeep
Posts: 2
Joined: Fri Nov 15, 2013 9:31 am

Re: Guide : How to compile ffmpeg under Windows7 and VS2012

Post by sudeep » Sat Nov 16, 2013 8:19 pm

Soln if anyone faces the same problem.
====================================

I also had updated PATH system variable. Nothing worked.

Finally Restarting the machine worked. Dont know what was cached. Will be helpful if someone can tell me the logic behind why restart worked.

Ta

sdancer75
Posts: 11
Joined: Fri Jul 26, 2013 2:35 pm

Re: Guide : How to compile ffmpeg under Windows7 and VS2012

Post by sdancer75 » Mon Nov 18, 2013 5:15 pm

sudeep wrote:Soln if anyone faces the same problem.
====================================

I also had updated PATH system variable. Nothing worked.

Finally Restarting the machine worked. Dont know what was cached. Will be helpful if someone can tell me the logic behind why restart worked.

Ta
Environment vars, system paths and everything else that is system related, needs to restart machine to take effect any changes ¨-)

freudi
Posts: 3
Joined: Tue Nov 26, 2013 10:00 am

Re: Guide : How to compile ffmpeg under Windows7 and VS2012

Post by freudi » Tue Nov 26, 2013 10:07 am

Hi, I got the same Thing like JAYANTHI:

c99wrap cl is unable to create an executable file.
If c99wrap cl is a cross compiler, use --enable-cross-compile option.
Only do this if u know what cross compiling means.
C compiler test failed.

What is this mean? I'm under Windows, why cross-compile?

Freudi

freudi
Posts: 3
Joined: Tue Nov 26, 2013 10:00 am

Re: Guide : How to compile ffmpeg under Windows7 and VS2012

Post by freudi » Tue Nov 26, 2013 10:14 pm

I digged a bit deeper. The c99wrap Looks faulty. All the 3 Versions on http://download.videolan.org/pub/contrib/c99-to-c89 give "not a win32 Application" in a DOS-Box and "Bad filenumber" under the mingw prompt.
There is another Version on https://github.com/libav/c99-to-c89 that gives cl : error D8021 : Ungültiges numerisches Argument /Fit.o_preprocessed.c. The reason for that is that I use VS2008 and the cl in there haven't the Option Fi.

Next Try would be VS2010, but I will need thet static-libs für vs2008 and my expierence is that I cant use lib's from other VS Versions.

pavel
Posts: 10
Joined: Wed Dec 04, 2013 7:39 am

Re: Guide : How to compile ffmpeg under Windows7 and VS2012

Post by pavel » Wed Dec 04, 2013 7:41 am

freudi wrote:I digged a bit deeper. The c99wrap Looks faulty. All the 3 Versions on http://download.videolan.org/pub/contrib/c99-to-c89 give "not a win32 Application" in a DOS-Box and "Bad filenumber" under the mingw prompt.
There is another Version on https://github.com/libav/c99-to-c89 that gives cl : error D8021 : Ungültiges numerisches Argument /Fit.o_preprocessed.c. The reason for that is that I use VS2008 and the cl in there haven't the Option Fi.

Next Try would be VS2010, but I will need thet static-libs für vs2008 and my expierence is that I cant use lib's from other VS Versions.

I have the same error when compiling ffmpeg with librtmp support:

Code: Select all

$ ./configure --prefix=ffmpeg/ --disable-shared --extra-cflags=-I/c/MinGW/include --yasmexe="C:/yasm/yasm-1.2.0-win32.exe" --enable-gpl --cpu=i686 --
enable-static --extra-libs=-static --extra-cflags=--static --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-gpl --toolchain=msvc
c99wrap cl is unable to create an executable file.
If c99wrap cl is a cross-compiler, use the --enable-cross-compile option.
Only do this if you know what cross compiling means.
C compiler test failed.
I'm using Visual Studio 2010

How could i fix that?

sdancer75
Posts: 11
Joined: Fri Jul 26, 2013 2:35 pm

Re: Guide : How to compile ffmpeg under Windows7 and VS2012

Post by sdancer75 » Thu Dec 05, 2013 8:04 am

pavel wrote:
freudi wrote:I digged a bit deeper. The c99wrap Looks faulty. All the 3 Versions on http://download.videolan.org/pub/contrib/c99-to-c89 give "not a win32 Application" in a DOS-Box and "Bad filenumber" under the mingw prompt.
There is another Version on https://github.com/libav/c99-to-c89 that gives cl : error D8021 : Ungültiges numerisches Argument /Fit.o_preprocessed.c. The reason for that is that I use VS2008 and the cl in there haven't the Option Fi.

Next Try would be VS2010, but I will need thet static-libs für vs2008 and my expierence is that I cant use lib's from other VS Versions.

I have the same error when compiling ffmpeg with librtmp support:

Code: Select all

NaN€ (NaN€ ($ .))/configure --prefix=ffmpeg/ --disable-shared --extra-cflags=-I/c/MinGW/include --yasmexe="C:/yasm/yasm-1.2.0-win32.exe" --enable-gpl --cpu=i686 --
enable-static --extra-libs=-static --extra-cflags=--static --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-gpl --toolchain=msvc
c99wrap cl is unable to create an executable file.
If c99wrap cl is a cross-compiler, use the --enable-cross-compile option.
Only do this if you know what cross compiling means.
C compiler test failed.
I'm using Visual Studio 2010

How could i fix that?

I think that you should ask user pavel since I had no problems compiling ffmpeg. I used VS2012 and as you already saw I uploaded a video that shows the steps I followed without problems.

I attach you my c99wrap that maybe is the root of the problem as user pavel noted above.

http://rapidshare.com/share/607698C6D11 ... 0E4317B5A3

pavel
Posts: 10
Joined: Wed Dec 04, 2013 7:39 am

Re: Guide : How to compile ffmpeg under Windows7 and VS2012

Post by pavel » Thu Dec 05, 2013 2:31 pm

sdancer75 wrote: I attach you my c99wrap that maybe is the root of the problem as user pavel noted above.
http://rapidshare.com/share/607698C6D11 ... 0E4317B5A3
i've just written a guide and how i was able to resolve this error..
See http://ffmpeg.zeranoe.com/forum/viewtop ... f=5&t=1683

X3m
Posts: 1
Joined: Fri Jan 03, 2014 1:32 pm

Re: Guide : How to compile ffmpeg under Windows7 and VS2012

Post by X3m » Fri Jan 03, 2014 1:35 pm

Hello,

Thanks for your tutorial.
I'm trying to build ffmpeg under Windows using VS.
I'd also like to build ffplay and it requires SDL.
Can you please tell me how to add SDL support to configure?

Thanks in advance.

Post Reply
'