# Webcam examples do not work

**URL:** <https://discuss.pynq.io/t/webcam-examples-do-not-work/1025>\
**Category:** Support\
**Created:** [March 16, 2020, 9:08pm UTC](https://discuss.pynq.io/t/webcam-examples-do-not-work/1025 "2020-03-16T21:08:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfny](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mfny](https://discuss.pynq.io/u/mfny)\
**Post date:** [March 16, 2020, 9:08pm UTC](https://discuss.pynq.io/t/webcam-examples-do-not-work/1025/1 "2020-03-16T21:08:41Z")

</div>

Hi all, having an issue whereby the only webcam example that works is the one in: /common/usb\_webcam.ipynb

I get the following error:  
\<contextlib.\_GeneratorContextManager at 0xae75d7f0\>

In the following cell:

Mode = VideoMode(640,480,24)  
hdmi\_out = base.video.hdmi\_out  
hdmi\_out.configure(Mode,PIXEL\_BGR)  
hdmi\_out.start()

In the demo at base/video/opencv\_face\_detect\_webcam.ipynb…

Webcam is a Logitech C270 and the only odd thing about my setup is I have the Pynq HDMI plugged into the secondary input on my monitor so I have to switch from my PC where I am using the Pynq from to that second input after I start things in Jupyter.

Anyone have any ideas ?

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [March 16, 2020, 9:11pm UTC](https://discuss.pynq.io/t/webcam-examples-do-not-work/1025/2 "2020-03-16T21:11:54Z")

</div>

I think maybe you want to try to use the HDMI port solely for your board, instead of switching it manually?

---

<div class="post-metadata">

**Author:** ![mfny](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mfny](https://discuss.pynq.io/u/mfny)\
**Post date:** [March 16, 2020, 9:24pm UTC](https://discuss.pynq.io/t/webcam-examples-do-not-work/1025/3 "2020-03-16T21:24:13Z")

</div>

That means getting a second display set up which is a pain but I shall try that.

---

<div class="post-metadata">

**Author:** ![mfny](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mfny](https://discuss.pynq.io/u/mfny)\
**Post date:** [March 17, 2020, 3:30am UTC](https://discuss.pynq.io/t/webcam-examples-do-not-work/1025/4 "2020-03-17T03:30:26Z")

</div>

I changed the video mode and got display but all I get is one still frame, not a moving image ?

---

<div class="post-metadata">

**Author:** ![mfny](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mfny](https://discuss.pynq.io/u/mfny)\
**Post date:** [March 17, 2020, 5:24am UTC](https://discuss.pynq.io/t/webcam-examples-do-not-work/1025/5 "2020-03-17T05:24:08Z")

</div>

So I have had a guess at what I need to do to make this output live video… keep in mind I am going in blind here and just guessing from the examples and some googling what is needed but I am close I think ? but get the following with the following… attached as a screenshot as I am not sure how else to post exactly what is going on ?

 ![Annotation 2020-03-17 052156](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/9b46333469f3e4e6a803e64ebe92ff6e2aa88b4c.png)
