Ask Your Question
0

Unresoved - avformat_free_context’ was not declared in this scope

asked 2014-05-04 04:25:20 -0600

mariusl gravatar image

Hi I am new to opencv. I just downloaded the latest source and I am following the installation procedures as given on the website. I get this error and after searching the questions others have asked, I still dont have an answer to this problem.

[ 39%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/loadsave.cpp.o In file included from /home/marius/dev/opencv-2.4.9/modules/highgui/src/cap_ffmpeg.cpp:45: /home/marius/dev/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘void CvVideoWriter_FFMPEG::close()’: /home/marius/dev/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp:1445: error: ‘avformat_free_context’ was not declared in this scope make[2]: * [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o] Error 1

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2014-06-12 06:51:32 -0600

JonHuang gravatar image

updated 2014-06-12 06:54:02 -0600

Modify the 1445th line of opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp:

avformat_free_context(oc);

to:

#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 2, 0)
    avformat_free_context(oc);
#else
    av_free_format_context(oc);
#endif

Or, try to upgrade ffmpeg >= 0.10.11

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-05-04 04:25:20 -0600

Seen: 3,649 times

Last updated: Jun 12 '14