Saturday, 29 June 2013

Porting FFMPEG on to Winodws7 and Visual studio 2012

Pre Requisite: VS2012 - ultimate with C++:

1. Download MinGW:

Generic/Latest: Refer to the latest version of MinGW here and install it. It will by default get installed in c:/ drive of windows file system. Locate the msys.bat file in the C:/MinGW/msys/1.0/.

see here for download and more details (MinGW)(Install Instructions).

Specific/Verified :  mingw-get-inst-20120426.exe.zip 
 Move it to C:/MinGW and unzip the package there.

2) Run the install file - mingw-get-inst-20120426.exe

  • Accept all the default settings recommended by the MinGW installer.
  • On the Select Components Screen - choose C, C++, MSYS Basic System, MinGW Developer Toolkit.
  •  Verify the following on the last step before install:
               Installing:
  mingw-get
  pkginfo
  C Compiler
              C++ Compiler
              MSYS Basic System
              MinGW Developer Toolkit

               Using pre-packaged repository catalogues (20120426). Destination  location: C:\MinGW

  • Click Install.

At this point you should see a command window launch and begin the installation. TBD: Capture the install logs here - HOW?:

This can take a 30 min minutes to install based on network conditions. Move on to Step 4 while this install happens.

3) Download the FFMpeg distribution
Generic/Latest : ffmpeg-1.2.1.tar.bz2
Specific/Verified : from here : FFMPEG

4) Verify you see this file system like structure under c:\MinGW

C:\MinGW>dir
 Volume in drive C has no label.
 Volume Serial Number is 3EE0-A8EF

 Directory of C:\MinGW
06/21/2013  11:32 AM <DIR>       .
06/21/2013  11:32 AM <DIR>       ..
06/21/2013  11:33 AM <DIR>       bin
06/21/2013  11:32 AM <DIR>       doc
06/21/2013  11:33 AM <DIR>       include
06/21/2013  11:33 AM <DIR>       lib
06/21/2013  11:32 AM <DIR>       libexec
06/17/2013  11:33 AM       662,689 mingw-get-inst-20120426.exe
06/21/2013  11:04 AM       622,530 mingw-get-inst-20120426.zip
06/21/2013  11:32 AM <DIR>       mingw32
06/21/2013  11:32 AM <DIR>       msys
06/21/2013  11:33 AM <DIR>       share
06/21/2013  11:13 AM         22,225 unins000.dat
06/21/2013  11:07 AM       748,318 unins000.exe
06/21/2013  11:13 AM <DIR>       var
            4 File(s)   2,055,762 bytes
          11 Dir(s)  209,641,558,016 bytes free

5) IMPORTANT: Open up visual studio developer console ( under Start>All Programs> VS12> VS Tools> Developer command prompt for VS12 ) and  Navigate to c:\MinGW\msys\1.0>

6) Run msys.bat from here.
This creates a /home/<your win username> for you and probably does some more config for you. After this you will see a MinGW shell launched.

This completes MinGW setup.

7) Under windows explorer go to
C:\MinGW\msys\1.0\home\<your-win-username> and
Unzip  ffmpeg-1.2.1.tar.bz2 here.
This will create the FFMpeg file structure under your ‘MinGW home’

c:\MinGW\msys\1.0\home\<your-win-username>\ffmpeg-1.2.1>dir
 Volume in drive C has no label.
 Volume Serial Number is 3EE0-A8EF
 Directory of c:\MinGW\msys\1.0\home\<your win user name>\ffmpeg-1.2.1
06/21/2013  12:00 PM <DIR>       .
06/21/2013  12:00 PM <DIR>       ..
05/10/2013  05:46 AM           729 arch.mak
05/10/2013  05:46 AM         38,556 Changelog
05/10/2013  05:46 AM         62,675 cmdutils.c
05/10/2013  05:46 AM         18,849 cmdutils.h
05/10/2013  05:46 AM         1,996 cmdutils_common_opts.h
05/10/2013  05:46 AM         3,684 common.mak
06/21/2013  11:59 AM <DIR>       compat
05/10/2013  05:46 AM       142,476 configure
12/04/2012  02:47 AM         18,092 COPYING.GPLv2
12/04/2012  02:47 AM         35,147 COPYING.GPLv3
05/10/2013  05:46 AM         26,526 COPYING.LGPLv2.1
12/04/2012  02:47 AM         7,651 COPYING.LGPLv3
05/10/2013  05:46 AM           274 CREDITS
06/21/2013  11:59 AM <DIR>       doc
05/10/2013  05:46 AM       119,760 ffmpeg.c
05/10/2013  05:46 AM         13,260 ffmpeg.h
05/10/2013  05:46 AM         33,074 ffmpeg_filter.c
05/10/2013  05:46 AM       102,278 ffmpeg_opt.c
05/10/2013  05:46 AM       117,643 ffplay.c
05/10/2013  05:46 AM         84,178 ffprobe.c
05/10/2013  05:46 AM       159,536 ffserver.c
03/04/2013  04:57 AM           564 INSTALL
06/21/2013  11:59 AM <DIR>       libavcodec
06/21/2013  12:00 PM <DIR>       libavdevice
06/21/2013  11:59 AM <DIR>       libavfilter
06/21/2013  11:59 AM <DIR>       libavformat
06/21/2013  11:59 AM <DIR>       libavresample
06/21/2013  11:59 AM <DIR>       libavutil
06/21/2013  11:59 AM <DIR>       libpostproc
05/10/2013  05:46 AM         3,712 library.mak
06/21/2013  11:59 AM <DIR>       libswresample
06/21/2013  11:59 AM <DIR>       libswscale
05/10/2013  05:46 AM         3,440 LICENSE
05/10/2013  05:46 AM         22,551 MAINTAINERS
05/10/2013  05:46 AM         5,366 Makefile
06/21/2013  11:59 AM <DIR>       presets
05/10/2013  05:46 AM           309 README
05/10/2013  05:46 AM             6 RELEASE
06/21/2013  12:00 PM <DIR>       tests
06/21/2013  11:59 AM <DIR>       tools
05/10/2013  05:46 AM             6 VERSION
03/04/2013  04:57 AM         1,419 version.sh
          28 File(s)   1,023,757 bytes
          16 Dir(s)  209,559,293,952 bytes free


8) Download the following packages, extract and place the executables in C:\MinGW\msys\1.0\home\<your-win-username>  ( basically a place where msys.bat can recognize them )

  •  c99-to-c89 - compiler compatibility and porting  tool used between gcc and msvc. Generic, Get here: C99-89
  •  yasm-1.2.0-win64 - assembler for win64. Generic:Yasm 
         rename yasm-1.2.0-win64.exe to yasm.exe
9) You should now see something like this under your ‘MinGW home’

c:\MinGW\msys\1.0\home\your-win-username>dir
 Volume in drive C has no label.
 Volume Serial Number is 3EE0-A8AF
 Directory of c:\MinGW\msys\1.0\home\<your win user name>
06/21/2013  01:25 PM <DIR>       ..
06/21/2013  11:54 AM         1,310 .inputrc
06/21/2013  01:12 PM     2,156,961 c99-to-c89-1.0.1.zip
12/26/2012  01:55 AM     4,436,480 c99conv.exe
12/26/2012  01:40 AM         62,976 c99wrap.exe
06/21/2013  01:23 PM <DIR>       ffmpeg-1.2.1
06/21/2013  11:31 AM     36,433,920 ffmpeg-1.2.1.tar
06/21/2013  11:31 AM     5,968,378 ffmpeg-1.2.1.tar.bz2
12/26/2012  01:15 AM         3,659 makedef
12/20/2012  04:17 AM             52 pax_global_header
06/21/2013  12:13 PM       358,611 yasm-1.2.0-win64.zip
06/17/2013  04:21 PM       798,208 yasm.exe
          10 File(s) 50,220,555 bytes
            3 Dir(s)  209,684,488,192 bytes free

10) Fix msinttypes

Generic : (MSIntTypes)
Specific/Verified: msinttypes-r26.zip

Unpack these files and place them in a folder named 'msinttypes' and move it to c:/MinGW drive. The absolute path of the files become c:/MinGW/<msint-header-files-here>. we will later link these files with cflags in configure command.

11) You should now see something like this under your c:\MinGW

c:\MinGW>dir
 Volume in drive C has no label.
 Volume Serial Number is 3EE0-A8EF
 Directory of c:\MinGW
06/21/2013  12:44 PM <DIR>       .
06/21/2013  12:44 PM <DIR>       ..
06/21/2013  11:33 AM <DIR>       bin
10/02/2009  01:37 PM         5,842 changelog.txt
06/21/2013  11:32 AM <DIR>       doc
06/21/2013  11:33 AM <DIR>       include
10/02/2009  01:35 PM         8,309 inttypes.h
06/21/2013  11:33 AM <DIR>       lib
06/21/2013  11:32 AM <DIR>       libexec
06/17/2013  11:33 AM       662,689 mingw-get-inst-20120426.exe
06/21/2013  11:04 AM       622,530 mingw-get-inst-20120426.zip
06/21/2013  11:32 AM <DIR>       mingw32
06/21/2013  12:42 PM         6,897 msinttypes-r26.zip
06/21/2013  11:32 AM <DIR>       msys
06/21/2013  11:33 AM <DIR>       share
09/17/2009  11:46 PM         7,975 stdint.h
06/21/2013  11:13 AM         22,225 unins000.dat
06/21/2013  11:07 AM       748,318 unins000.exe
06/21/2013  11:13 AM <DIR>       var
            8 File(s)   2,084,785 bytes
          11 Dir(s)  209,687,085,056 bytes free

12) ADD your mingw home directory to the MinGW console path
<your-win-username>@your-win-username-PC ~/ffmpeg-1.2.1>
$ export PATH=$PATH:/home/<your win user name>/

<your win user name>@your win user name-PC ~/ffmpeg-1.2.1
$ echo $PATH
.:/usr/local/bin:/mingw/bin:/bin:/c/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/CommonExtensions/Microsoft/TestWindow:/c/Program Files (x86)/Microsoft SDKs/F#/3.0/Framework/v4.0/:/c/Program Files (x86)/Microsoft Visual Studio 11.0/VSTSDB/Deploy:/c/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/:/c/Program Files (x86)/Microsoft Visual Studio 11.0/VC/BIN:/c/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/Tools:/c/Windows/Microsoft.NET/Framework/v4.0.30319:/c/Windows/Microsoft.NET/Framework/v3.5:/c/Program Files (x86)/Microsoft Visual Studio 11.0/VC/VCPackages:/c/Program Files (x86)/HTML Help Workshop:/c/Program Files (x86)/Microsoft Visual Studio 11.0/Team Tools/Performance Tools:/c/Program Files (x86)/Windows Kits/8.0/bin/x86:/c/Program Files (x86)/Microsoft SDKs/Windows/v8.0A/bin/NETFX 4.0 Tools:/c/Program Files (x86)/MicrosoftSDKs/Windows/v7.0A/Bin/:/c/Program Files/Common Files/Microsoft Shared/Windows Live:/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/c/Program Files (x86)/Windows Live/Shared:/c/Program Files/SlikSvn/bin:/c/Program Files/Microsoft/Web Platform Installer/:/c/Program Files (x86)/Microsoft ASP.NET/ASP.NET Web Pages/v1.0/:/c/Program Files (x86)/Windows Kits/8.0/Windows Performance Toolkit/:/c/Program Files/Microsoft SQL Server/110/Tools/Binn/:/c/Program Files (x86)/QuickTime/QTSystem/:/home/<your-user-name>/

13) NOTE: There is a common problem with the path of the link.exe available in the MinGW shell. We need to use MSVC toolchain link.exe instead of the standard MinGW link.exe
  • From the MinGW shell, run  $> which link
  •  If you see it points to /bin/link.exe then we need to make it point to the one supplied by Windows MSVC setup - C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
  •  Hack: just rename the /bin/link.exe for the purpose of this FFMpeg porting.
 <your user name>@your user name-PC /bin
$ ls link.exe
link.exe

 <your user name>@your user name-PC /bin
$ mv link.exe mingw_link.exe

 <your user name>@your user name-PC /bin
$ which link
/c/Program Files (x86)/Microsoft Visual Studio 11.0/VC/BIN/link.exe  ⇐ this is what we want!

You are now ready to begin FFMpeg Porting on to Windows.

Porting FFMpeg:

1) From your MinGW shell, go to ffmpeg folder and run the configure script
$ cd  /home/<your user name>/ffmpeg-1.2.1
$ ./configure --toolchain=msvc --enable-shared --extra-cflags="-l/c/MinGW/"

2) ./configure --toolchain=mvsc --enable-shared --extra-cflags="-I/c/MinGW"
It takes a 5-10 minutes to spew out even the first few lines of console output.

At this point you should begin seeing the FFMpeg build structure getting configured.

3) Next you have to make and make-install FFMPeg
$ make

< this goes on for an hour or so >
--Take a lunch/dinner break here! ;)

$make install

You are now half done now!!

You will see the ffmpeg .exe and .o files under the ffmpeg setup.

<your user name>@your user name-PC ~/ffmpeg-1.2.1
$ ls -l
total 4653
-rw-r--r--  1 <your user name> Administrators  18092 Dec  4  2012 COPYING.GPLv2
-rw-r--r--  1<your user name>Administrators  35147 Dec  4  2012 COPYING.GPLv3
-rw-r--r--  1 <your user name> Administrators  26526 May 10 05:46 COPYING.LGPLv2.1
-rw-r--r--  1 <your user name>Administrators   7651 Dec  4  2012 COPYING.LGPLv3
-rw-r--r--  1 <your user name>Administrators 274 May 10 05:46 CREDITS
-rw-r--r--  1 <your user name>Administrators  38556 May 10 05:46 Changelog
-rw-r--r--  1 <your user name>Administrators 564 Mar  4 04:57 INSTALL
-rw-r--r--  1 <your user name>Administrators   3440 May 10 05:46 LICENSE
-rw-r--r--  1 <your user name>Administrators  22551 May 10 05:46 MAINTAINERS
-rw-r--r--  1 <your user name>Administrators   5366 May 10 05:46 Makefile
-rw-r--r--  1 <your user name>Administrators 309 May 10 05:46 README
-rw-r--r--  1 <your user name>Administrators   6 May 10 05:46 RELEASE
-rw-r--r--  1 <your user name>Administrators   6 May 10 05:46 VERSION
-rw-r--r--  1 <your user name>Administrators 729 May 10 05:46 arch.mak
-rw-r--r--  1 <your user name>Administrators  62675 May 10 05:46 cmdutils.c
-rw-r--r--  1 <your user name>Administrators   9468 Jun 21 14:05 cmdutils.d
-rw-r--r--  1 <your user name>Administrators  18849 May 10 05:46 cmdutils.h
-rw-r--r--  1 <your user name>Administrators 245773 Jun 21 14:05 cmdutils.o
-rw-r--r--  1 <your user name>Administrators   1996 May 10 05:46 cmdutils_common_opts.h

-rw-r--r--  1 <your user name>Administrators   3684 May 10 05:46 common.mak
drwxr-xr-x  5 <your user name>Administrators   4096 Jun 21 13:45 compat
-rw-r--r--  1 <your user name>Administrators  45754 Jun 21 13:33 config.asm
-rw-r--r--  1 <your user name>Administrators 162 Jun 21 13:28 config.fate
-rw-r--r--  1 <your user name>Administrators  46351 Jun 21 13:33 config.h
-rw-r--r--  1 <your user name>Administrators 306245 Jun 21 13:33 config.log
-rw-r--r--  1 <your user name>Administrators  41861 Jun 21 13:33 config.mak
-rwxr-xr-x  1 <your user name>Administrators 142476 May 10 05:46 configure
drwxr-xr-x  4 <your user name>Administrators  49152 Jun 21 14:05 doc
-rw-r--r--  1 <your user name>Administrators 119760 May 10 05:46 ffmpeg.c
-rw-r--r--  1 <your user name>Administrators  11884 Jun 21 14:05 ffmpeg.d
-rwxr-xr-x  1 <your user name>Administrators 254976 Jun 21 14:05 ffmpeg.exe
-rw-r--r--  1 <your user name>Administrators  13260 May 10 05:46 ffmpeg.h
-rw-r--r--  1 <your user name>Administrators 272427 Jun 21 14:05 ffmpeg.o
-rw-r--r--  1 <your user name>Administrators  33074 May 10 05:46 ffmpeg_filter.c
-rw-r--r--  1 <your user name>Administrators  10365 Jun 21 14:05 ffmpeg_filter.d
-rw-r--r--  1 <your user name>Administrators 126099 Jun 21 14:05 ffmpeg_filter.o
-rwxr-xr-x  1 <your user name>Administrators 254976 Jun 21 14:05 ffmpeg_g.exe
-rw-r--r--  1 <your user name>Administrators 102278 May 10 05:46 ffmpeg_opt.c
-rw-r--r--  1 <your user name>Administrators   9977 Jun 21 14:05 ffmpeg_opt.d
-rw-r--r--  1 <your user name>Administrators 295460 Jun 21 14:05 ffmpeg_opt.o
-rw-r--r--  1 <your user name>Administrators 117643 May 10 05:46 ffplay.c
-rw-r--r--  1 <your user name>Administrators  84178 May 10 05:46 ffprobe.c
-rw-r--r--  1 <your user name>Administrators   8437 Jun 21 14:05 ffprobe.d
-rwxr-xr-x  1 <your user name>Administrators 223744 Jun 21 14:05 ffprobe.exe
-rw-r--r--  1 <your user name>Administrators 282001 Jun 21 14:05 ffprobe.o
-rwxr-xr-x  1 <your user name>Administrators 223744 Jun 21 14:05 ffprobe_g.exe
-rw-r--r--  1 <your user name>Administrators 159536 May 10 05:46 ffserver.c
drwxr-xr-x 11 <your user name>Administrators 524288 Jun 21 14:05 libavcodec
drwxr-xr-x  2 <your user name>Administrators  24576 Jun 21 14:05 libavdevice
drwxr-xr-x  4 <your user name>Administrators  98304 Jun 21 14:05 libavfilter
drwxr-xr-x  2 <your user name>Administrators 262144 Jun 21 14:05 libavformat
drwxr-xr-x  4 <your user name>Administrators   4096 Jun 21 11:59 libavresample
drwxr-xr-x 10 <your user name>Administrators  40960 Jun 21 13:46 libavutil
drwxr-xr-x  2 <your user name>Administrators   4096 Jun 21 12:00 libpostproc
-rw-r--r--  1 <your user name>Administrators   3712 May 10 05:46 library.mak
drwxr-xr-x  4 <your user name>Administrators   8192 Jun 21 13:46 libswresample
drwxr-xr-x  6 <your user name>Administrators   8192 Jun 21 14:05 libswscale
drwxr-xr-x  2 <your user name>Administrators   4096 Jun 21 12:00 presets
drwxr-xr-x  4 <your user name>Administrators   4096 Jun 21 12:00 tests
drwxr-xr-x  2 <your user name>Administrators   8192 Jun 21 11:59 tools
-rw-r--r--  1 <your user name>Administrators 31 Jun 21 13:42 version.h
-rwxr-xr-x  1 <your user name>Administrators   1419 Mar  4 04:57 version.sh


All the DLLs and .lib files should now be located under the C:\MinGW\msys\1.0\local folder. Check them out.

You are now done with MinGW shell to cross compile FFMpeg on to Windows 7


FFMpeg VS2012 integration

Refer to this online page for generic steps: Linking FFMPEG and VS

1) Open an existing VC++ project
2) Under project properties>C/C++>Code Generation>Runtime Library
3) Define
    #define inline __inline in your top level header file.

TBD - this is causing errors in VS12
This causes xkeycheck.h define errors - they are supposedly obsolete - investigate - http://www.garagegames.com/community/forums/viewthread/131675

4) Refer to the Fix msinttypes  section above and get the inttypes.h from msinttypes-r26.zip place them in a place where MSVS can see them.
TBD - Back up the C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\inttypes.h and revisit this aspect again

5) set References to No (/OPT:NOREF) under the linker optimization settings,
project properties>linker>optimization>References to
No (/OPT:NOREF)

 TBD - analyse lib /machine:i386 /def:..\lib\foo-version.def  /out:foo.lib step for /OPT:REF option

6) SETUP VS12 path and include options for compile and runtime environments
  •  project properties>C/C++>General>Additional Include Directories  add include path of ffmpeg headers  C:\MinGW\msys\1.0\local\include;

  •  Now we need some exp and lib file generated under the c:\MinGW\msys\1.0\local\bin\ directory based on the .def files in c:\MinGW\msys\1.0\local\lib. For that open a VC developer command prompt and run the following commands
  1. lib /machine:i386 /def:c:\MinGW\msys\1.0\local\lib\avcodec-54.def   /out:c:\MinGW\msys\1.0\local\bin\avcodec-54.lib
  2. lib /machine:i386 /def:c:\MinGW\msys\1.0\local\lib\avdevice-54.def  /out:c:\MinGW\msys\1.0\local\bin\avdevice-54.lib
  3. lib /machine:i386 /def:c:\MinGW\msys\1.0\local\lib\avfilter-3.def   /out:c:\MinGW\msys\1.0\local\bin\avfilter-3.lib
  4. lib /machine:i386 /def:c:\MinGW\msys\1.0\local\lib\avformat-54.def  /out:c:\MinGW\msys\1.0\local\bin\avformat-54.lib
  5. lib /machine:i386 /def:c:\MinGW\msys\1.0\local\lib\avutil-52.def /out:c:\MinGW\msys\1.0\local\bin\avutil-52.lib
  6. lib /machine:i386 /def:c:\MinGW\msys\1.0\local\lib\swresample-0.def /out:c:\MinGW\msys\1.0\local\bin\swresample-0.lib
  7. lib /machine:i386 /def:c:\MinGW\msys\1.0\local\lib\swscale-2.def /out:c:\MinGW\msys\1.0\local\bin\swscale-2.lib  

  •  project properties>linker >Additional Dependencies. Add include path of ffmpeg libs by clicking edit and inserting the below ( into the space above the inherited values box)
  1. C:\MinGW\msys\1.0\local\bin\avcodec-54.lib
  2. C:\MinGW\msys\1.0\local\bin\avdevice-54.lib
  3. C:\MinGW\msys\1.0\local\bin\avfilter-3.lib
  4. C:\MinGW\msys\1.0\local\bin\avformat-54.lib
  5. C:\MinGW\msys\1.0\local\bin\avutil-52.lib
  6. C:\MinGW\msys\1.0\local\bin\swresample-0.lib
  7. C:\MinGW\msys\1.0\local\bin\swscale-2.lib
  •  [OPTIONAL] project properties>linker>Additional Library Directories. add the lib path of ffmpeg libs C:\MinGW\msys\1.0\local\lib;

  •  Copy all the FFMpeg DLLs generated in the c:\MinGW\msys\1.0\local\bin\ area to the Debug/Release folder in your VS12 project area. This is the same Debug folder where your final application executable is located.

Additional Changes in the code needed for specific VS12 - ffmpeg compilation.

Error    1
    error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.    C:\Users\<your user name>\Documents\Visual Studio 2012\Projects\MFCScrRec\MFCScrRec\WinScrEncode.cpp    219    1    MFCScrRec

Resolution:
1) Goto project properties Configuration ProjectProperties>C/C++>Preprocessor>Preprocessor Definitions.
2) Edit and add _CRT_SECURE_NO_DEPRECATE to the definitions ( above the Inherited values: window )

Try out some ffmpeg samples online and it should work :)

20 comments:

  1. Thanks! I guess that will make it more easy to understand.

    There are couple of tutorials here.

    http://vimeo.com/69111871
    http://www.youtube.com/watch?v=3yhkX0uaQGk

    But, I will definitely try to make one, when I'm free.

    ReplyDelete
  2. Thanks Ramu for this wonderful tutorial. For my project I have to use msvc 2008 version only. After the command : './configure --toolchain=msvc --enable-shared --extra-cflags=-l/c/MinGW' I get following error: 'c99wrap cl is unable to create an executable file'. config.log reports :
    WARNING: pkg-config not found, library detection may fail.
    mktemp -u XXXXXX
    oSXJyq
    check_ld cc
    check_cc
    BEGIN /tmp/ffconf.xHmFARQg.c
    1 int main(void){ return 0; }
    END /tmp/ffconf.xHmFARQg.c
    c99wrap cl -nologo -D_USE_MATH_DEFINES -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64 /c/MinGW.lib -c -Fo /tmp/ffconf.MJMrnFvE.o /tmp/ffconf.xHmFARQg.c
    cl : Command line error D8021 : invalid numeric argument '/FiC:/Users/rupalis/AppData/Local/Temp/ffconf.MJMrnFvE.o_preprocessed.c'
    C compiler test failed.

    Can you help me debug this issue? I cannot switch over to Visual Studio 2010.

    ReplyDelete
    Replies
    1. Did u see this already?
      http://stackoverflow.com/questions/17218902/connect-ffmpeg-to-visual-studio-2008

      Delete
    2. No luck with MS Visual studio 2008. The c99-to-c89 converter seems to be failing during C compiler test.
      Just replacing the 2008 version of Visual studio with 2010 does the configuration without any problem. I need to check if we can use the libraries/dlls built with MSVC -2010 in a MSVC-2008 project.

      Delete
  3. i guess zeranoe has builds. In other case I can provide MSVC-2012 generated builds

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. See if this builds can help you guys.

      http://www.sendspace.com/file/cbl16w

      Delete
  4. Hello, thanks for the tutorial. It is great. I'm trying to build ffmpeg and ffplay with Visual Studio. I'm not able to find a way to specify SDL. Can you please give me some tips? Should I install SDL for MingW? Or use the MSVC version of SDL? Please help. Thanks in advance.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Please, I would like to ask how to setup 64bit compilation and also how to build Static Link version.

    Thanks a lot

    ReplyDelete
  7. I dont remember the installation so deeply now, I guess it could be one of the flag settings in configure command. Did you try that?

    ReplyDelete
    Replies
    1. That's possible, but the problem as I had understand it, is that this MinGW distribution is 32bit only, it doesn't have 64bit compiler. I had found some other tutorials using 64bit version of minGW distribution, which can compile to 64bit, but with that distribution, I had failed to .configure. The problem wasn't clean and I could see that more people had the same issue as me when googling, without any satisfiable result. That's why I came here if you hadn't try.

      But I don't understand the details, I am really completely new in this stuff.

      Thanks for your time !

      Delete
  8. Good Job! Follow the steps I could build on Windows with Visual studio 2013. But how could I build FFmpeg in debug mode. I found I couldn't step the source code of FFmpeg correctly from Visual studio.

    ReplyDelete
  9. After make succeed, i checked my msys/1.0, there was no a folder named local. What could be the problem?

    ReplyDelete
  10. Thank you very much for this - it was very helpful. Now on to figure out how to use the library.

    ReplyDelete
  11. This has been very helpful. Thanks.

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. Ok I haven't given it a go. But can I possibly debug through the FFmpeg code using VS2012 by following the above steps.

    ReplyDelete