Ask Your Question
0

OpenCV 3.0.0 and FFMPEG building errors

asked 2015-09-22 09:33:13 -0500

timhou gravatar image

Hello,

OpenCV was building fine untill I added FFMPEG libraries. The FFMPEG version I use is 2.8.

This is the error i'm getting:

Scanning dependencies of target opencv_videoio
[ 39%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap.cpp.o
[ 39%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_images.cpp.o                                                                              
[ 39%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_encoder.cpp.o                                                                       
[ 39%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_decoder.cpp.o                                                                       
[ 39%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dc1394_v2.cpp.o                                                                           
[ 39%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_libv4l.cpp.o                                                                              
[ 40%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o                                                                              
In file included from /home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg.cpp:45:0:
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘void CvCapture_FFMPEG::close()’:
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:317:36: error: ‘avcodec_free_frame’ was not declared in this scope
         avcodec_free_frame(&picture);
                                    ^
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::open(const char*)’:
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:632:43: error: ‘avcodec_alloc_frame’ was not declared in this scope
             picture = avcodec_alloc_frame();
                                           ^
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:635:41: error: ‘PIX_FMT_BGR24’ was not declared in this scope
                     avpicture_get_size( PIX_FMT_BGR24,
                                         ^
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::retrieveFrame(int, unsigned char**, int*, int*, int*, int*)’:
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:738:67: error: ‘PIX_FMT_RGB24’ was not declared in this scope
     avpicture_fill((AVPicture*)&rgb_picture, rgb_picture.data[0], PIX_FMT_RGB24,
                                                                   ^
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:756:17: error: ‘PIX_FMT_BGR24’ was not declared in this scope
                 PIX_FMT_BGR24,
                 ^
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘AVFrame* icv_alloc_picture_FFMPEG(int, int, int, bool)’:
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1110:35: error: ‘avcodec_alloc_frame’ was not declared in this scope
     picture = avcodec_alloc_frame();
                                   ^
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1113:33: error: ‘PixelFormat’ was not declared in this scope
     size = avpicture_get_size( (PixelFormat) pix_fmt, width, height);
                                 ^
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1122:38: error: expected ‘)’ before ‘pix_fmt’
                        (PixelFormat) pix_fmt, width, height);
                                      ^
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘AVStream* icv_add_video_stream_FFMPEG(AVFormatContext*, AVCodecID, int, int, int, double, int)’:
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1230:19: error: ‘PixelFormat’ was not declared in this scope
     c->pix_fmt = (PixelFormat) pixel_format;
                   ^
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvVideoWriter_FFMPEG::writeFrame(const unsigned char*, int, int, int, int, int)’:
/home/carlaptop/Projects/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1405:26: error: ‘PIX_FMT_BGR24’ was not declared in this scope ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2015-09-23 10:29:03 -0500

maythe4thbewithu gravatar image

use newest source from here will solve the problem.

you might also need this post

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-09-22 09:33:13 -0500

Seen: 4,324 times

Last updated: Sep 23 '15