Making OpenCV-2.3 work with ffmpeg library and Microsoft Visual Studio 2010

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.


6 Responses

  1. Thansk for post!
    It works fine for release version.
    But heap corruption happens in debug.

  2. seems ok now.

    I added libOpencvffmpeg.lib – this fixed.
    Before this I add dependency directly on avformat-52.dll.


    Anyway, why OpenCV makes such headache? can not realize.

    • It is a real headache. I have worked on it just to crack this nut. Now, we can all enjoy reading all mpeg based videos smoothly using opencv. Thanks for the support, sergtk!


  4. Hello,

    I’m having trouble using FFMPEG with OpenCV 2.4 in VS2010. I copied all the DLLs and Libs into the OpenCV directory, but I can’t compile. It says : Cannot open “libOpencvffmpeg.lib”. I’m under Win7 x64. Do you have any idea?


  5. hi..I am facing same problem loading video file in opencv2.3. I want to implement offline object detection. But not able to read avi file or else.please help me out.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: