You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import cv2
|
|
|
|
class VideoStream:
|
|
def __init__(self, rtsp_url):
|
|
self.rtsp_url = rtsp_url
|
|
self.stream = cv2.VideoCapture(rtsp_url)
|
|
|
|
def get_frame(self):
|
|
ret, frame = self.stream.read()
|
|
if not ret:
|
|
return None
|
|
return frame
|