<p dir="auto">CAP_PROP_FRAME_COUNT &amp;<br>
CAP_PROP_FRAME_WIDTH &amp;<br>
CAP_PROP_FRAME_HEIGHT &amp;<br>
CAP_PROP_FPS<br>
all return 0</p>
<p dir="auto">Android Opencv : 4.1.0<br>
Is't a bug? please fix it.</p>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.4.1</li>
<li>Operating System macOS High Sierra 10.13.6 / Platform =&gt; Android 7.1.1 API 25</li>
<li>Compiler =&gt; Android NDK</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<h6 dir="auto">Context</h6>
<p dir="auto">I'm writing a cross platform OpenCV based C++ library. The consuming code is a React Native Application through a <a href="https://facebook.github.io/react-native/docs/native-modules-android.html" rel="nofollow">react native native module</a>.</p>
<p dir="auto">To be perfectly clear, there is no access from Java Code to C++ OpenCV on Android. There are events with the result of the OpenCV C++ code sent to Javascript through the react native bridge.</p>
<p dir="auto">My native library is compiled on Android as a SHARED library. It is dynamically linked to the libopencv_world.so that is produced by the compilation of OpenCV C++ for Android.</p>
<h6 dir="auto">What it does</h6>
<p dir="auto">Basically, it opens the device's default camera and take snapshots.</p>
<h6 dir="auto">The outcome</h6>
<p dir="auto">This code is then ran on iOS and Android.</p>
<p dir="auto">This is working perfectly well on iOS.<br>
It fails on Android.</p>
<p dir="auto">Here is the failing part of C++ code on Adndroid:</p>
<h5 dir="auto">Steps to reproduce</h5>
<div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// cap is a cv::VideoCapture object    
if (cap.open(0))
        {
            cap.set(cv::CAP_PROP_FRAME_WIDTH, CAM_WIDTH);
            cap.set(cv::CAP_PROP_FRAME_HEIGHT, CAM_HEIGHT);
        }
        else
        {
            reject(&quot;false&quot;, &quot;cap.open(0) returned false&quot;);
        }"><pre class="notranslate"><span class="pl-c"><span class="pl-c">//</span> cap is a cv::VideoCapture object    </span>
<span class="pl-k">if</span> (cap.open(<span class="pl-c1">0</span>))
        {
            cap.<span class="pl-c1">set</span>(cv::CAP_PROP_FRAME_WIDTH, CAM_WIDTH);
            cap.<span class="pl-c1">set</span>(cv::CAP_PROP_FRAME_HEIGHT, CAM_HEIGHT);
        }
        <span class="pl-k">else</span>
        {
            <span class="pl-c1">reject</span>(<span class="pl-s"><span class="pl-pds">"</span>false<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>cap.open(0) returned false<span class="pl-pds">"</span></span>);
        }</pre></div>