How to set video format of camera in OpenCV ? CAP_PROP_FOURCC didn't work
<p>I'm using a camera which support 'MJPG' and 'YUY2'.
I found its default format is 'YUY2' but I want to use 'MJPG', so I used the code below.</p>

<pre><code>VideoCapture cap(0);
cap.set(CAP_PROP_FOURCC, CV_FOURCC('M', 'J', 'P', 'G'));
cout &lt;&lt; CV_FOURCC('M', 'J', 'P', 'G') &lt;&lt; endl;
cout &lt;&lt; cap.get(CAP_PROP_FOURCC) &lt;&lt; endl;
</code></pre>

<p>But it came out with below:</p>

<pre><code>1196444237
8.44715e+08
</code></pre>

<p>The first of is the FOURCC of 'MJPG' and the second is 'YUY2'.
In a world,set CAP_PROP_FOURCC didn't work.</p>

<p>So, How to set video format of camera in OpenCV ?</p>