When capturing a frame in a camera video capture in opencv, how can i get the frame timestamp in system's timeframe instead of the camera timeframe?
cap = cv2.VideoCapture(1)
while(cap.isOpened()):
ret, frame = cap.read()
systime = time.time() # this is not an accurate way to measure timestamp in system time
camtime = cap.get(cv2.CAP_PROP_POS_MSEC)/1000.# this is the timestamp in camera time
This is needed because certain actions have to be triggered by the computer according to the results of the frame analyses. These actions are triggered using the system's time, so in order to calculate the correct time, the frame timestamp has to be in system's time