Struggling with this issue? I have solved it and ready to share the info with you. Simple steps to take:

1. download the attached zip file (simpler) or from the ffmpeg project the following libs and dlls: swscale.lib,avcodec.lib, avcore.lib, avdevice.lib, avfilter.lib, avformat.lib, avutil.lib, avcodec-52.dll, avcore-0.dll, avdevice-52.dll, avfilter-1.dll, avformat-52.dll, avutil-50.dll, swscale-0.dll

2. Set your Visual Studio 2010 project settings to use the supplied header file and link against: libOpencvffmpeg.lib, ffmpeg and opencv-2.3 libraries (debug or release).

3. After building your program, copy the ffmpeg dll’s to your binary path or current exe directory.

4. You are done!

Link to pre-compiled binaries (lib, dll) and header file.