Ask Your Question
0

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

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

My system is centos 6.7

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

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
0

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

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 https://github.com/opencv/opencv/tree... 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

Stats

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

Seen: 1,277 times

Last updated: Jan 17 '16