Problem with gstreamer on Raspberry Pi 4

maybe you can use the V4L backend directly (w/o gstreamer issues):

VideoCapture(0, cv2.CAP_V4L)