python cv2.VideoCapture does not open
<p>I have a few avi files which I'm trying to read frame by frame.
I have used opencv 3.1.0 in order to read frames:</p>

<pre><code>import cv2
cap = cv2.VideoCapture(file_path)
</code></pre>

<p>and then I just read the frames of cap. This works fine on some of the videos. I took a few more videos recently and the same code comes up empty. I checked:</p>

<pre><code>cap.isOpened() # return False
</code></pre>

<p>and it seems like the video is not opened properly. As far as I'm concerned the only thing that changed is that the new videos are in color whereas the old ones were not. I don't know how that would change anything in the code. I checked that the videos open up just fine in other software (imageJ) so I'm confident the video itself is not the issue.</p>

<p>Any ideas why the new videos are not opening properly? I have not been able to find any information on how to debug this issue. Any advice would be greatly appreciated. </p>