title: Creating Video with OpenCV - Gstreamer codec not working
body: <p>I'm trying to write a video to disk using OpenCV. The code uses a video writer object to save the file in a .mpg format and with 30 frame/sec. I've specified the codec using the CV_FOURCC macro as follows:</p>
  
  <pre><code>VideoWriter put("test.mpg", CV_FOURCC('M','P','E','G'), 30, S);
  </code></pre>
  
  <p>when I execute the code I get the error:</p>
  
  <pre><code>userk@dopamine:~/Development/opencv-2.4.8/sketch/RegVideo$ ./vi
  HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP
  OpenCV Error: Unsupported format or combination of formats (Gstreamer Opencv backend doesn't support this codec acutally.) in CvVideoWriter_GStreamer::open, file /home/userk/Development/opencv-2.4.8/modules/highgui/src/cap_gstreamer.cpp, line 505
  terminate called after throwing an instance of 'cv::Exception'
    what():  /home/userk/Development/opencv-2.4.8/modules/highgui/src/cap_gstreamer.cpp:505: error: (-210) Gstreamer Opencv backend doesn't support this codec acutally. in function CvVideoWriter_GStreamer::open
  
  Aborted (core dumped)
  </code></pre>
  
  <p>I've tried differents codecs such as MPEG-1, motion-jpeg, MPEG-4.2, MPEG-4.3, MPEG-4, H263, H263I and FLV1 but none of them worked. The problem seems to be V4L. </p>
  
  <p>I've tried to install it with the following command, but I got errors after the make:</p>
  
  <pre><code>wget http://www.linuxtv.org/downloads/v4l-utils/v4l-utils-0.9.3.tar.bz2
  tar xvf v4l-utils-0.9.3.tar.bz2
  cd v4l-utils-0.9.3
  make
  sudo make install
  </code></pre>
  
  <p>This is the error message:</p>
  
  <blockquote>
    <p>make[3]: <strong>* [qv4l2-moc_qv4l2.o] Error 1
    make[3]: Leaving directory <code>/home/userk/Development/opencv-2.4.8/dependencies/v4l-utils-1.0.1/utils/qv4l2'
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory</code>/home/userk/Development/opencv-2.4.8/dependencies/v4l-utils-1.0.1/utils'
    make[1]: <em></strong> [all-recursive] Error 1
    make[1]: Leaving directory `/home/userk/Development/opencv-2.4.8/dependencies/v4l-utils-1.0.1'
    make: *</em>* [all] Error 2</p>
  </blockquote>
  
  <p>What's wrong with v4l? Do you have any advice?</p>