我尝试在两台 Mac 中编译 OpenCSV,但都出现错误。错误如下:
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版本
有人有同样的问题吗?
最佳答案
我基本上编辑了modules/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
就这样解决了。到目前为止没有任何问题。
关于ffmpeg - 在 macos 上编译 opencv 错误 - libavformat 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11563564/