# Open Webcam With Opencv

**URL:** <https://forum.opencv.org/t/open-webcam-with-opencv/14026>\
**Category:** Python\
**Tags:** programming\
**Created:** [July 26, 2023, 6:24am UTC](https://forum.opencv.org/t/open-webcam-with-opencv/14026 "2023-07-26T06:24:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erkan\_Unal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/erkan_unal/32/8401_2.png) [@Erkan\_Unal](https://forum.opencv.org/u/Erkan_Unal)\
**Post date:** [July 26, 2023, 6:24am UTC](https://forum.opencv.org/t/open-webcam-with-opencv/14026/1 "2023-07-26T06:24:10Z")

</div>

cap = self.get\_video\_capture() Although the camera light was on while the this code were being written, the camera tab would not open.  
cap = cv2.VideoCapture(0, cv2.CAP\_DSHOW) After replacing with these codes, the camera tab started to open.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [July 26, 2023, 9:12am UTC](https://forum.opencv.org/t/open-webcam-with-opencv/14026/2 "2023-07-26T09:12:39Z")

</div>

please, NO useless screenshots of your ide here.

post code / errors as TEXT, thank you.
