我正在使用Python OpenCV从RTSP实时流获取帧。在处理帧时,有时我需要暂停剪辑并恢复最新帧(意味着应该跳转最后/最新帧)
cap = cv2.VideoCapture(clip_url)
while (ret):
ret,image_np = cap.read()
time.sleep (1) # Just for ex, I am pausing, but next time it should read the latest frame
我试图得到长度/帧数,但它总是显示负值
totalframes = cap.get(cv2.CAP_PROP_FRAME_COUNT)
目前没有回答
相关问题 更多 >
编程相关推荐