title: OpenCV doesn't save the video
body: <p>I'm using the following code to read a video from file, apply the canny edge algorithm and write the modified video to a file. The code compiles and runs perfectly. But, the video is not written! I'm utterly confused. Please tell me what the error is.
  The file is not created at all! OS: Ubuntu 12.10</p>
  
  <p>Code for writing to the output file</p>
  
  <p>Opening the output file</p>
  
  <pre><code>bool setOutput(const std::string &amp;filename, int codec=0, double framerate=0.0, bool isColor=true) {
  
      outputFile= filename;
      extension.clear();
  
      if (framerate==0.0) 
          framerate= getFrameRate(); // same as input
  
      char c[4];
      // use same codec as input
      if (codec==0) { 
          codec= getCodec(c);
      }
  
      // Open output video
      return writer.open(outputFile, // filename
      codec, // codec to be used 
      framerate,      // frame rate of the video
      getFrameSize(), // frame size
      isColor);       // color video?
  }
  </code></pre>
  
  <p>Writing the frame</p>
  
  <pre><code>void writeNextFrame (Mat&amp; frame)
  {
      writer.write (frame);
  }
  </code></pre>
  
  <p>And there's a separate run method which executes these</p>