Last active
April 10, 2024 04:02
-
-
Save gagregrog/8bdcf04ec5051ebc75af5f3dcccdf5e8 to your computer and use it in GitHub Desktop.
View an RTSP stream in python with OpenCV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import imutils | |
from imutils.video import VideoStream | |
# replace this with the url generated by the Wyze app | |
rtsp_url = "rtsp://<camera_name>:<some_uuid>@<some_ip>/live" | |
vs = VideoStream(rtsp_url).start() | |
while True: | |
frame = vs.read() | |
if frame is None: | |
continue | |
frame = imutils.resize(frame, width=1200) | |
cv2.imshow('WyzeCam', frame) | |
key = cv2.waitKey(1) & 0xFF | |
if key == ord('q'): | |
break | |
cv2.destroyAllWindows() | |
vs.stop() |
thank you soo much
@pteran2403 Did you find any solution for that problem? I encountered the same problem as yours and I couldn't find any solution anywhere online.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I am reading a rstp stream using your code and it works fine but I keep getting the following warning.
[rtsp @ 00000207f9a02d40] Missing packets; dropping frame.
[rtsp @ 00000207f9a02d40] Missing packets; dropping frame.
[rtsp @ 00000207f9a02d40] Missing packets; dropping frame.
Any ideas why?