title: How to force usage of specific codec with ffmpeg?
body: <p>I am trying to read a certain video file using ffmpeg, and have run into a bit of trouble.</p>
  
  <p>This is the code that starts to read it:</p>
  
  <pre><code>int _tmain(int argc, _TCHAR* argv[])
  {
      if (argc &lt; 2)
      {
          fprintf( stderr, "Filename is needed as an argument\n" );  
          return 1;  
      }
      /* register all formats and codecs */
      av_register_all();
      AVFormatContext* fmt_ctx = NULL;
      /* open input file, and allocate format context */
      const char *src_filename = argv[1];
      if (avformat_open_input(&amp;fmt_ctx, src_filename, NULL, NULL) &lt; 0) {
          fprintf(stderr, "Could not open source file %s\n", src_filename);
          abort();
      }
      /* retrieve stream information */
      AVDictionary *      options;
      int res = avformat_find_stream_info(fmt_ctx, &amp;options);
      if (res &lt; 0) {
          fprintf(stderr, "Could not find stream information\n");
          abort();
      }
      ...
  }
  </code></pre>
  
  <p>I am consistently getting the following message: </p>
  
  <blockquote>
    <p>[avi @ 005f2fe0] Could not find codec parameters for stream 0 (Video:
    none (GREY  / 0x59455247), 1280x1024): unknown codec </p>
    
    <p>Consider increasing the value for the 'analyzeduration' and 'probesize' options</p>
  </blockquote>
  
  <p>I get the same message when i run ffmpeg tool on the same file.</p>
  
  <p>However, i know what is in the video stream - raw video data with YUV8 format. In fact, when i pass that to ffmpeg via <code>-c:v rawvideo</code> option, there is no problem. Recoding, transforming etc - ffmpeg does it like the magic tool it is.</p>
  
  <p>Now, the question is: when using ffmpeg api, what is the equivalent of that option? I desperately need access to the frames of file.</p>