# How to debug failures with cv2.VideoCapture(\<video\_file\>)

**URL:** <https://forum.opencv.org/t/how-to-debug-failures-with-cv2-videocapture-video-file/7789>\
**Category:** Uncategorized\
**Tags:** videoio\
**Created:** [March 3, 2022, 11:48am UTC](https://forum.opencv.org/t/how-to-debug-failures-with-cv2-videocapture-video-file/7789 "2022-03-03T11:48:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amurthy](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@amurthy](https://forum.opencv.org/u/amurthy)\
**Post date:** [March 3, 2022, 11:48am UTC](https://forum.opencv.org/t/how-to-debug-failures-with-cv2-videocapture-video-file/7789/1 "2022-03-03T11:48:10Z")

</div>

I am trying to call:

`cap = cv2.VideoCapture(video.mp4)`

on a local video file and the result of

`cap.isOpened()` is False

My question is if it’s possible to get a more detailed error message of what went wrong? Probably it is something to do with my setup, maybe some missing drivers, but it’s hard to tell just from this message.

I have tried this on my local machine cv2 setup and it works for the same video, but I think on my remote server there must be something different with the setup and I’m trying to figure out what it is.

Thanks in advance for any help!

---

<div class="post-metadata">

**Author:** ![amurthy](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@amurthy](https://forum.opencv.org/u/amurthy)\
**Post date:** [March 3, 2022, 12:11pm UTC](https://forum.opencv.org/t/how-to-debug-failures-with-cv2-videocapture-video-file/7789/2 "2022-03-03T12:11:44Z")

</div>

Figure it out, I need to run my program with

`OPENCV_VIDEOIO_DEBUG=1`
