擅长:python、mysql、java
<p>当您放置<code>cap.isOpened()</code>时,它会检查视频是否已正确读取,因此<code>while</code>循环在那里不起作用。</p>
<p>但当您更改为<code>while True</code>时,它将在没有正确读取的情况下执行,这就是它给出错误的原因。</p>
<blockquote>
<p>Make sure than you are properly reading the video file.</p>
</blockquote>