Compiling OpenCV on Raspberry Pi 2
<p>I am compiling OpenCV on a Raspberry 2
and I am jammed on this step,</p>

<pre><code>[ 18%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o
</code></pre>

<p>with returned a lot of error, I take only 2 of the begining, other of them look the same
but different on <code>{ CODEC_ID_H264, MKTAG('h', '2', '6', '4') },</code></p>

<pre><code>In file included from /home/pi/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:60:0,
                 from /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' was not     declared in this scope
     { CODEC_ID_H264, MKTAG('H', '2', '6', '4') },
       ^
/home/pi/opencv/modules/highgui/src/ffmpeg_codecs.hpp:105:7: error: 'CODEC_ID_H264' was not     declared in this scope
     { CODEC_ID_H264, MKTAG('h', '2', '6', '4') },
       ^
</code></pre>

<p>and the final part is about</p>

<pre><code>/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-&gt;streams[video_stream]-&gt;r_frame_rate);
                                             ^
In file included from /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'     was not declared in this scope
         out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
                                                                    ^
modules/highgui/CMakeFiles/opencv_highgui.dir/build.make:215: recipe for 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 for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all'     failed
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
</code></pre>

<p>Please help me for this while I get stucked on it for a long time after tried few times, thank you</p>