我正在尝试使用cmake编译OpenCV,但我不断收到以下错误。
[ 73%] Building CXX object src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o
In file included from /usr/include/libavutil/avutil.h:81:0,
from /usr/include/libavcodec/avcodec.h:30,
from /usr/include/libavformat/avformat.h:56,
from /vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:97:
/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
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvCapture_FFMPEG::grabFrame()’:
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:546:9: warning: ‘int avcodec_decode_video(AVCodecContext*, AVFrame*, int*, const uint8_t*, int)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3452)
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:548:54: warning: ‘int avcodec_decode_video(AVCodecContext*, AVFrame*, int*, const uint8_t*, int)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3452)
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::open(const char*, int, double, CvSize, bool)’:
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:1199:8: warning: ‘AVOutputFormat* guess_format(const char*, const char*, const char*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:787)
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:1199:41: warning: ‘AVOutputFormat* guess_format(const char*, const char*, const char*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:787)
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:1213:7: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/include/libavformat/avformat.h:947)
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:1213:31: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/include/libavformat/avformat.h:947)
make[2]: *** [src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o] Error 1
make[1]: *** [src/highgui/CMakeFiles/highgui.dir/all] Error 2
make: *** [all] Error 2
我不知道为什么这样做。我真的很感激任何建议。
答案 0 :(得分:2)
我假设您正在使用C ++编译器进行编译。如果这样做,您应该定义一个__STDC_CONSTANT_MACROS
标志,以使整个事情成功编译。
更多信息:FFMPEG FAQ
答案 1 :(得分:1)
我在尝试为ffmpeg
安装OpenCV
时遇到了一些问题。
检查这个问题:Error in installing Open-CV with ffmpeg:你会找到一些指示和指向编译教程的链接。