title: openCV cvCreateVideoWriter always returns null
body: <p>I am trying to save a video file with openCV under Mandriva Linux 2009.1.
  Unfortunately cvCreateVideoWriter always returns null although I could see and modify both and mpeg fiels, in other words cvCaptureFromCam, cvCaptureFromAvi, cvRetrieveFrame is working.</p>
  
  <p>I tried all the possible codecs from this <a href="http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html" rel="nofollow noreferrer">tutorial</a> and this codec <a href="http://opencv.willowgarage.com/wiki/VideoCodecs" rel="nofollow noreferrer">page</a>. I also tried 0 for uncompressed avi and -1 for a selection box in the fourcc parameter, but no choice has popped up and nothing happened. I also modified isColor to 0.</p>
  
  <p>I also have write permissions in the working directory.</p>
  
  <p>Here is the relevant code snippet:</p>
  
  <pre><code>    CvVideoWriter *writer = 0;
      int isColor = 1;
      int fps = 25;
      int frameW = 640;
      int frameH = 480;
  
  
      if( argc == 1 || (argc == 2 &amp;&amp; strlen(argv[1]) == 1 &amp;&amp; isdigit(argv[1][0])))
          capture = cvCaptureFromCAM( argc == 2 ? argv[1][0] - '0' : 0 );
      else if( argc == 2 ) {
          printf("argc == 2 :%s:\n", argv[1] );
          capture = cvCaptureFromFile( argv[1] );
      }
  
      cvInitSystem(argc,argv);
  
   writer = cvCreateVideoWriter("out.avi",CV_FOURCC('I','Y','U','V'),fps,cvSize(frameW,frameH),isColor);
  </code></pre>
  
  <p>What could be the problem?</p>