title: FFMPEG: ‘PIX_FMT_BGR24’ was not declared in this scope
body: <p>I am building a simple decoding application using FFMPEG API. I know there are solutions available in OpenCV but for specific reason I am refraining myself from using that. Since I am very new to FFMPEG (and to this community as well), I would like to know if there is any mistake that I might have done while building FFMPEG. </p>
  
  <p><strong>Compiler</strong>: I am using gcc 5.3.0 for compilation and building.</p>
  
  <p>Following are the steps that I followed: </p>
  
  <ol>
  <li><p>I have build FFMPEG library using following configuration:  </p>
  
  <blockquote>
    <p>./configure --prefix=/home/dep/ffmpeg/install/ --pkg-config-flags=--static --enable-gpl --disable-yasm</p>
  </blockquote></li>
  <li><p>My compiling command is for the application: </p>
  
  <blockquote>
    <p>g++ -std=c++11 -I/home/dep/ffmpeg/install/include/ Queue.cpp Image.cpp CaptureFFMPEGFrame.cpp Object.cpp main.cpp -o main  -L/home/dep/ffmpeg/install/lib -lavutil -lavcodec -lavformat -lavdevice -lavfilter -lswscale -lswresample -lpostproc -lpthread -lz -lrt -llzma -lbz2</p>
  </blockquote></li>
  </ol>
  
  <p>The error I am facing is : </p>
  
  <pre><code>CaptureFFMPEGFrame.cpp:203:169: error: ‘PIX_FMT_BGR24’ was not declared in this scope
       mpFrameSwsContext = sws_getContext(mpAVCodecContext-&gt;width, mpAVCodecContext-&gt;height, mpAVCodecContext-&gt;pix_fmt, mpAVCodecContext-&gt;width, mpAVCodecContext-&gt;height, PIX_FMT_BGR24, SWS_BICUBIC, NULL, NULL, NULL)
  </code></pre>
  
  <p><strong>My effort and understanding:</strong> </p>
  
  <ol>
  <li><p>From my understanding, libavutil/pixfmt.h contains pixel formats which I included along with other includes and the error persists. You can also see libraries I have included along with my application. </p></li>
  <li><p>Since my program is cpp code, therefore my headers are already included using extern "C", i.e. <code>#include "libavcodec/avcodec.h"</code>  </p></li>
  </ol>
  
  <p>Anything I might have missed?</p>
  
  <p>Many thanks.</p>