-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
import cv2
import ffmpegcv
from ultralytics import YOLO
model = YOLO("yolo11n.pt")
STREAM_URL = "rtmp://192.168.1.100/live/test"
with ffmpegcv.ReadLiveLast(ffmpegcv.VideoCaptureStreamRT,
stream_url=STREAM_URL,
gpu=0,
resize=(1280, 720),
timeout=10,
resize_keepratio=False,
) as cap:
for frame in cap: # After running for a long time, it will get stuck here. If it doesn't enter the "for" section, it will keep getting stuck here
results = model(frame, stream=True)
for result in results:
annotated_frame = result.plot()
cv2.imshow("YOLO Inference", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
In the project, I used VideoCaptureStreamRT to pull the RTSP stream from the camera. After running for some time, I found that the program did not enter the for loop normally
Metadata
Metadata
Assignees
Labels
No labels