title: How do I avoid an unsupported frame rate error?
body: <p>I am on a Macbook and I am trying to read video from a camera using the ffmpeg library. The camera is a 10 meter USB underwater camera. I am using the C API through a D binding called ffmpeg-d. 
  However, upon trying to open the input, I get this:</p>
  
  <pre><code>[avfoundation @ 0x7fe0d2800000] Selected framerate (29.970030) is not supported by the device
  [avfoundation @ 0x7fe0d2800000] Supported modes:
  [avfoundation @ 0x7fe0d2800000]   160x120@[30.000030 30.000030]fps
  [avfoundation @ 0x7fe0d2800000]   176x144@[30.000030 30.000030]fps
  [avfoundation @ 0x7fe0d2800000]   320x240@[30.000030 30.000030]fps
  [avfoundation @ 0x7fe0d2800000]   352x288@[30.000030 30.000030]fps
  [avfoundation @ 0x7fe0d2800000]   640x480@[30.000030 30.000030]fps
  </code></pre>
  
  <p>So how can I avoid this problem? Would setting the framerate manually be the answer? And if so, how could I do that?</p>
  
  <p>Here is a really short program to replicate my problem.</p>
  
  <pre><code>import std.stdio;
  
  import ffmpeg.libavdevice.avdevice;
  import ffmpeg.libavcodec.avcodec;
  import ffmpeg.libavformat.avformat;
  import ffmpeg.libavfilter.avfilter;
  import ffmpeg.libavutil.avutil;
  import ffmpeg.libavutil.mem;
  import ffmpeg.libavutil.pixfmt;
  import ffmpeg.libswscale.swscale;
  
  import std.string;
  
  void main()
  {
      av_register_all();
      avdevice_register_all();
  
      string           cameraSource        = "USB";
  
      AVCodecContext*  cameraCodecContext  = null;
      AVFormatContext* cameraFormatContext = avformat_alloc_context();
      AVCodec*         cameraCodec         = null;
      AVInputFormat*   cameraFormat        = av_find_input_format("avfoundation");
      AVFrame*         rawFrame = null, convertedFrame = null;
  
      if (avformat_open_input(&amp;cameraFormatContext, cameraSource.toStringz, cameraFormat, null) != 0) return;
  }
  </code></pre>