Ask Your Question

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

asked 2016-01-17 20:50:05 -0500

My system is centos 6.7

I am installing opencv according the official web:

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?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2016-07-06 09:44:29 -0500

I just hit this same problem with Scientific Linux 6.7 (like CentOS 6.7 also based on RHEL 6.7).

Following a hint at I reran my CMake command but also including -D WITH_FFMPEG=OFF option.

HTH, Simon

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-01-17 20:32:47 -0500

Seen: 963 times

Last updated: Jan 17 '16