Sunday, May 8, 2011

OpenCV 2.1 with FFmpeg

In the past few dayes, I tried to install OpenCV, with FFmpeg enabled. During the process, I faced few problems. Fortunately, those errors seem solved. The first problem is an error seems like this:
"cvcap_ffmpeg.cpp:250: error: integer constant is too large for 'long' type"
You need to add two lines as follow in the beginning of ".../highgui/cvcap_ffmpeg.cpp".
#define INT64_C

Then, run make again. This error will be caused if your FFmpeg is properly installed. My first few attempts of installations seem lucky but the reality is that FFmpeg is not enabled.

The next error would looks like this:
/usr/include/libavutil/common.h: In function ‘int32_t av_clipl_int32(int64_t)’:
/usr/include/libavutil/common.h:154:47: error: ‘UINT64_C’ was not declared in
this scope
This problem is triggered by some incompatibilities of C code and C++ code. You could solve this by simply adding "-D__STDC_CONSTANT_MACROS" in "Extra_C_Flags", like what I did in the following image.


  1. I've trying to install opencv for ages now, I always have problems. Can you tell me how to install it with ffmpeg disabled? In the meantime I will try to do what you say here... and subscribe to this blog, proves to be pretty usefull.

  2. Zloy, I think FFmpeg is disabled by default.