2026.6.30小更新

This commit is contained in:
2026-06-30 17:48:16 +08:00
parent 24e49b7218
commit d2411c9679
+2 -1
View File
@@ -97,7 +97,8 @@ class VideoStreaming:
""" 打开摄像头或 RTSP 流,并设置低延迟参数 """ """ 打开摄像头或 RTSP 流,并设置低延迟参数 """
try: try:
self.logger.info("正在连接视频源: %s", self.video_source) self.logger.info("正在连接视频源: %s", self.video_source)
self.cap = cv2.VideoCapture(self.video_source) os.environ['OPENCV_FFMPEG_CAPTURE_OPTIONS'] = 'rtsp_transport;tcp'
self.cap = cv2.VideoCapture(self.video_source, cv2.CAP_FFMPEG)
if self.is_rtsp: if self.is_rtsp:
# 设置 RTSP 缓冲区大小(只保留 1 帧,降低延迟) # 设置 RTSP 缓冲区大小(只保留 1 帧,降低延迟)