title: Opencv Error on Ubuntu Webcam (Logitech C270) Capture -> HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP
body: <p>this erorr message appears on running simple camera capture on Ubuntu with logitech C270 (OpenCV 2.4.2/C++):</p>
  
  <blockquote>
    <p>HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP</p>
  </blockquote>
  
  <p>and further:</p>
  
  <blockquote>
    <p>Corrupt JPEG data: 2 extraneous bytes before marker 0xd1
    Corrupt JPEG data: 1 extraneous bytes before marker 0xd6
    Corrupt JPEG data: 1 extraneous bytes before marker 0xd0
    Corrupt JPEG data: 1 extraneous bytes before marker 0xd0</p>
  </blockquote>
  
  <p>I get frames but the values of frame width and height swapped when writing to a Mat object see below:</p>
  
  <pre><code>Mat frame;
  videoCapture = new VideoCapture(camId);
  if(!videoCapture-&gt;isOpened()) throw Exception();
  
  cout &lt;&lt; "Frame width: " &lt;&lt; videoCapture-&gt;get(CV_CAP_PROP_FRAME_WIDTH) &lt;&lt; endl;
  cout &lt;&lt; "Frame height: " &lt;&lt; videoCapture-&gt;get(CV_CAP_PROP_FRAME_HEIGHT) &lt;&lt; endl;
  
  (*videoCapture) &gt;&gt; frame;
  
  cout &lt;&lt; "Mat width: " &lt;&lt; frame.rows &lt;&lt; endl;
  cout &lt;&lt; "Mat height: " &lt;&lt; frame.cols &lt;&lt; endl;
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Frame width: 640
  Frame height: 480
  Mat width: 480
  Mat height: 640
  </code></pre>