green frame when playing rtsp
When I use cv2.VideoCapture to read rtsp frames by this code:
pipeline = "rtspsrc location=rtsp://my-url latency=20 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! appsink"
cap = cv2.VideoCapture(pipeline, cv2.CAP_GSTREAMER)
while True:
ret, frame = cap.read()
if ret:
frame_new = cv2.resize(frame, (640, 480))
cv2.imshow('frame', frame_new)
else:
print("ret false")
break
if cv2.waitKey(1) & 0xFF == ord('q'):
break
Green screen frames appear from time to time,like this:
The normal frame is:
I wonder what caused this.Thx for help