I want to capture frame from my camera when the specific event occurs
my code
import cv2
cap = cv2.VideoCapture("http://192.168.43.1:8080/video")
if int(data) < 45:
return_value, image = cap.read()
cv2.imwrite('Images/'+str(count)+'.png', image)
print("capture")
But its saving older frames when it capture please help i want current frame to be saved
data? how are you handling the "event"?