c++ - Compiling OpenCV on Raspberry Pi 2 -


i compiling opencv on raspberry 2 , jammed on step,

[ 18%] building cxx object modules/highgui/cmakefiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o 

with returned lot of error, take 2 of begining, other of them same different on { codec_id_h264, mktag('h', '2', '6', '4') },

in file included /home/pi/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:60:0,                  /home/pi/opencv/modules/highgui/src/cap_ffmpeg.cpp:45: /home/pi/opencv/modules/highgui/src/ffmpeg_codecs.hpp:104:7: error: 'codec_id_h264' not     declared in scope      { codec_id_h264, mktag('h', '2', '6', '4') },        ^ /home/pi/opencv/modules/highgui/src/ffmpeg_codecs.hpp:105:7: error: 'codec_id_h264' not     declared in scope      { codec_id_h264, mktag('h', '2', '6', '4') },        ^ 

and final part about

/home/pi/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp: in member function 'double     cvcapture_ffmpeg::get_fps()': /home/pi/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:821:49: error: 'avstream' has no member named 'r_frame_rate'      double fps = r2d(ic->streams[video_stream]->r_frame_rate);                                              ^ in file included /home/pi/opencv/modules/highgui/src/cap_ffmpeg.cpp:45:0: /home/pi/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp: in function 'int         icv_av_write_frame_ffmpeg(avformatcontext*, avstream*, uint8_t*, uint32_t, avframe*)': /home/pi/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:1237:72: error: 'avcodec_encode_video'     not declared in scope          out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);                                                                     ^ modules/highgui/cmakefiles/opencv_highgui.dir/build.make:215: recipe target     'modules/highgui/cmakefiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o' failed make[2]: ** [modules/highgui/cmakefiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o] error 1 cmakefiles/makefile2:1823: recipe target 'modules/highgui/cmakefiles/opencv_highgui.dir/all'     failed make[1]: *** [modules/highgui/cmakefiles/opencv_highgui.dir/all] error 2 makefile:137: recipe target 'all' failed 

please me while stucked on long time after tried few times, thank you

this error due fact using ffmpeg repositories. when building opencv source recommended build respective ffmpeg version too. remove installation of ffmpeg , x264 pi , build.

check this guide here more information.


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -