2012-07-19 66 views
3

我试着在两个mac中编译OpenCSV,并且都出现错误。错误如下:在macos错误上编译opencv - libavformat中的错误

Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o 
use of undeclared identifier 'avformat_find_stream_info'; 
did you mean 'av_find_stream_info'? 
/usr/local/include/libavformat/avformat.h:1168:5: note: 'av_find_stream_info' declared here int av_find_stream_info(AVFormatContext *ic); 

/usr/local/include中的libavformat与ffmpeg一起安装。 Ffmpeg是0.8.5版本

任何人都有这个相同的问题?

+0

opencsv是一个用逗号分隔值解析文件的Java库。你的意思是计算机视觉库OpenCV? – blahdiblah 2012-07-19 21:28:38

+0

是的,我做过。那是一个错字。 – Sofia 2012-07-20 19:12:11

回答

2

我基本编辑的代码模块/ highgui/SRC/cap_ffmpeg_impl.hpp从

#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 3, 0) 
    avformat_find_stream_info(ic, NULL); 
#else 
    av_find_stream_info(ic); 
#endif 

#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 3, 0) 
    av_find_stream_info(ic); 
    //avformat_find_stream_info(ic, NULL); 
#else 
    av_find_stream_info(ic); 
#endif 

和解决它。目前没有问题。

+0

谢谢。同样的问题,相同版本的ffmpeg,同样的解决方案工作。 – VaporwareWolf 2013-07-04 06:32:13

1

您可以通过添加以下参数到cmake命令禁止的ffmpeg(见例如this manual):

-DWITH_FFMPEG=OFF 

假设你实际上并不需要的ffmpeg在你的构建,这将摆脱错误的。