<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt;  3.4 and 4.3</li>
<li>Operating System / Platform =&gt; Ubuntu 18.04</li>
<li>Compiler =&gt; GCC 7.5.0</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I'm having some trouble since I changed from OpenCV 3.2 (repo version) to 4.x (compiled from source) in my C++ project (also happens in 3.4). I've replicated this behaviour in a small example that just opens a webcam and records for 5 seconds.</p>
<p dir="auto">With 3.2 and 3.3 I am able to set the webcam framerate to 30 at full hd, but the same code with 3.4 or 4.3 just ignores the camera.set(cv::CAP_PROP_FPS,30) and sets it to 5 instead. If I use 720p, the fps is set to 10.</p>
<p dir="auto">I've done more tests with other two computers and different cameras. One yields the same result, but a Macbook Pro running the same distribution OpenCV 4.3 seems to work. The two computers where I get the fps problem are desktops with usb webcams.</p>
<h5 dir="auto">Issue submission checklist</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I report the issue, it's not a question

</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I checked the problem with documentation, FAQ, open issues,<br>
answers.opencv.org, Stack Overflow, etc and have not found solution

</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I updated to latest OpenCV version and the issue is still there

</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> There is reproducer code and related data files: videos, images, onnx, etc

</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#include &quot;opencv2/opencv.hpp&quot;
#include &quot;iostream&quot;
#include &quot;thread&quot;
#include &lt;unistd.h&gt;

using namespace cv;

VideoCapture camera(0);
bool stop = false;
int fc = 0;

void saveFrames()
{
    while(!stop)
    {
        Mat frame;
        camera &gt;&gt; frame;
        cv::imwrite(&quot;/tmp/frames/frame&quot; + std::to_string(fc) + &quot;.jpg&quot;, frame);
        fc++;
    }
}

int main()
{
    if(!camera.isOpened())
        return -1;

    camera.set(cv::CAP_PROP_FRAME_WIDTH,1920);
    camera.set(cv::CAP_PROP_FRAME_HEIGHT,1080);
    camera.set(cv::CAP_PROP_FPS,30);

    double fps = camera.get(cv::CAP_PROP_FPS);
    std::cout &lt;&lt; &quot;FPS setting: &quot; &lt;&lt; fps &lt;&lt; std::endl; // 5 with OCV4, 30 with OCV3.2

    std::thread tr(saveFrames);
    int waitSeconds = 5;
    usleep(waitSeconds * 1e6);
    stop = true;
    tr.join();

    std::cout &lt;&lt; &quot;Written &quot; &lt;&lt; fc &lt;&lt; &quot; frames of &quot; &lt;&lt; fps * waitSeconds &lt;&lt; std::endl;
    return 0;
}"><pre class="notranslate"><code class="notranslate">#include "opencv2/opencv.hpp"
#include "iostream"
#include "thread"
#include &lt;unistd.h&gt;

using namespace cv;

VideoCapture camera(0);
bool stop = false;
int fc = 0;

void saveFrames()
{
    while(!stop)
    {
        Mat frame;
        camera &gt;&gt; frame;
        cv::imwrite("/tmp/frames/frame" + std::to_string(fc) + ".jpg", frame);
        fc++;
    }
}

int main()
{
    if(!camera.isOpened())
        return -1;

    camera.set(cv::CAP_PROP_FRAME_WIDTH,1920);
    camera.set(cv::CAP_PROP_FRAME_HEIGHT,1080);
    camera.set(cv::CAP_PROP_FPS,30);

    double fps = camera.get(cv::CAP_PROP_FPS);
    std::cout &lt;&lt; "FPS setting: " &lt;&lt; fps &lt;&lt; std::endl; // 5 with OCV4, 30 with OCV3.2

    std::thread tr(saveFrames);
    int waitSeconds = 5;
    usleep(waitSeconds * 1e6);
    stop = true;
    tr.join();

    std::cout &lt;&lt; "Written " &lt;&lt; fc &lt;&lt; " frames of " &lt;&lt; fps * waitSeconds &lt;&lt; std::endl;
    return 0;
}
</code></pre></div>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.4.4</li>
<li>Operating System / Platform =&gt; Ubuntu 16.04 64 Bit</li>
<li>Compiler =&gt; Python Version OpenCV 3.4.4</li>
</ul>
<p dir="auto"><strong>caffe version SSD detector supports multiple  "min_size" and "max_size" param<br>
but OpenCV gives a error:</strong></p>
<p dir="auto">[libprotobuf ERROR /io/opencv/3rdparty/protobuf/src/google/protobuf/text_format.cc:288] Error parsing text-format opencv_caffe.NetParameter: 913:13: Non-repeated field "min_size" is specified multiple times.<br>
Traceback (most recent call last):<br>
File "face_det.py", line 60, in <br>
net = cv.dnn.readNetFromCaffe(prototxt_file, caffeModel=caffemodel_file)<br>
cv2.error: OpenCV(3.4.4) /io/opencv/modules/dnn/src/caffe/caffe_io.cpp:1151: error: (-2:Unspecified error) FAILED: ReadProtoFromTextFile(param_file, param). Failed to parse NetParameter file: yufacedetectnet-open-v1.prototxt in function 'ReadNetParamsFromTextFileOrDie'</p>
<p dir="auto"><strong>the PriorBoxParameter which Caffe defined as below:</strong></p>
<p dir="auto">// Message that store parameters used by PriorBoxLayer<br>
message PriorBoxParameter {<br>
// Encode/decode type.<br>
enum CodeType {<br>
CORNER = 1;<br>
CENTER_SIZE = 2;<br>
CORNER_SIZE = 3;<br>
}<br>
<strong>// Minimum box size (in pixels). Required!<br>
repeated float min_size = 1;<br>
// Maximum box size (in pixels). Required!<br>
repeated float max_size = 2;</strong><br>
// Various of aspect ratios. Duplicate ratios will be ignored.<br>
// If none is provided, we use default ratio 1.<br>
repeated float aspect_ratio = 3;<br>
// If true, will flip each aspect ratio.<br>
// For example, if there is aspect ratio "r",<br>
// we will generate aspect ratio "1.0/r" as well.<br>
optional bool flip = 4 [default = true];<br>
// If true, will clip the prior so that it is within [0, 1]<br>
optional bool clip = 5 [default = false];<br>
// Variance for adjusting the prior bboxes.<br>
repeated float variance = 6;<br>
// By default, we calculate img_height, img_width, step_x, step_y based on<br>
// bottom[0] (feat) and bottom[1] (img). Unless these values are explicitely<br>
// provided.<br>
// Explicitly provide the img_size.<br>
optional uint32 img_size = 7;<br>
// Either img_size or img_h/img_w should be specified; not both.<br>
optional uint32 img_h = 8;<br>
optional uint32 img_w = 9;</p>
<p dir="auto">// Explicitly provide the step size.<br>
optional float step = 10;<br>
// Either step or step_h/step_w should be specified; not both.<br>
optional float step_h = 11;<br>
optional float step_w = 12;</p>
<p dir="auto">// Offset to the top left corner of each cell.<br>
optional float offset = 13 [default = 0.5];<br>
}</p>