Ask Your Question

Revision history [back]

compile error when using make: error: ‘struct AVFrame’ has no member named ‘format’ and so on

My system is centos 6.7

I am installing opencv according the official web: http://docs.opencv.org/3.1.0/dd/dd5/tutorial_py_setup_in_fedora.html.

I installed all the dependencies successfully, and type command according the instructions. But error occurs at make stage:

In file included from /home/hua/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:

/home/hua/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘AVFrame* icv_alloc_picture_FFMPEG(int, int, int, bool)’:

/home/hua/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1184: error: ‘struct AVFrame’ has no member named ‘format’

/home/hua/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1185: error: ‘struct AVFrame’ has no member named ‘width’

/home/hua/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1186: error: ‘struct AVFrame’ has no member named ‘height’

/home/hua/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘void

CvVideoWriter_FFMPEG::close()’: /home/hua/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1608: error: ‘avformat_free_context’ was not declared in this scope

make[2]: * [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1 make[1]: [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 make: ** [all] Error 2

What should I do now?