Steps for compiling OpenCV with FFMPEG support
1. download and install FFMPEG and OpenCV. (I used version1.0.0 of OpenCV)
2. download and install msys and MinGW. Start msys and go to $FFMPEGHOME.
3. ./configure --enable-shared --disable-static --disable-vhook --enable-memalign-hack
4. make;make install
5. open highgui.vcproj in text editor
6. change all 'HAVE_PNG;' to 'HAVE_PNG;HAVE_FFMPEG;' and save. Could alternatively be done from within MSVC but left out for brevity.
7. open highgui.vcproj in MSVC(make sure highgui.sln does not exist)
8. change project properties
a. add include directories: $MSYSHOME\usr\local\include\ffmpeg and $MSYSHOME\usr\local\include <--- for ffmpeg/av*.h and inttypes.h and stdint.h
b. add library directory: $MSYSHOME\usr\local\lib
c. add linker input: avcodec-51.lib avformat-51.lib avutil-49.lib
9. Remove cvcap_vfw.cpp from project
10. Add cvcap_ffmpeg.cpp to project
11. modify cvcap.cpp
add '#ifdef 0' to line 233 and '#endif' to end
12. modify cvcap_ffmpeg.cpp
at lines 494 and 496, change the AVRational declarations to explicit
at line 578, change snprintf to _snprintf(alternatively, '#define snprintf _snprintf')
13. in _highgui.h, nest '#ifndef HAVE_FFMPEG/#endif' around lines 104 and 135-136
14. From http://code.google.com/p/msinttypes/downloads/list, get inttypes.h and stdint.h and put them in $MSYSHOME\usr\local\include
15. build configuration.Now, cvCaptureFromFile can open MPEG-2 streams, while cvCaptureFromAVI still works as expected.
