title: OpenCV VideoWriter does not open file
body: <p>The following code fails to open a VideoWriter object:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #include &lt;opencv2/core/core.hpp&gt;
  #include &lt;opencv2/imgproc/imgproc.hpp&gt;
  #include &lt;opencv2/highgui/highgui.hpp&gt;
  
  using namespace cv;
  using namespace std;
  
  int main() {
      VideoWriter oVideo;
      oVideo.open ("381.avi", -1, 30, Size(640,480), true);
      if (!oVideo.isOpened()) {
          cout  &lt;&lt; "Could not open the output video for write" &lt;&lt; endl;
          return -1;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>I'm running OpenCV 2.4.9 pre-built with Code::Blocks on Ubuntu 12.04. I've written a number of images using <code>imwrite()</code> on the same location without issue, so I doubt it has to do with permissions. Also I tried <code>CV_FOURCC('X','V','I','D')</code> which did not work.</p>
  
  <p>What am I missing here?</p>
  
  <p>Any help is greatly appreciated.</p>