# \[RFSoC 4x2\] issue with the notebook display\_port\_introduction

**URL:** <https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077>\
**Category:** Support\
**Created:** [May 28, 2024, 10:41pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077 "2024-05-28T22:41:21Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@matthew](https://discuss.pynq.io/u/matthew)\
**Post date:** [May 28, 2024, 10:41pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/1 "2024-05-28T22:41:21Z")

</div>

Hi Everyone,

I want to execute the provided notebook of the display port for the RFSoC 4x2:  
([RFSoC-PYNQ/boards/RFSoC4x2/notebooks/common/display\_port\_introduction.ipynb at master · Xilinx/RFSoC-PYNQ · GitHub](https://github.com/Xilinx/RFSoC-PYNQ/blob/master/boards/RFSoC4x2/notebooks/common/display_port_introduction.ipynb))

But I have an error with cv2.VideoCapture(0).

 ![cv2 error](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/4/4b8aac627a3e4857fe759b581bc02a10fd4ad89c.jpeg)

Did someone also meet this error?

It might be related to that issue:

([python - OpenCv error can't open camera through video capture - Stack Overflow](https://stackoverflow.com/questions/59371075/opencv-error-cant-open-camera-through-video-capture))

Thank you in advance for your help

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [May 29, 2024, 8:31pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/2 "2024-05-29T20:31:04Z")

</div>

Do you have a camera connected and is it recognized?  
Try running:  
`ls /dev/video*`

If the camera is recognized, but has a different index, you can modify the code.

Cathal

---

<div class="post-metadata">

**Author:** ![matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@matthew](https://discuss.pynq.io/u/matthew)\
**Post date:** [May 29, 2024, 10:20pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/3 "2024-05-29T22:20:49Z")

</div>

I ran l **s /dev/video** \*, I got /dev/video0 and /dev/video1. I ran **lsusb** , and my webcam was correctly detected:

 ![camera](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/c/c6aec49b3ac6f95d037bf079888c24c2b7178d45.png)

My webcam is a Microsoft LifeCamHD-3000:  
([Microsoft LifeCam HD-3000 review | Digital Camera World](https://www.digitalcameraworld.com/reviews/microsoft-lifecam-hd-3000-review))

Its datasheet can be downloaded here: ([https://download.microsoft.com/documents/uk/hardware/TDS\_LifeCamHD-3000\_1103A.pdf](https://download.microsoft.com/documents/uk/hardware/TDS_LifeCamHD-3000_1103A.pdf))

What did you mean by “If the camera is recognized, but has a different index, you can modify the code.” If it is about the index 0, 1 or -1 of cv2.VideoCapture, I changed it but I still got the issue.

Is pynq support the correct entity to ask for a possible modification of the jupyter notebook available online? Or would I have to contact another entity?

Sincerely

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [May 30, 2024, 8:41am UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/4 "2024-05-30T08:41:36Z")

</div>

Hi @matthew,

Can you try passing some flags to OpenCV when opening the camera. Try both index 0 and 1

```python
index = 0
index += cv2.CAP_V4L2
capture = cv2.VideoCapture(index)

```

Alternatively, you can try with different flag

```python
flag = cv2.CAP_DSHOW # or cv2.CAP_MSMF
index = 0
capture = cv2.VideoCapture(index, flag)

```

Can you also report ?

```bash
ls -la /dev/video*

```

Mario

---

<div class="post-metadata">

**Author:** ![matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@matthew](https://discuss.pynq.io/u/matthew)\
**Post date:** [May 30, 2024, 3:03pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/5 "2024-05-30T15:03:40Z")

</div>

Hi,

This part of the notebook is working with **capture = cv2.VideoCapture(0, cv2.CAP\_V4L2)**.

ls -la /dev/video\* is displaying:  
 ![ls la](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/c/cb6f583fc4f78a7ed67921b5fd9121280029e92a.png)

I have another problem at the end of the notebook. I want to send the capture of the webcam on the minidisplay port.  
The end of the notebook is executing, but nothing is displayed on a screen connected to the minidisplay port.  
I did a print(frame), and the frame was empty:

 ![empty frame](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/3/3ec7b3a8ebf2cca4ce8d2a85553b17a95d593e1e.png)

The screen is correctly connected to the minidisplay port because the start of the notebook is working: I have a blue alternation on the screen. My webcam was also tested and validated from the notebook usb\_webcam:  
([RFSoC-PYNQ/boards/RFSoC4x2/notebooks/common/usb\_webcam.ipynb at master · Xilinx/RFSoC-PYNQ · GitHub](https://github.com/Xilinx/RFSoC-PYNQ/blob/master/boards/RFSoC4x2/notebooks/common/usb_webcam.ipynb))

Does someone have this issue too, or can reproduce it?

Sincerely

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [May 30, 2024, 3:24pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/6 "2024-05-30T15:24:52Z")

</div>

Looks like the camera capture is empty. Did you try with index 1?

Can you try `capture = cv2.VideoCapture(0+ cv2.CAP_V4L2)`?

---

<div class="post-metadata">

**Author:** ![matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@matthew](https://discuss.pynq.io/u/matthew)\
**Post date:** [May 30, 2024, 8:59pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/7 "2024-05-30T20:59:37Z")

</div>

I tried **capture = cv2.VideoCapture(0+ cv2.CAP\_V4L2)**, but the frame was still empty. Same thing with an index of 1.

I think that the error is in **capture.read(frame)**, because in the notebook usb\_webcam, another method was used to fill the frame, and worked: **ret, frame = capture.read()**

Can you check this possibility, please?

Sincerely

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [May 31, 2024, 12:43pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/8 "2024-05-31T12:43:57Z")

</div>

In the failing notebook can you try?

```python
for _ in range(number_frames):
    frame = displayport.newframe()
    ret, img = capture.read()
    frame[:] = img
    displayport.writeframe(frame)

```

---

<div class="post-metadata">

**Author:** ![matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@matthew](https://discuss.pynq.io/u/matthew)\
**Post date:** [May 31, 2024, 4:01pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/9 "2024-05-31T16:01:52Z")

</div>

I tried that **ret, img = capture.read()** and **frame[:] = img** and it worked: my stream was displayed on my screen. Thank you for the indication.  
I just had to modify the resolution of capture.set, because **capture.set(3,1280)** showed me a lower resolution. But that is a cv2 strange issue.

To sum up this request, is it possible to modify the notebook in two ways: change  
**capture = cv2.VideoCapture(0)** into **capture = cv2.VideoCapture(0, cv2.CAP\_V4L2)** and change  
**capture.read(frame)**  
into  
**ret, img = capture.read()**  
**frame[:] = img**

I thank everyone who helped with these issues once again.

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [May 31, 2024, 4:36pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/10 "2024-05-31T16:36:20Z")

</div>

> [@matthew](#):
>
> is it possible to modify the notebook in two ways

I encourage you to do a PR with these changes. 😀

---

<div class="post-metadata">

**Author:** ![matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@matthew](https://discuss.pynq.io/u/matthew)\
**Post date:** [May 31, 2024, 4:53pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/11 "2024-05-31T16:53:29Z")

</div>

To who should I do a personal request? To the responsible of the github of the Jupyter notebook?

I just don’t understand if this Pynq support forum is managed by AMD, and to who adress these jupyter issues

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [May 31, 2024, 5:07pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/12 "2024-05-31T17:07:48Z")

</div>

> [@matthew](#):
>
> I just don’t understand if this Pynq support forum is managed by AMD, and to who adress these jupyter issues

It is managed by the PYNQ team. These issues belong to the forum, but since there is a solution, I appreciate if you could contribute it back to the repo with a PR,

---

<div class="post-metadata">

**Author:** ![matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@matthew](https://discuss.pynq.io/u/matthew)\
**Post date:** [May 31, 2024, 7:26pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/13 "2024-05-31T19:26:30Z")

</div>

What is a PR? Is it a Partial Reconfiguration? I am sorry, I do not know how to do it.

From what I see online, a PR is related to the bitstream. But the issues are not with the bitstream, the PL. The issues are with the jupyter notebook, the PS.

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [May 31, 2024, 9:09pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/14 "2024-05-31T21:09:22Z")

</div>

Pull Request in GitHub with the changes that fixes the issue.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/system/32/2_2.png) [@system](https://discuss.pynq.io/u/system)\
**Post date:** [June 3, 2024, 9:10pm UTC](https://discuss.pynq.io/t/rfsoc-4x2-issue-with-the-notebook-display-port-introduction/7077/15 "2024-06-03T21:10:22Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
