Open CrashLaker opened 3 years ago
this seems to render better snap images
cap = cv2.VideoCapture("rstp://....")
while True:
ret, frame = cap.read()
if not ret: continue
cv2.imwrite(" ", frame)
time.sleep(2)
Interesting, seems to be related to https://github.com/ReolinkCameraAPI/reolinkapipy/issues/25#issuecomment-738765454
Which camera are you using?
Also, we are using the FFMPEG streaming flag, as mentioned here https://github.com/ReolinkCameraAPI/reolinkapipy/blob/32e602571d8a67de15f1a82cba73d93d12c2e6d1/reolinkapi/utils/rtsp_client.py#L50
I have added a comment there in my last commit contemplating the necessity of it. It might be the reason for your streaming issues and @PortScanner. I thought that it might fix the issue opening the stream in its own thread as mentioned in this SO thread.
Hi In the meantime I am working without the Reolink API and sometimes I still get the error messages. However, when I restart the camera there are no more errors. It doesn't seem to be a problem with the API, but with the camera (Reolink: RLC-511W).
vs = VideoStream("rtsp://abcde:123456@192.168.178.xx:554//h264Preview_01_sub").start()
time.sleep(2)
while True:
try:
frame = vs.read()
frame = imutils.resize(frame, width=500)
orig = frame.copy()
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
frame = Image.fromarray(frame)
cv2.imshow("Test", orig)
except:
vs = VideoStream("rtsp://abcde:123456@192.168.178.65:554//h264Preview_01_sub").start()
key = cv2.waitKey(100) & 0xFF
if key == ord("q"):
print('')
break
cv2.destroyAllWindows()
vs.stop()
Hi all,
I just started playing with this. I'm just trying to get some consistent images from time to time. I'm using the streaming_video.py from examples folder but I'm getting a weird behaviour:
Also the image is rendered broken sometimes. How can I solve this?
Regards, C.