Skip to content

Commit

Permalink
Add cv2.CAP_V4L2 to make sure V4L2 libraries are used
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Ruiz committed Nov 11, 2021
1 parent cae7894 commit cfeec7f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pynq_composable/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ def __init__(self, ol: Overlay, filename: str,
ol.hdmi_tx_control.write(0, 1)

def _configure(self):
"""Add cv2.CAP_V4L2 to make sure V4L2 libraries are used"""
if isinstance(self._file, int):
self._file += cv2.CAP_V4L2
self._videoIn = cv2.VideoCapture(self._file)
if not self._videoIn:
raise RuntimeError("OpenCV can't open {}".format(self._file))
Expand Down

0 comments on commit cfeec7f

Please sign in to comment.