I am trying to get a video stream from a camera on my RPI 4. When I try to run this simple video capture script as a test to stream from /dev/video0, I get the following error:
import cv2
print("starting")
cap = cv2.VideoCapture(0)
if cap.isOpened():
print("streaming!")
Error:
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
When running v4l2-ctl --device /dev/video0 --list-formats-ext, I get this output:
Although I am not sure how this can be used.
I don’t know where to begin fixing this problem. Any help would be appreciated!